xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void calculateTriangularNumber(int n) {
  int i, triangularNumber = 0;
  for (i = 1; i <= n; ++i) {
    triangularNumber += i;
  }
  printf("triangular number %i is %i\n", n, triangularNumber);
}


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

x86 assembly (clang, -O2):
<calculateTriangularNumber>:
mov    %edi,%esi
test   %edi,%edi
jle    1135 <calculateTriangularNumber+0x25>
lea    -0x1(%rsi),%eax
lea    -0x2(%rsi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rsi,2),%edx
add    $0xffffffff,%edx
lea    0xed0(%rip),%rdi
jmp    1030 <printf@plt>
xor    %edx,%edx
lea    0xec2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"triangular number %i is %i\0A\00"
define void @calculateTriangularNumber(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 1, i32* %3
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %3
%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* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, %10
store i32 %12, i32* %4
br label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = load i32, i32* %2
%18 = load i32, i32* %4
%19 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"triangular number %i is %i\0A\00"
define void @calculateTriangularNumber(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 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %15)
ret void
}
void INT_Excep_PERIB_INTB176(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB176() {
ret void
}
/* Variables and functions */
int reteload_one_byte();
unsigned long reteload_four_bytes() {
  unsigned long i;
  i = reteload_one_byte();
  i += (reteload_one_byte() << 8);
  i += (reteload_one_byte() << 16);
  i += (reteload_one_byte() << 24);
  return i;
}


x86 assembly (clang, -O0):
<reteload_four_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <reteload_one_byte@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <reteload_one_byte@plt>
shl    $0x8,%eax
cltq
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <reteload_one_byte@plt>
shl    $0x10,%eax
cltq
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <reteload_one_byte@plt>
shl    $0x18,%eax
cltq
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reteload_four_bytes>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <reteload_one_byte@plt>
movslq %eax,%r14
xor    %eax,%eax
call   1030 <reteload_one_byte@plt>
shl    $0x8,%eax
movslq %eax,%rbx
add    %r14,%rbx
xor    %eax,%eax
call   1030 <reteload_one_byte@plt>
shl    $0x10,%eax
movslq %eax,%r14
add    %rbx,%r14
xor    %eax,%eax
call   1030 <reteload_one_byte@plt>
shl    $0x18,%eax
cltq
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @reteload_four_bytes() {
%1 = alloca i64
%2 = call i32 (...) @reteload_one_byte()
%3 = sext i32 %2 to i64
store i64 %3, i64* %1
%4 = call i32 (...) @reteload_one_byte()
%5 = shl i32 %4, 8
%6 = sext i32 %5 to i64
%7 = load i64, i64* %1
%8 = add i64 %7, %6
store i64 %8, i64* %1
%9 = call i32 (...) @reteload_one_byte()
%10 = shl i32 %9, 16
%11 = sext i32 %10 to i64
%12 = load i64, i64* %1
%13 = add i64 %12, %11
store i64 %13, i64* %1
%14 = call i32 (...) @reteload_one_byte()
%15 = shl i32 %14, 24
%16 = sext i32 %15 to i64
%17 = load i64, i64* %1
%18 = add i64 %17, %16
store i64 %18, i64* %1
%19 = load i64, i64* %1
ret i64 %19
}

LLVM IR (-O2):
define i64 @reteload_four_bytes() {
%1 = tail call i32 (...) @reteload_one_byte()
%2 = sext i32 %1 to i64
%3 = tail call i32 (...) @reteload_one_byte()
%4 = shl i32 %3, 8
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %2
%7 = tail call i32 (...) @reteload_one_byte()
%8 = shl i32 %7, 16
%9 = sext i32 %8 to i64
%10 = add nsw i64 %6, %9
%11 = tail call i32 (...) @reteload_one_byte()
%12 = shl i32 %11, 24
%13 = sext i32 %12 to i64
%14 = add nsw i64 %10, %13
ret i64 %14
}
void CreateI4(unsigned char *buf, int nValue) {
  buf[0] = (nValue >> 24) & 0xff;
  buf[1] = (nValue >> 16) & 0xff;
  buf[2] = (nValue >> 8) & 0xff;
  buf[3] = (nValue)&0xff;
}


x86 assembly (clang, -O0):
<CreateI4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateI4>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @CreateI4(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 16
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %4
%18 = ashr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i32, i32* %4
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @CreateI4(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void FreeArrayMap(double ***t) {
  free((char *)t[0]);
  free((char *)t);
}


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

x86 assembly (clang, -O2):
<FreeArrayMap>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @FreeArrayMap(double*** %0) {
%2 = alloca double***
store double*** %0, double**** %2
%3 = load double***, double**** %2
%4 = getelementptr inbounds double**, double*** %3, i64 0
%5 = load double**, double*** %4
%6 = bitcast double** %5 to i8*
%7 = call i32 @free(i8* %6)
%8 = load double***, double**** %2
%9 = bitcast double*** %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @FreeArrayMap(double*** nocapture %0) {
%2 = bitcast double*** %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
%5 = bitcast double*** %0 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x0f() {
  Assert_real((islower(15) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              80, ("islower should be 0 for 0x0f"));
}


x86 assembly (clang, -O0):
<t_islower_0x0f>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x50,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x0f>:
push   %rax
mov    $0xf,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x50,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x0f\00"
define void @t_islower_0x0f() {
%1 = call i64 @islower(i32 15)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 80, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x0f\00"
define void @t_islower_0x0f() {
%1 = tail call i64 @islower(i32 15)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 80, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct atrf_dsc {
  int dummy;
};

/* Variables and functions */
void *atrf_ben_regs(struct atrf_dsc *dsc) { return NULL; }


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

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

LLVM IR (-O0):
%struct.atrf_dsc = type { i32 }
define i8* @atrf_ben_regs(%struct.atrf_dsc* %0) {
%2 = alloca %struct.atrf_dsc*
store %struct.atrf_dsc* %0, %struct.atrf_dsc** %2
ret i8* null
}

LLVM IR (-O2):
%struct.atrf_dsc = type { i32 }
define noalias i8* @atrf_ben_regs(%struct.atrf_dsc* nocapture readnone %0) {
ret i8* null
}
void UserInterleavedBridgeOverflowCalloutf(void) {}


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

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

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

LLVM IR (-O2):
define void @UserInterleavedBridgeOverflowCalloutf() {
ret void
}
void f16(void) {}


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

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

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

LLVM IR (-O2):
define void @f16() {
ret void
}
int ctoi(int c) {
  if (c == '=')
    return 0;
  if (c <= '9')
    return c + 4;
  else if (c <= 'Z')
    return c - 65;
  else
    return c - 71;
}


x86 assembly (clang, -O0):
<ctoi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3d,-0x8(%rbp)
jne    111d <ctoi+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1156 <ctoi+0x56>
cmpl   $0x39,-0x8(%rbp)
jg     1135 <ctoi+0x35>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <ctoi+0x56>
cmpl   $0x5a,-0x8(%rbp)
jg     114d <ctoi+0x4d>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <ctoi+0x56>
mov    -0x8(%rbp),%eax
sub    $0x47,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctoi>:
xor    %eax,%eax
cmp    $0x3d,%edi
je     1120 <ctoi+0x20>
cmp    $0x39,%edi
jg     1111 <ctoi+0x11>
add    $0x4,%edi
jmp    111e <ctoi+0x1e>
cmp    $0x5a,%edi
ja     111b <ctoi+0x1b>
add    $0xffffffbf,%edi
jmp    111e <ctoi+0x1e>
add    $0xffffffb9,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @ctoi(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 61
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %22
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 57
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 4
store i32 %12, i32* %2
br label %22
13: ; preds = %7
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 90
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 65
store i32 %18, i32* %2
br label %22
19: ; preds = %13
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 71
store i32 %21, i32* %2
br label %22
22: ; preds = %19, %16, %10, %6
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @ctoi(i32 %0) {
%2 = icmp eq i32 %0, 61
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 58
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = add nsw i32 %0, 4
br label %13
7: ; preds = %3
%8 = icmp ult i32 %0, 91
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = add nsw i32 %0, -65
br label %13
11: ; preds = %7
%12 = add nsw i32 %0, -71
br label %13
13: ; preds = %1, %11, %9, %5
%14 = phi i32 [ %6, %5 ], [ %10, %9 ], [ %12, %11 ], [ 0, %1 ]
ret i32 %14
}
/* Variables and functions */
int des_key_sched(void *, void *);
int kcglue_des_key_sched(void *akey, void *asched) {
  return des_key_sched(akey, asched);
}


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

x86 assembly (clang, -O2):
<kcglue_des_key_sched>:
jmp    1030 <des_key_sched@plt>

LLVM IR (-O0):
define i32 @kcglue_des_key_sched(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
%7 = call i32 @des_key_sched(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @kcglue_des_key_sched(i8* %0, i8* %1) {
%3 = tail call i32 @des_key_sched(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int str_to_int(char *);
int cmp_int(char *a, char *b) {
  int an = str_to_int(a);
  int bn = str_to_int(b);
  return an - bn;
}


x86 assembly (clang, -O0):
<cmp_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <str_to_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <str_to_int@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <str_to_int@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <str_to_int@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cmp_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @str_to_int(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @str_to_int(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = sub nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @cmp_int(i8* %0, i8* %1) {
%3 = tail call i32 @str_to_int(i8* %0)
%4 = tail call i32 @str_to_int(i8* %1)
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
scalar_t__ strlen(char const *);
scalar_t__ strspn(char const *, char *);
int is_number(const char *str) {
  return strspn(str, "\t -+01234567890./\n") == strlen(str);
}


x86 assembly (clang, -O0):
<is_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strspn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_number>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1040 <strspn@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    %rax,%r14
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\09 -+01234567890./\0A\00"
define i32 @is_number(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strspn(i8* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [19 x i8] c"\09 -+01234567890./\0A\00"
define i32 @is_number(i8* nocapture %0) {
%2 = tail call i64 @strspn(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int fib(int n, int a, int b) {
  if (n <= 1)
    return a;
  else
    return fib(n - 1, b, a + b);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1136 <fib+0x26>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <fib+0x3d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
add    -0x10(%rbp),%edx
call   1030 <fib@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
cmp    $0x2,%edi
jge    1108 <fib+0x8>
mov    %esi,%eax
ret
add    $0x1,%edi
nopl   0x0(%rax,%rax,1)
mov    %edx,%eax
add    %edx,%esi
add    $0xffffffff,%edi
mov    %esi,%edx
mov    %eax,%esi
cmp    $0x2,%edi
ja     1110 <fib+0x10>
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, 2
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ %2, %3 ]
%7 = phi i32 [ %6, %5 ], [ %1, %3 ]
%8 = phi i32 [ %9, %5 ], [ %0, %3 ]
%9 = add nsw i32 %8, -1
%10 = add nsw i32 %6, %7
%11 = icmp ult i32 %8, 3
br i1 %11, label %12, label %5
12: ; preds = %5, %3
%13 = phi i32 [ %1, %3 ], [ %6, %5 ]
ret i32 %13
}
unsigned xrop3_18_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_18_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_18_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
mov    %eax,%edx
xor    $0xffffff00,%edx
or     %ecx,%eax
or     %edx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_18_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %7
%45 = and i32 %43, %44
%46 = or i32 %42, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_18_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -256
%8 = or i32 %6, %4
%9 = or i32 %8, %7
%10 = xor i32 %9, -1
%11 = or i8 %1, %0
%12 = zext i8 %11 to i32
%13 = or i32 %12, %10
ret i32 %13
}
/* Variables and functions */
double dnbinom(unsigned int, double, double);
double dnbinom_mu(unsigned int x, double size, double mu) {
  double p;
  if (size <= 0)
    return 0;
  if (mu <= 0)
    return 0;
  p = mu / (size + mu);
  return dnbinom(x, size, p);
}


x86 assembly (clang, -O0):
<dnbinom_mu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1140 <dnbinom_mu+0x30>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118a <dnbinom_mu+0x7a>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     115b <dnbinom_mu+0x4b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118a <dnbinom_mu+0x7a>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0xc(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <dnbinom@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnbinom_mu>:
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
jae    1131 <dnbinom_mu+0x21>
ucomisd %xmm1,%xmm2
jae    1131 <dnbinom_mu+0x21>
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm1
jmp    1030 <dnbinom@plt>
xorpd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dnbinom_mu(i32 %0, double %1, double %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double %2, double* %7
%9 = load double, double* %6
%10 = fcmp ole double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %3
store double 0.000000e+00, double* %4
br label %26
12: ; preds = %3
%13 = load double, double* %7
%14 = fcmp ole double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %12
store double 0.000000e+00, double* %4
br label %26
16: ; preds = %12
%17 = load double, double* %7
%18 = load double, double* %6
%19 = load double, double* %7
%20 = fadd double %18, %19
%21 = fdiv double %17, %20
store double %21, double* %8
%22 = load i32, i32* %5
%23 = load double, double* %6
%24 = load double, double* %8
%25 = call double @dnbinom(i32 %22, double %23, double %24)
store double %25, double* %4
br label %26
26: ; preds = %16, %15, %11
%27 = load double, double* %4
ret double %27
}

LLVM IR (-O2):
define double @dnbinom_mu(i32 %0, double %1, double %2) {
%4 = fcmp ugt double %1, 0.000000e+00
%5 = fcmp ugt double %2, 0.000000e+00
%6 = and i1 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = fadd double %1, %2
%9 = fdiv double %2, %8
%10 = tail call double @dnbinom(i32 %0, double %1, double %9)
br label %11
11: ; preds = %3, %7
%12 = phi double [ %10, %7 ], [ 0.000000e+00, %3 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
void *malloc_always_fail(size_t size) {
  errno = ENOMEM;
  return NULL;
}


x86 assembly (clang, -O0):
<malloc_always_fail>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_always_fail>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define i8* @malloc_always_fail(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @ENOMEM
store i32 %3, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define noalias i8* @malloc_always_fail(i64 %0) {
%2 = load i32, i32* @ENOMEM
store i32 %2, i32* @errno
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ set_cs_creset(int /*<<< orphan*/, int /*<<< orphan*/);
void flash_chip_select() { set_cs_creset(0, 0); }


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

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

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

LLVM IR (-O2):
define void @flash_chip_select() {
%1 = tail call i32 @set_cs_creset(i32 0, i32 0)
ret void
}
void __put_task_struct(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__put_task_struct>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__put_task_struct>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__put_task_struct = [18 x i8] c"__put_task_struct\00"
define void @__put_task_struct() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.__put_task_struct, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__put_task_struct = [18 x i8] c"__put_task_struct\00"
define void @__put_task_struct() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.__put_task_struct, i64 0, i64 0))
ret void
}
const char *parse_sp(const char *cp) {
  while (((*cp) == ' ' || (*cp) == '\t'))
    cp++;
  return cp;
}


x86 assembly (clang, -O0):
<parse_sp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <parse_sp+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <parse_sp+0x3d>
jmp    114e <parse_sp+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <parse_sp+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_sp>:
mov    %rdi,%rax
jmp    1114 <parse_sp+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <parse_sp+0x10>
cmp    $0x9,%cl
je     1110 <parse_sp+0x10>
ret

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

LLVM IR (-O2):
define i8* @parse_sp(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
int flower(int n) {
  int ge, shi, bai;
  ge = n % 10;
  shi = n / 10 % 10;
  bai = n / 100;
  if (ge * ge * ge + shi * shi * shi + bai * bai * bai == n)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<flower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x10(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    %ecx,%eax
cmp    -0x8(%rbp),%eax
jne    1173 <flower+0x73>
movl   $0x1,-0x4(%rbp)
jmp    117a <flower+0x7a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flower>:
movslq %edi,%r8
imul   $0x66666667,%r8,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
lea    (%rax,%rax,1),%edx
lea    (%rdx,%rdx,4),%esi
mov    %r8d,%edx
sub    %esi,%edx
cltq
imul   $0x66666667,%rax,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rsi
add    %edi,%esi
add    %esi,%esi
lea    (%rsi,%rsi,4),%esi
sub    %esi,%eax
imul   $0x51eb851f,%r8,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x25,%rsi
add    %edi,%esi
mov    %edx,%edi
imul   %edx,%edi
imul   %edx,%edi
mov    %eax,%edx
imul   %eax,%edx
imul   %eax,%edx
mov    %esi,%ecx
imul   %esi,%ecx
imul   %esi,%ecx
add    %edi,%ecx
add    %edx,%ecx
xor    %eax,%eax
cmp    %r8d,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @flower(i32 %0) {
%2 = srem i32 %0, 10
%3 = sdiv i32 %0, 10
%4 = srem i32 %3, 10
%5 = sdiv i32 %0, 100
%6 = mul nsw i32 %2, %2
%7 = mul nsw i32 %6, %2
%8 = mul nsw i32 %4, %4
%9 = mul nsw i32 %8, %4
%10 = mul nsw i32 %5, %5
%11 = mul nsw i32 %10, %5
%12 = add i32 %11, %7
%13 = add i32 %12, %9
%14 = icmp eq i32 %13, %0
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ print_it(char const *);
int print_routine(const char *name) {
  print_it(name);
  return 0;
}


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

x86 assembly (clang, -O2):
<print_routine>:
push   %rax
call   1030 <print_it@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @print_routine(i8* %0) {
%2 = tail call i32 @print_it(i8* %0)
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn52() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn52");
  return result;
}


x86 assembly (clang, -O0):
<fn52>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn52>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn52\00"
define i8* @fn52() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn52\00"
define i8* @fn52() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  int i;
  i = 0;
  if (s && f)
    while (s[i]) {
      f(i, &s[i]);
      i++;
    }
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <ft_striteri+0x6b>
cmpq   $0x0,-0x10(%rbp)
je     116b <ft_striteri+0x6b>
jmp    1132 <ft_striteri+0x32>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1166 <ft_striteri+0x66>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rcx
add    %rcx,%rsi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <ft_striteri+0x32>
jmp    116b <ft_striteri+0x6b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1135 <ft_striteri+0x35>
mov    %rsi,%r14
test   %rsi,%rsi
je     1135 <ft_striteri+0x35>
mov    %rdi,%r15
cmpb   $0x0,(%rdi)
je     1135 <ft_striteri+0x35>
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    (%r15,%rbx,1),%rsi
mov    %ebx,%edi
call   *%r14
cmpb   $0x0,0x1(%r15,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i32, i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6, %9
%10 = phi i64 [ %13, %9 ], [ 0, %6 ]
%11 = phi i8* [ %14, %9 ], [ %0, %6 ]
%12 = trunc i64 %10 to i32
tail call void %1(i32 %12, i8* %11)
%13 = add nuw i64 %10, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
int _assert_ok(char *);
int /*<<< orphan*/ printf(char *);
int assert_equal_ints(int received, int expected) {
  char func[] = "assert_equal_ints";
  if (received == expected)
    return _assert_ok(func);
  else {
    printf("F");
    return 1;
  }
}


x86 assembly (clang, -O0):
<assert_equal_ints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    116c <assert_equal_ints+0x4c>
lea    -0x20(%rbp),%rdi
call   1040 <_assert_ok@plt>
mov    %eax,-0x4(%rbp)
jmp    117f <assert_equal_ints+0x5f>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_equal_ints>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x73,0x10(%rsp)
cmp    %esi,%edi
jne    1147 <assert_equal_ints+0x27>
mov    %rsp,%rdi
call   1040 <_assert_ok@plt>
add    $0x18,%rsp
ret
mov    $0x46,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.assert_equal_ints.func = [18 x i8] c"assert_equal_ints\00"
@.str = [2 x i8] c"F\00"
define i32 @assert_equal_ints(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [18 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = bitcast [18 x i8]* %6 to i8*
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = getelementptr inbounds [18 x i8], [18 x i8]* %6, i64 0, i64 0
%13 = call i32 @_assert_ok(i8* %12)
store i32 %13, i32* %3
br label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %16
16: ; preds = %14, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@__const.assert_equal_ints.func = [18 x i8] c"assert_equal_ints\00"
define i32 @assert_equal_ints(i32 %0, i32 %1) {
%3 = alloca [18 x i8]
%4 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, %1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 @_assert_ok(i8* %4)
br label %10
8: ; preds = %2
%9 = tail call i32 @putchar(i32 70)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ 1, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 0; i < 256; i++)
    printf("%d %c\n", i, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
double grib_op_ne_d(double a, double b) { return a != b; }


x86 assembly (clang, -O0):
<grib_op_ne_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib_op_ne_d>:
cmpneqsd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @grib_op_ne_d(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 = fcmp une double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @grib_op_ne_d(double %0, double %1) {
%3 = fcmp une double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Type definitions */
typedef char uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __simplePNG__write_chunk(int /*<<< orphan*/ *, char *,
                                            int /*<<< orphan*/ *,
                                            int /*<<< orphan*/);
void __simplePNG_write_IEND(FILE *f) {
  uint8_t chunk_type[4];
  chunk_type[0] = 'I';
  chunk_type[1] = 'E';
  chunk_type[2] = 'N';
  chunk_type[3] = 'D';
  __simplePNG__write_chunk(f, chunk_type, NULL, 0);
}


x86 assembly (clang, -O0):
<__simplePNG_write_IEND>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x49,-0xc(%rbp)
movb   $0x45,-0xb(%rbp)
movb   $0x4e,-0xa(%rbp)
movb   $0x44,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <__simplePNG__write_chunk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__simplePNG_write_IEND>:
push   %rax
movl   $0x444e4549,0x4(%rsp)
44
lea    0x4(%rsp),%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <__simplePNG__write_chunk@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @__simplePNG_write_IEND(i32* %0) {
%2 = alloca i32*
%3 = alloca [4 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 73, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 69, i8* %5
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 78, i8* %6
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 68, i8* %7
%8 = load i32*, i32** %2
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%10 = call i32 @__simplePNG__write_chunk(i32* %8, i8* %9, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
define void @__simplePNG_write_IEND(i32* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
store i8 73, i8* %3
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
store i8 69, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
store i8 78, i8* %5
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
store i8 68, i8* %6
%7 = call i32 @__simplePNG__write_chunk(i32* %0, i8* %3, i32* null, i32 0)
ret void
}