xunge/DecIR huggingface dataset:
hasCarry(unsigned int a, unsigned int b, unsigned int s) {
  return (((a >> 31) ^ (s >> 31)) & ((b >> 31) ^ (s >> 31))) ^ (a >> 31) ^
         (b >> 31) ^ (s >> 31);
}


x86 assembly (clang, -O0):
<hasCarry>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1f,%eax
mov    -0xc(%rbp),%ecx
shr    $0x1f,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%ecx
shr    $0x1f,%ecx
mov    -0xc(%rbp),%edx
shr    $0x1f,%edx
xor    %edx,%ecx
and    %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1f,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%ecx
shr    $0x1f,%ecx
xor    %ecx,%eax
mov    -0xc(%rbp),%ecx
shr    $0x1f,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasCarry>:
shr    $0x1f,%edi
shr    $0x1f,%edx
shr    $0x1f,%esi
xor    %edx,%esi
mov    %edx,%eax
xor    %edi,%eax
and    %esi,%eax
xor    %edi,%esi
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @hasCarry(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = lshr i32 %7, 31
%9 = load i32, i32* %6
%10 = lshr i32 %9, 31
%11 = xor i32 %8, %10
%12 = load i32, i32* %5
%13 = lshr i32 %12, 31
%14 = load i32, i32* %6
%15 = lshr i32 %14, 31
%16 = xor i32 %13, %15
%17 = and i32 %11, %16
%18 = load i32, i32* %4
%19 = lshr i32 %18, 31
%20 = xor i32 %17, %19
%21 = load i32, i32* %5
%22 = lshr i32 %21, 31
%23 = xor i32 %20, %22
%24 = load i32, i32* %6
%25 = lshr i32 %24, 31
%26 = xor i32 %23, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @hasCarry(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %0, 31
%5 = lshr i32 %2, 31
%6 = xor i32 %5, %4
%7 = lshr i32 %1, 31
%8 = xor i32 %5, %7
%9 = and i32 %6, %8
%10 = xor i32 %8, %4
%11 = xor i32 %10, %9
ret i32 %11
}
signed char C_Utils_min_sbyte(const signed char item1,
                              const signed char item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_min_sbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jle    112c <C_Utils_min_sbyte+0x2c>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <C_Utils_min_sbyte+0x33>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_min_sbyte>:
mov    %esi,%eax
cmp    %al,%dil
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @C_Utils_min_sbyte(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
br label %16
13: ; preds = %2
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @C_Utils_min_sbyte(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, %1
%4 = select i1 %3, i8 %0, i8 %1
ret i8 %4
}
void UserState_init() {}


x86 assembly (clang, -O0):
<UserState_init>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UserState_init>:
ret

LLVM IR (-O0):
define void @UserState_init() {
ret void
}

LLVM IR (-O2):
define void @UserState_init() {
ret void
}
/* Variables and functions */
int pow(int, int);
int squareOfSum(int size) {
  int square = 0;
  for (int i = 1; i <= size; i++) {
    square += i;
  }
  return pow(square, 2);
}


x86 assembly (clang, -O0):
<squareOfSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114c <squareOfSum+0x3c>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <squareOfSum+0x19>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<squareOfSum>:
test   %edi,%edi
jle    1131 <squareOfSum+0x21>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%edi
add    $0xffffffff,%edi
mov    $0x2,%esi
jmp    1030 <pow@plt>
xor    %edi,%edi
mov    $0x2,%esi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define i32 @squareOfSum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = add nsw i32 %11, %10
store i32 %12, i32* %3
br label %13
13: ; preds = %9
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %5
16: ; preds = %5
%17 = load i32, i32* %3
%18 = call i32 @pow(i32 %17, i32 2)
ret i32 %18
}

LLVM IR (-O2):
define i32 @squareOfSum(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
%16 = tail call i32 @pow(i32 %15, i32 2)
ret i32 %16
}
int func() { return 15; }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
mov    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @func() {
ret i32 15
}

LLVM IR (-O2):
define i32 @func() {
ret i32 15
}
/* Variables and functions */
double log(double);
double loginv(double lp) { return log(lp / (1 - lp)); }


x86 assembly (clang, -O0):
<loginv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loginv>:
movsd  0xee8(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @loginv(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
%6 = fdiv double %3, %5
%7 = call double @log(double %6)
ret double %7
}

LLVM IR (-O2):
define double @loginv(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fdiv double %0, %2
%4 = tail call double @log(double %3)
ret double %4
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *BuildTree(char *, int *);
int /*<<< orphan*/ preorder(struct node *);
int main() {
  char *arr = "IIILLLILIILLL";
  int n = 0;
  struct node *res = BuildTree(arr, &n);
  preorder(res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <BuildTree@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <preorder@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <BuildTree@plt>
mov    %rax,%rdi
call   1030 <preorder@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [14 x i8] c"IIILLLILIILLL\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca %struct.node*
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %1
store i32 0, i32* %2
%4 = load i8*, i8** %1
%5 = call %struct.node* @BuildTree(i8* %4, i32* %2)
store %struct.node* %5, %struct.node** %3
%6 = load %struct.node*, %struct.node** %3
%7 = call i32 @preorder(%struct.node* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [14 x i8] c"IIILLLILIILLL\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call %struct.node* @BuildTree(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @preorder(%struct.node* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_dcs(char *, char const *);
void decrqss(const char *pn) { do_dcs("$q%s", pn); }


x86 assembly (clang, -O0):
<decrqss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <do_dcs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrqss>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <do_dcs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"$q%s\00"
define void @decrqss(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @do_dcs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"$q%s\00"
define void @decrqss(i8* %0) {
%2 = tail call i32 @do_dcs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int int_lt(int *a, int *b) { return *b < *a; }


x86 assembly (clang, -O0):
<int_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_lt>:
mov    (%rsi),%ecx
xor    %eax,%eax
cmp    (%rdi),%ecx
setl   %al
ret

LLVM IR (-O0):
define i32 @int_lt(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = icmp slt i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @int_lt(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = icmp slt i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ pause();
void infinity(void) {
  while (1)
    pause();
}


x86 assembly (clang, -O0):
<infinity>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <infinity+0x9>
mov    $0x0,%al
call   1030 <pause@plt>
jmp    1119 <infinity+0x9>

x86 assembly (clang, -O2):
<infinity>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <pause@plt>
jmp    1120 <infinity+0x10>

LLVM IR (-O0):
define void @infinity() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @pause()
br label %1
}

LLVM IR (-O2):
define void @infinity() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @pause()
br label %1
}
void end_mtproc_info(struct task_struct *p) {}


x86 assembly (clang, -O0):
<end_mtproc_info>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_mtproc_info>:
ret

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @end_mtproc_info(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @end_mtproc_info(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dotest(int, char *);
int main() {
  dotest(26, "{{15, 21}{21, 15}}");
  dotest(100, "{}");
  dotest(37, "{{21, 31}{31, 21}}");
  dotest(101, "{{55, 91}{91, 55}}");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1a,%edi
lea    0xee0(%rip),%rsi
call   1030 <dotest@plt>
mov    $0x64,%edi
lea    0xee2(%rip),%rsi
call   1030 <dotest@plt>
mov    $0x25,%edi
lea    0xed4(%rip),%rsi
call   1030 <dotest@plt>
mov    $0x65,%edi
lea    0xed6(%rip),%rsi
call   1030 <dotest@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1a,%edi
call   1030 <dotest@plt>
lea    0xeea(%rip),%rsi
mov    $0x64,%edi
call   1030 <dotest@plt>
lea    0xedc(%rip),%rsi
mov    $0x25,%edi
call   1030 <dotest@plt>
lea    0xede(%rip),%rsi
mov    $0x65,%edi
call   1030 <dotest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"{{15, 21}{21, 15}}\00"
@.str.1 = [3 x i8] c"{}\00"
@.str.2 = [19 x i8] c"{{21, 31}{31, 21}}\00"
@.str.3 = [19 x i8] c"{{55, 91}{91, 55}}\00"
define i32 @main() {
%1 = call i32 @dotest(i32 26, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @dotest(i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @dotest(i32 37, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @dotest(i32 101, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"{{15, 21}{21, 15}}\00"
@.str.1 = [3 x i8] c"{}\00"
@.str.2 = [19 x i8] c"{{21, 31}{31, 21}}\00"
@.str.3 = [19 x i8] c"{{55, 91}{91, 55}}\00"
define i32 @main() {
%1 = tail call i32 @dotest(i32 26, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @dotest(i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @dotest(i32 37, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @dotest(i32 101, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
void stdout_open(char *dev) { return; }


x86 assembly (clang, -O0):
<stdout_open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdout_open>:
ret

LLVM IR (-O0):
define void @stdout_open(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @stdout_open(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strstr(char *, char *);
int remove_end(char *line, char *end) {
  char *found;
  found = strstr(line, end);
  if (found) {
    *found = 0;
    return 0;
  } else {
    fprintf(stderr, "%s not found in %s\n", end, line);
    return -1;
  }
}


x86 assembly (clang, -O0):
<remove_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115f <remove_end+0x3f>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1183 <remove_end+0x63>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe89(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_end>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strstr@plt>
test   %rax,%rax
je     113b <remove_end+0x1b>
movb   $0x0,(%rax)
xor    %eax,%eax
jmp    115b <remove_end+0x3b>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"%s not found in %s\0A\00"
define i32 @remove_end(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i8* @strstr(i8* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i8*, i8** %6
store i8 0, i8* %13
store i32 0, i32* %3
br label %19
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17)
store i32 -1, i32* %3
br label %19
19: ; preds = %14, %12
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"%s not found in %s\0A\00"
define i32 @remove_end(i8* %0, i8* %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
store i8 0, i8* %3
br label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ 0, %5 ], [ -1, %6 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fh_cli_term_restore();
int /*<<< orphan*/ fh_cli_write(char *);
void fh_cli_quit() {
  fh_cli_write("Terminating CLI session...\n");
  fh_cli_term_restore();
  exit(0);
}


x86 assembly (clang, -O0):
<fh_cli_quit>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <fh_cli_write@plt>
mov    $0x0,%al
call   1030 <fh_cli_term_restore@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fh_cli_quit>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <fh_cli_write@plt>
xor    %eax,%eax
call   1030 <fh_cli_term_restore@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Terminating CLI session...\0A\00"
define void @fh_cli_quit() {
%1 = call i32 @fh_cli_write(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @fh_cli_term_restore()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [28 x i8] c"Terminating CLI session...\0A\00"
define void @fh_cli_quit() {
%1 = tail call i32 @fh_cli_write(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @fh_cli_term_restore()
%3 = tail call i32 @exit(i32 0)
unreachable
}
void fip(int *i) {}


x86 assembly (clang, -O0):
<fip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fip>:
ret

LLVM IR (-O0):
define void @fip(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret void
}

LLVM IR (-O2):
define void @fip(i32* nocapture %0) {
ret void
}
double distance(x, x1, y, y1) {
  return sqrt(((x - x1) * (x - x1)) + ((y - y1) * (y - y1)));
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
imul   %ecx,%eax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
sub    -0x10(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
sub    %esi,%edi
imul   %edi,%edi
sub    %ecx,%edx
imul   %edx,%edx
add    %edi,%edx
cvtsi2sd %edx,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112f <distance+0x1f>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = sub nsw i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = sub nsw i32 %16, %17
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = sub nsw i32 %19, %20
%22 = mul nsw i32 %18, %21
%23 = add nsw i32 %15, %22
%24 = sitofp i32 %23 to double
%25 = call double @sqrt(double %24)
ret double %25
}

LLVM IR (-O2):
define double @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %1
%6 = mul nsw i32 %5, %5
%7 = sub nsw i32 %2, %3
%8 = mul nsw i32 %7, %7
%9 = add nuw nsw i32 %8, %6
%10 = sitofp i32 %9 to double
%11 = tail call double @sqrt(double %10)
ret double %11
}
/* Variables and functions */
int is_setting_active(char *);
int is_csum_active() {
  return is_setting_active("/proc/sys/net/mptcp/mptcp_checksum");
}


x86 assembly (clang, -O0):
<is_csum_active>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <is_setting_active@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_csum_active>:
lea    0xee9(%rip),%rdi
jmp    1030 <is_setting_active@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"/proc/sys/net/mptcp/mptcp_checksum\00"
define i32 @is_csum_active() {
%1 = call i32 @is_setting_active(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [35 x i8] c"/proc/sys/net/mptcp/mptcp_checksum\00"
define i32 @is_csum_active() {
%1 = tail call i32 @is_setting_active(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ add_pre_buffer(char *);
char **handle_nostdinc(char *arg, char **next) {
  add_pre_buffer("#nostdinc\n");
  return next;
}


x86 assembly (clang, -O0):
<handle_nostdinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <add_pre_buffer@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_nostdinc>:
push   %rbx
mov    %rsi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <add_pre_buffer@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"#nostdinc\0A\00"
define i8** @handle_nostdinc(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = call i32 @add_pre_buffer(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = load i8**, i8*** %4
ret i8** %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"#nostdinc\0A\00"
define i8** @handle_nostdinc(i8* nocapture readnone %0, i8** readnone returned %1) {
%3 = tail call i32 @add_pre_buffer(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8** %1
}
int getfilelist_null(const char *filename, const char *dir) {
  (void)(filename);
  (void)(dir);
  return 0;
}


x86 assembly (clang, -O0):
<getfilelist_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfilelist_null>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @getfilelist_null(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @getfilelist_null(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
char *strcpy(char *s, const char *t) {
  char *os = s;
  while ((*s++ = *t++) != 0)
    ;
  return os;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

LLVM IR (-O0):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %15, %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 %10, i8* %11
%13 = sext i8 %10 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %7
br label %7
16: ; preds = %7
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int, int);
void zero_str(char *what, int start, int end) {
  memset(&what[start], 0x00, end - start);
}


x86 assembly (clang, -O0):
<zero_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%edx
sub    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_str>:
movslq %esi,%rax
add    %rax,%rdi
sub    %eax,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @zero_str(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = sub nsw i32 %11, %12
%14 = call i32 @memset(i8* %10, i32 0, i32 %13)
ret void
}

LLVM IR (-O2):
define void @zero_str(i8* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = sub nsw i32 %2, %1
%7 = tail call i32 @memset(i8* %5, i32 0, i32 %6)
ret void
}
void foo3d() {}


x86 assembly (clang, -O0):
<foo3d>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3d>:
ret

LLVM IR (-O0):
define void @foo3d() {
ret void
}

LLVM IR (-O2):
define void @foo3d() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func1(int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  srand(time(NULL));
  while (1)
    func1(rand() % 101);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x65,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <func1@plt>
jmp    1166 <main+0x26>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
nop
xor    %eax,%eax
call   1060 <rand@plt>
movslq %eax,%rdi
imul   $0x288df0cb,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
imul   $0x65,%eax,%eax
sub    %eax,%edi
call   1030 <func1@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
br label %8
8: ; preds = %2, %8
%9 = call i32 (...) @rand()
%10 = srem i32 %9, 101
%11 = call i32 @func1(i32 %10)
br label %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
br label %5
5: ; preds = %2, %5
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 101
%8 = tail call i32 @func1(i32 %7)
br label %5
}
double Media(double val_a, double val_b) { return ((val_a + val_b) / 2); }


x86 assembly (clang, -O0):
<Media>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Media>:
addsd  %xmm1,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Media(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
%8 = fdiv double %7, 2.000000e+00
ret double %8
}

LLVM IR (-O2):
define double @Media(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fmul double %3, 5.000000e-01
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ preload_seq(int);
void main(void) {
  preload_seq(173);
  preload_seq(421);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xad,%edi
call   1030 <preload_seq@plt>
mov    $0x1a5,%edi
call   1030 <preload_seq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xad,%edi
call   1030 <preload_seq@plt>
mov    $0x1a5,%edi
pop    %rax
jmp    1030 <preload_seq@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @preload_seq(i32 173)
%2 = call i32 @preload_seq(i32 421)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @preload_seq(i32 173)
%2 = tail call i32 @preload_seq(i32 421)
ret void
}
int count_trailing_zeros_in_factorial(int n) {
  int cnt = 0, fpow;
  if (n == 5)
    return 1;
  for (fpow = 5; (n / fpow >= 1); fpow *= 5) {
    cnt += n / fpow;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<count_trailing_zeros_in_factorial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    1124 <count_trailing_zeros_in_factorial+0x24>
movl   $0x1,-0x4(%rbp)
jmp    115a <count_trailing_zeros_in_factorial+0x5a>
movl   $0x5,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x1,%eax
jl     1154 <count_trailing_zeros_in_factorial+0x54>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x5,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112b <count_trailing_zeros_in_factorial+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_trailing_zeros_in_factorial>:
mov    $0x1,%ecx
cmp    $0x5,%edi
je     113e <count_trailing_zeros_in_factorial+0x3e>
xor    %ecx,%ecx
cmp    $0x5,%edi
jl     113e <count_trailing_zeros_in_factorial+0x3e>
mov    %edi,%ecx
mov    $0xcccccccd,%eax
imul   %rcx,%rax
shr    $0x22,%rax
xor    %ecx,%ecx
mov    $0x5,%esi
nopw   0x0(%rax,%rax,1)
add    %eax,%ecx
lea    (%rsi,%rsi,4),%esi
mov    %edi,%eax
cltd
idiv   %esi
test   %eax,%eax
jg     1130 <count_trailing_zeros_in_factorial+0x30>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @count_trailing_zeros_in_factorial(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 5
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %26
9: ; preds = %1
store i32 5, i32* %5
br label %10
10: ; preds = %21, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = sdiv i32 %11, %12
%14 = icmp sge i32 %13, 1
br i1 %14, label %15, label %24
15: ; preds = %10
%16 = load i32, i32* %3
%17 = load i32, i32* %5
%18 = sdiv i32 %16, %17
%19 = load i32, i32* %4
%20 = add nsw i32 %19, %18
store i32 %20, i32* %4
br label %21
21: ; preds = %15
%22 = load i32, i32* %5
%23 = mul nsw i32 %22, 5
store i32 %23, i32* %5
br label %10
24: ; preds = %10
%25 = load i32, i32* %4
store i32 %25, i32* %2
br label %26
26: ; preds = %24, %8
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @count_trailing_zeros_in_factorial(i32 %0) {
%2 = icmp eq i32 %0, 5
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 4
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = udiv i32 %0, 5
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ %13, %7 ], [ %6, %5 ]
%9 = phi i32 [ %12, %7 ], [ 5, %5 ]
%10 = phi i32 [ %11, %7 ], [ 0, %5 ]
%11 = add nsw i32 %8, %10
%12 = mul nuw nsw i32 %9, 5
%13 = sdiv i32 %0, %12
%14 = icmp sgt i32 %13, 0
br i1 %14, label %7, label %15
15: ; preds = %7, %3, %1
%16 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %11, %7 ]
ret i32 %16
}
/* Variables and functions */
int nextPos_0(int);
int positiveEdge_0(int, int);
int node_curPos(int btnNext_at_last, int btnNext, int curPos_at_last,
                int *output) {
  int _tmp004;
  int _tmp003;
  _tmp004 = positiveEdge_0(btnNext_at_last, btnNext);
  if (_tmp004 == 1) {
    _tmp003 = nextPos_0(curPos_at_last);
  } else if (_tmp004 == 0) {
    _tmp003 = curPos_at_last;
  }
  *output = _tmp003;
  return 1;
}


x86 assembly (clang, -O0):
<node_curPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <positiveEdge_0@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    115d <node_curPos+0x3d>
mov    -0xc(%rbp),%edi
call   1040 <nextPos_0@plt>
mov    %eax,-0x20(%rbp)
jmp    1172 <node_curPos+0x52>
cmpl   $0x0,-0x1c(%rbp)
jne    116d <node_curPos+0x4d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1172 <node_curPos+0x52>
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<node_curPos>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%ebp
call   1030 <positiveEdge_0@plt>
cmp    $0x1,%eax
jne    113b <node_curPos+0x1b>
mov    %ebp,%edi
call   1040 <nextPos_0@plt>
mov    %eax,%ebp
mov    %ebp,(%rbx)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @node_curPos(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @positiveEdge_0(i32 %11, i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %19
16: ; preds = %4
%17 = load i32, i32* %7
%18 = call i32 @nextPos_0(i32 %17)
store i32 %18, i32* %10
br label %25
19: ; preds = %4
%20 = load i32, i32* %9
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = load i32, i32* %7
store i32 %23, i32* %10
br label %24
24: ; preds = %22, %19
br label %25
25: ; preds = %24, %16
%26 = load i32, i32* %10
%27 = load i32*, i32** %8
store i32 %26, i32* %27
ret i32 1
}

LLVM IR (-O2):
define i32 @node_curPos(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
%5 = tail call i32 @positiveEdge_0(i32 %0, i32 %1)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @nextPos_0(i32 %2)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ %2, %4 ]
store i32 %10, i32* %3
ret i32 1
}
/* Variables and functions */
void *malloc(size_t);
void *kmalloc(size_t bytes) { return malloc(bytes); }


x86 assembly (clang, -O0):
<kmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmalloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @kmalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @kmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ generic_cpu_swap32p(int /*<<< orphan*/ *, int);
void generic_cpu_swap64p_32(uint64_t *outp, uint64_t in) {
  uint32_t *_outp = (uint32_t *)outp;
  generic_cpu_swap32p(_outp, in);
  generic_cpu_swap32p(_outp + 1, in >> 32);
}


x86 assembly (clang, -O0):
<generic_cpu_swap64p_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <generic_cpu_swap32p@plt>
mov    -0x18(%rbp),%rdi
add    $0x4,%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
call   1030 <generic_cpu_swap32p@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_cpu_swap64p_32>:
push   %rbx
mov    %rdi,%rbx
call   1030 <generic_cpu_swap32p@plt>
add    $0x4,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <generic_cpu_swap32p@plt>

LLVM IR (-O0):
define void @generic_cpu_swap64p_32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %4
%9 = call i32 @generic_cpu_swap32p(i32* %7, i32 %8)
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %4
%13 = ashr i32 %12, 32
%14 = call i32 @generic_cpu_swap32p(i32* %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @generic_cpu_swap64p_32(i32* %0, i32 %1) {
%3 = tail call i32 @generic_cpu_swap32p(i32* %0, i32 %1)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = tail call i32 @generic_cpu_swap32p(i32* %4, i32 poison)
ret void
}
/* Variables and functions */
int atoi(char *);
void uwsgi_opt_set_rawint(char *opt, char *value, void *key) {
  int *ptr = (int *)key;
  if (value) {
    *ptr = atoi((char *)value);
  } else {
    *ptr = 1;
  }
}


x86 assembly (clang, -O0):
<uwsgi_opt_set_rawint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <uwsgi_opt_set_rawint+0x3d>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    1157 <uwsgi_opt_set_rawint+0x47>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_opt_set_rawint>:
push   %rbx
mov    %rdx,%rbx
test   %rsi,%rsi
je     1123 <uwsgi_opt_set_rawint+0x13>
mov    %rsi,%rdi
call   1030 <atoi@plt>
jmp    1128 <uwsgi_opt_set_rawint+0x18>
mov    $0x1,%eax
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @uwsgi_opt_set_rawint(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = call i32 @atoi(i8* %13)
%15 = load i32*, i32** %7
store i32 %14, i32* %15
br label %18
16: ; preds = %3
%17 = load i32*, i32** %7
store i32 1, i32* %17
br label %18
18: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
define void @uwsgi_opt_set_rawint(i8* nocapture readnone %0, i8* %1, i8* nocapture writeonly %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @atoi(i8* %1)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 1, %3 ]
%9 = bitcast i8* %2 to i32*
store i32 %8, i32* %9
ret void
}
/* Variables and functions */
int func_by_name(char *);
int invalid(void) { return func_by_name("invalid"); }


x86 assembly (clang, -O0):
<invalid>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <func_by_name@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalid>:
lea    0xee9(%rip),%rdi
jmp    1030 <func_by_name@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"invalid\00"
define i32 @invalid() {
%1 = call i32 @func_by_name(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"invalid\00"
define i32 @invalid() {
%1 = tail call i32 @func_by_name(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ipc_exchange(int, int /*<<< orphan*/);
void ipc_slowping(void) { ipc_exchange(0x00000000, 0); }


x86 assembly (clang, -O0):
<ipc_slowping>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <ipc_exchange@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipc_slowping>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <ipc_exchange@plt>

LLVM IR (-O0):
define void @ipc_slowping() {
%1 = call i32 @ipc_exchange(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @ipc_slowping() {
%1 = tail call i32 @ipc_exchange(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void _string(char *in_string) { fprintf(stdout, "%s", in_string); }


x86 assembly (clang, -O0):
<_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_string>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @_string(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ r_themes_left();
int rand();
int should_pick(void) { return r_themes_left() && (rand() % 2) == 0; }


x86 assembly (clang, -O0):
<should_pick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <r_themes_left@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1159 <should_pick+0x39>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<should_pick>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <r_themes_left@plt>
test   %rax,%rax
je     113d <should_pick+0x1d>
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%ebx
not    %ebx
and    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @should_pick() {
%1 = call i64 (...) @r_themes_left()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br label %7
7: ; preds = %3, %0
%8 = phi i1 [ false, %0 ], [ %6, %3 ]
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @should_pick() {
%1 = tail call i64 (...) @r_themes_left()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 (...) @rand()
%5 = and i32 %4, 1
%6 = xor i32 %5, 1
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cargaFicheroBinario() { printf("Carga un fichero binario en memoria\n"); }


x86 assembly (clang, -O0):
<cargaFicheroBinario>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cargaFicheroBinario>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Carga un fichero binario en memoria\0A\00"
define void @cargaFicheroBinario() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"Carga un fichero binario en memoria\00"
define void @cargaFicheroBinario() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct msghdr {
  int dummy;
};

/* Variables and functions */
int recvmsg(int, struct msghdr *, int);
int plat_recvmsg(int s, struct msghdr *msg, int flags) {
  return (recvmsg(s, msg, flags));
}


x86 assembly (clang, -O0):
<plat_recvmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <recvmsg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plat_recvmsg>:
jmp    1030 <recvmsg@plt>

LLVM IR (-O0):
%struct.msghdr = type { i32 }
define i32 @plat_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.msghdr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.msghdr* %1, %struct.msghdr** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.msghdr*, %struct.msghdr** %5
%9 = load i32, i32* %6
%10 = call i32 @recvmsg(i32 %7, %struct.msghdr* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.msghdr = type { i32 }
define i32 @plat_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = tail call i32 @recvmsg(i32 %0, %struct.msghdr* %1, i32 %2)
ret i32 %4
}
int strcmp(s, t)
register char *s, *t;
{
  while (*s == *t++)
    if (*s++ == '\0')
      return 0;
  return *s - *--t;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <strcmp+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <strcmp+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1178 <strcmp+0x78>
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
movsbl -0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movsbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <strcmp+0x27>
add    $0x1,%rcx
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %22, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %5
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %9, %13
br i1 %14, label %15, label %23
15: ; preds = %6
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
%18 = load i8, i8* %16
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %15
store i32 0, i32* %3
br label %32
22: ; preds = %15
br label %6
23: ; preds = %6
%24 = load i8*, i8** %4
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i32 -1
store i8* %28, i8** %5
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = sub nsw i32 %26, %30
store i32 %31, i32* %3
br label %32
32: ; preds = %23, %21
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %17, label %3
13: ; preds = %3
%14 = sext i8 %6 to i32
%15 = sext i8 %7 to i32
%16 = sub nsw i32 %14, %15
br label %17
17: ; preds = %9, %13
%18 = phi i32 [ %16, %13 ], [ 0, %9 ]
ret i32 %18
}