1 | #include <stdio.h> |
2 | |
3 | __attribute__((nodebug)) int no_branch_func(void) { |
4 | int result = 0; |
5 | |
6 | __asm__ __volatile__("movl $0, %%eax;" // Assembly start |
7 | "incl %%eax;" |
8 | "incl %%eax;" |
9 | "incl %%eax;" |
10 | "incl %%eax;" |
11 | "incl %%eax;" |
12 | "incl %%eax;" |
13 | "incl %%eax;" |
14 | "incl %%eax;" |
15 | "incl %%eax;" |
16 | "incl %%eax;" |
17 | "movl %%eax, %0;" // Assembly end |
18 | : "=r" (result) |
19 | : |
20 | : "%eax" ); |
21 | |
22 | return result; |
23 | } |
24 | |
25 | int main(void) { |
26 | int result = no_branch_func(); // Break here |
27 | printf(format: "Result: %d\n" , result); |
28 | return 0; |
29 | } |
30 | |