xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
int dummy_choose_login(const char *a, const char *b) {
  printf("skin sets login `%s' with session: %s\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<dummy_choose_login>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy_choose_login>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"skin sets login `%s' with session: %s\0A\00"
define i32 @dummy_choose_login(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 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"skin sets login `%s' with session: %s\0A\00"
define i32 @dummy_choose_login(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 0
}
int updateCount(int val, int count) {
  if ((val >= 2) && (val <= 6)) {
    count++;
  } else if ((val == 10) || (val == 11)) {
    count--;
  }
  return count;
}


x86 assembly (clang, -O0):
<updateCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
jl     112c <updateCount+0x2c>
cmpl   $0x6,-0x4(%rbp)
jg     112c <updateCount+0x2c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <updateCount+0x4e>
cmpl   $0xa,-0x4(%rbp)
je     1140 <updateCount+0x40>
cmpl   $0xb,-0x4(%rbp)
jne    1149 <updateCount+0x49>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <updateCount+0x4e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateCount>:
mov    %esi,%eax
lea    -0x2(%rdi),%ecx
cmp    $0x4,%ecx
ja     110e <updateCount+0xe>
add    $0x1,%eax
ret
and    $0xfffffffe,%edi
xor    %ecx,%ecx
cmp    $0xa,%edi
sete   %cl
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @updateCount(i32 %0, i32 %1) {
%3 = add i32 %0, -2
%4 = icmp ult i32 %3, 5
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = add nsw i32 %1, 1
br label %12
7: ; preds = %2
%8 = and i32 %0, -2
%9 = icmp eq i32 %8, 10
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %1
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
void cpuidle_pause_and_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @cpuidle_pause_and_lock() {
ret void
}
unsigned int ocbyteswap(unsigned int i) {
  unsigned int swap, b0, b1, b2, b3;
  b0 = (i >> 24) & 0x000000ff;
  b1 = (i >> 16) & 0x000000ff;
  b2 = (i >> 8) & 0x000000ff;
  b3 = (i)&0x000000ff;
  swap = (b0 | (b1 << 8) | (b2 << 16) | (b3 << 24));
  return swap;
}


x86 assembly (clang, -O0):
<ocbyteswap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ocbyteswap>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @ocbyteswap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
%8 = load i32, i32* %2
%9 = lshr i32 %8, 24
%10 = and i32 %9, 255
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = lshr i32 %11, 16
%13 = and i32 %12, 255
store i32 %13, i32* %5
%14 = load i32, i32* %2
%15 = lshr i32 %14, 8
%16 = and i32 %15, 255
store i32 %16, i32* %6
%17 = load i32, i32* %2
%18 = and i32 %17, 255
store i32 %18, i32* %7
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = shl i32 %20, 8
%22 = or i32 %19, %21
%23 = load i32, i32* %6
%24 = shl i32 %23, 16
%25 = or i32 %22, %24
%26 = load i32, i32* %7
%27 = shl i32 %26, 24
%28 = or i32 %25, %27
store i32 %28, i32* %3
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @ocbyteswap(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int bit_to_index(int /*<<< orphan*/);
int /*<<< orphan*/ lowest_bit(int /*<<< orphan*/);
int lowest_bit_index(uint64_t bits) { return bit_to_index(lowest_bit(bits)); }


x86 assembly (clang, -O0):
<lowest_bit_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <lowest_bit@plt>
mov    %eax,%edi
call   1030 <bit_to_index@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowest_bit_index>:
push   %rax
call   1040 <lowest_bit@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <bit_to_index@plt>

LLVM IR (-O0):
define i32 @lowest_bit_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lowest_bit(i32 %3)
%5 = call i32 @bit_to_index(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @lowest_bit_index(i32 %0) {
%2 = tail call i32 @lowest_bit(i32 %0)
%3 = tail call i32 @bit_to_index(i32 %2)
ret i32 %3
}
float icsi_log(float val, register const float *lookup_table,
               register const int n) {
  union _ {
    int i;
    float f;
  };
  register int x = ((union _ *)&val)->i;
  register const int log_2 = ((x >> 23) & 255) - 127;
  x &= 0x7FFFFF;
  x = x >> (23 - n);
  val = lookup_table[x];
  return ((val + log_2) * 0.69314718);
}


x86 assembly (clang, -O0):
<icsi_log>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x17,%eax
and    $0xff,%eax
sub    $0x7f,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
and    $0x7fffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x17,%ecx
sub    -0x14(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x1c(%rbp),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe92(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<icsi_log>:
movd   %xmm0,%eax
mov    %eax,%ecx
shr    $0x17,%ecx
movzbl %cl,%edx
and    $0x7fffff,%eax
mov    $0x17,%cl
sub    %sil,%cl
shr    %cl,%eax
add    $0xffffff81,%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
addss  (%rdi,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xecd(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
%union._ = type { i32 }
define float @icsi_log(float %0, float* %1, i32 %2) {
%4 = alloca float
%5 = alloca float*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store float %0, float* %4
store float* %1, float** %5
store i32 %2, i32* %6
%9 = bitcast float* %4 to %union._*
%10 = bitcast %union._* %9 to i32*
%11 = load i32, i32* %10
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = ashr i32 %12, 23
%14 = and i32 %13, 255
%15 = sub nsw i32 %14, 127
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = and i32 %16, 8388607
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = sub nsw i32 23, %19
%21 = ashr i32 %18, %20
store i32 %21, i32* %7
%22 = load float*, float** %5
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds float, float* %22, i64 %24
%26 = load float, float* %25
store float %26, float* %4
%27 = load float, float* %4
%28 = load i32, i32* %8
%29 = sitofp i32 %28 to float
%30 = fadd float %27, %29
%31 = fpext float %30 to double
%32 = fmul double %31, 0x3FE62E42FEAD449C
%33 = fptrunc double %32 to float
ret float %33
}

LLVM IR (-O2):
define float @icsi_log(float %0, float* nocapture %1, i32 %2) {
%4 = bitcast float %0 to i32
%5 = lshr i32 %4, 23
%6 = and i32 %5, 255
%7 = add nsw i32 %6, -127
%8 = and i32 %4, 8388607
%9 = sub nsw i32 23, %2
%10 = lshr i32 %8, %9
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds float, float* %1, i64 %11
%13 = load float, float* %12
%14 = sitofp i32 %7 to float
%15 = fadd float %13, %14
%16 = fpext float %15 to double
%17 = fmul double %16, 0x3FE62E42FEAD449C
%18 = fptrunc double %17 to float
ret float %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void version() { printf("%s version: %s\n", "lob(loadbalance)", "0.01"); }


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

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xefc(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s version: %s\0A\00"
@.str.1 = [17 x i8] c"lob(loadbalance)\00"
@.str.2 = [5 x i8] c"0.01\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s version: %s\0A\00"
@.str.1 = [17 x i8] c"lob(loadbalance)\00"
@.str.2 = [5 x i8] c"0.01\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void gpio_spi_inactive(int cspi_mod) {}


x86 assembly (clang, -O0):
<gpio_spi_inactive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @gpio_spi_inactive(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ log10(double);
int pow(int, int);
int adding_c(int a, int b, int c) {
  if (b > 9)
    b /= 10;
  return a + c * pow(10, (int)log10((double)b) + 1);
}


x86 assembly (clang, -O0):
<adding_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x9,-0x8(%rbp)
jle    1149 <adding_c+0x29>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
call   1040 <log10@plt>
mov    %eax,%esi
add    $0x1,%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    -0x14(%rbp),%ecx
mov    %eax,%edx
mov    -0x10(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adding_c>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %edi,%ebx
cmp    $0xa,%esi
jl     1143 <adding_c+0x23>
movslq %esi,%rax
imul   $0x66666667,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x22,%rsi
add    %eax,%esi
cvtsi2sd %esi,%xmm0
call   1040 <log10@plt>
lea    0x1(%rax),%esi
mov    $0xa,%edi
call   1030 <pow@plt>
imul   %ebp,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @adding_c(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* %5
%8 = icmp sgt i32 %7, 9
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %5
%11 = sdiv i32 %10, 10
store i32 %11, i32* %5
br label %12
12: ; preds = %9, %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = sitofp i32 %15 to double
%17 = call i64 @log10(double %16)
%18 = trunc i64 %17 to i32
%19 = add nsw i32 %18, 1
%20 = call i32 @pow(i32 10, i32 %19)
%21 = mul nsw i32 %14, %20
%22 = add nsw i32 %13, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @adding_c(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 9
%5 = sdiv i32 %1, 10
%6 = select i1 %4, i32 %5, i32 %1
%7 = sitofp i32 %6 to double
%8 = tail call i64 @log10(double %7)
%9 = trunc i64 %8 to i32
%10 = add nsw i32 %9, 1
%11 = tail call i32 @pow(i32 10, i32 %10)
%12 = mul nsw i32 %11, %2
%13 = add nsw i32 %12, %0
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ __test_print_vasp(unsigned int);
void test_print_vasp_bulk() { __test_print_vasp((unsigned)0); }


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

x86 assembly (clang, -O2):
<test_print_vasp_bulk>:
xor    %edi,%edi
jmp    1030 <__test_print_vasp@plt>

LLVM IR (-O0):
define void @test_print_vasp_bulk() {
%1 = call i32 @__test_print_vasp(i32 0)
ret void
}

LLVM IR (-O2):
define void @test_print_vasp_bulk() {
%1 = tail call i32 @__test_print_vasp(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
Main() { printf("hello, world\n"); }


x86 assembly (clang, -O0):
<Main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world\0A\00"
define i32 @Main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [13 x i8] c"hello, world\00"
define i32 @Main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ sinh(double);
float sinhf(float x) { return (float)sinh((double)x); }


x86 assembly (clang, -O0):
<sinhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sinh@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinhf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <sinh@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sinhf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @sinh(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @sinhf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @sinh(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ AtmegaCompareP__0__Alarm__fired();
int /*<<< orphan*/ AtmegaCompareP__0__AtmegaCompare__stop();
void AtmegaCompareP__0__AtmegaCompare__fired(void) {
  AtmegaCompareP__0__AtmegaCompare__stop();
  AtmegaCompareP__0__Alarm__fired();
}


x86 assembly (clang, -O0):
<AtmegaCompareP__0__AtmegaCompare__fired>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AtmegaCompareP__0__AtmegaCompare__stop@plt>
mov    $0x0,%al
call   1040 <AtmegaCompareP__0__Alarm__fired@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AtmegaCompareP__0__AtmegaCompare__fired>:
push   %rax
xor    %eax,%eax
call   1030 <AtmegaCompareP__0__AtmegaCompare__stop@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <AtmegaCompareP__0__Alarm__fired@plt>

LLVM IR (-O0):
define void @AtmegaCompareP__0__AtmegaCompare__fired() {
%1 = call i32 (...) @AtmegaCompareP__0__AtmegaCompare__stop()
%2 = call i32 (...) @AtmegaCompareP__0__Alarm__fired()
ret void
}

LLVM IR (-O2):
define void @AtmegaCompareP__0__AtmegaCompare__fired() {
%1 = tail call i32 (...) @AtmegaCompareP__0__AtmegaCompare__stop()
%2 = tail call i32 (...) @AtmegaCompareP__0__Alarm__fired()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ spi_send_byte(int);
void sd_delay(char number) {
  char i;
  for (i = 0; i < number; i++) {
    spi_send_byte(0xFF);
  }
}


x86 assembly (clang, -O0):
<sd_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jge    1149 <sd_delay+0x39>
mov    $0xff,%edi
call   1030 <spi_send_byte@plt>
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    1122 <sd_delay+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_delay>:
push   %rbx
mov    %edi,%ebx
test   %bl,%bl
jle    112f <sd_delay+0x1f>
nopw   0x0(%rax,%rax,1)
mov    $0xff,%edi
call   1030 <spi_send_byte@plt>
add    $0xff,%bl
jne    1120 <sd_delay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @sd_delay(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
br label %4
4: ; preds = %12, %1
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %15
10: ; preds = %4
%11 = call i32 @spi_send_byte(i32 255)
br label %12
12: ; preds = %10
%13 = load i8, i8* %3
%14 = add i8 %13, 1
store i8 %14, i8* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @sd_delay(i8 signext %0) {
%2 = icmp sgt i8 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i8 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @spi_send_byte(i32 255)
%6 = add nuw nsw i8 %4, 1
%7 = icmp eq i8 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void my_strcpy(char *dst, const char *src) {
  while (*src) {
    *dst++ = *src++;
  }
  *dst = '\0';
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <my_strcpy+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <my_strcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
mov    (%rsi),%al
test   %al,%al
je     1121 <my_strcpy+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <my_strcpy+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @my_strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void sys_sleep(int us) {
  if (us <= 0)
    return;
  usleep(us);
}


x86 assembly (clang, -O0):
<sys_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     112a <sys_sleep+0x1a>
jmp    1132 <sys_sleep+0x22>
mov    -0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_sleep>:
test   %edi,%edi
jle    1119 <sys_sleep+0x9>
jmp    1030 <usleep@plt>
ret

LLVM IR (-O0):
define void @sys_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @usleep(i32 %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @sys_sleep(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @usleep(i32 %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo(int);
int main() {
  foo(1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1)
%2 = tail call i32 @exit(i32 0)
unreachable
}
const char *say_hi() {
  const char *x = "Hi!";
  return x;
}


x86 assembly (clang, -O0):
<say_hi>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<say_hi>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"Hi!\00"
define i8* @say_hi() {
%1 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [4 x i8] c"Hi!\00"
define i8* @say_hi() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_int(int);
int main() {
  int x = 0x89ABCDEF;
  int y = 0x76543210;
  int z = x & 0xFF;
  int aa = y & ~0xFF;
  int zaa = z | aa;
  printf("value:");
  show_int(zaa);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x89abcdef,-0x4(%rbp)
movl   $0x76543210,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffff00,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <show_int@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x765432ef,%edi
call   1040 <show_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"value:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 -1985229329, i32* %1
store i32 1985229328, i32* %2
%6 = load i32, i32* %1
%7 = and i32 %6, 255
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = and i32 %8, -256
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = or i32 %10, %11
store i32 %12, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %5
%15 = call i32 @show_int(i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"value:\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @show_int(i32 1985229551)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void foo(int n) {
  int i;
#pragma omp for schedule(nonmonotonic : dynamic, 2)
  for (i = 0; i < n; ++i)
    bar(i);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1144 <foo+0x34>
mov    -0x8(%rbp),%edi
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <foo+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    112e <foo+0x1e>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <bar@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <foo+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @bar(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int match_char(const void *char1, const void *char2) {
  return (*(const char *)char1 == *(const char *)char2);
}


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

x86 assembly (clang, -O2):
<match_char>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @match_char(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* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @match_char(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errmsg(int, int /*<<< orphan*/, int, char *, size_t const);
void *realloc(void *, size_t const);
__attribute__((alloc_size(2))) void *xrealloc(void *ptr, const size_t size) {
  void *ret = realloc(ptr, size);
  if (!ret && size)
    errmsg(1, EXIT_FAILURE, 1, "cannot allocate %zu bytes", size);
  return ret;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1177 <xrealloc+0x57>
cmpq   $0x0,-0x10(%rbp)
je     1177 <xrealloc+0x57>
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%r8
mov    $0x1,%edx
lea    0xe90(%rip),%rcx
mov    %edx,%edi
call   1040 <errmsg@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     115b <xrealloc+0x3b>
test   %r14,%r14
jne    115b <xrealloc+0x3b>
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xeb7(%rip),%rcx
mov    $0x1,%edi
mov    $0x1,%edx
mov    %rbx,%r8
call   1040 <errmsg@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [26 x i8] c"cannot allocate %zu bytes\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %18, label %11
11: ; preds = %2
%12 = load i64, i64* %4
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* @EXIT_FAILURE
%16 = load i64, i64* %4
%17 = call i32 @errmsg(i32 1, i32 %15, i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %16)
br label %18
18: ; preds = %14, %11, %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [26 x i8] c"cannot allocate %zu bytes\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @errmsg(i32 1, i32 %8, i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %10
10: ; preds = %7, %2
ret i8* %3
}
int another_function(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @another_function() {
ret i32 4
}

LLVM IR (-O2):
define i32 @another_function() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ keyorder_setkeyordertable(char const **);
edf_keyorder_set_table(const char *table[]) {
  keyorder_setkeyordertable(table);
}


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

x86 assembly (clang, -O2):
<edf_keyorder_set_table>:
jmp    1030 <keyorder_setkeyordertable@plt>

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

LLVM IR (-O2):
define i32 @edf_keyorder_set_table(i8** %0) {
%2 = tail call i32 @keyorder_setkeyordertable(i8** %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_print_numbers(void) {
  char a;
  char b;
  a = '0';
  b = '9';
  while (a < b + 1) {
    ft_putchar(a);
    a++;
  }
}


x86 assembly (clang, -O0):
<ft_print_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x30,-0x1(%rbp)
movb   $0x39,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1149 <ft_print_numbers+0x39>
movsbl -0x1(%rbp),%edi
call   1030 <ft_putchar@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    1120 <ft_print_numbers+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_numbers>:
push   %rax
mov    $0x30,%edi
call   1030 <ft_putchar@plt>
mov    $0x31,%edi
call   1030 <ft_putchar@plt>
mov    $0x32,%edi
call   1030 <ft_putchar@plt>
mov    $0x33,%edi
call   1030 <ft_putchar@plt>
mov    $0x34,%edi
call   1030 <ft_putchar@plt>
mov    $0x35,%edi
call   1030 <ft_putchar@plt>
mov    $0x36,%edi
call   1030 <ft_putchar@plt>
mov    $0x37,%edi
call   1030 <ft_putchar@plt>
mov    $0x38,%edi
call   1030 <ft_putchar@plt>
mov    $0x39,%edi
pop    %rax
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_print_numbers() {
%1 = alloca i8
%2 = alloca i8
store i8 48, i8* %1
store i8 57, i8* %2
br label %3
3: ; preds = %10, %0
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, 1
%9 = icmp slt i32 %5, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i8, i8* %1
%12 = call i32 @ft_putchar(i8 signext %11)
%13 = load i8, i8* %1
%14 = add i8 %13, 1
store i8 %14, i8* %1
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @ft_print_numbers() {
%1 = tail call i32 @ft_putchar(i8 signext 48)
%2 = tail call i32 @ft_putchar(i8 signext 49)
%3 = tail call i32 @ft_putchar(i8 signext 50)
%4 = tail call i32 @ft_putchar(i8 signext 51)
%5 = tail call i32 @ft_putchar(i8 signext 52)
%6 = tail call i32 @ft_putchar(i8 signext 53)
%7 = tail call i32 @ft_putchar(i8 signext 54)
%8 = tail call i32 @ft_putchar(i8 signext 55)
%9 = tail call i32 @ft_putchar(i8 signext 56)
%10 = tail call i32 @ft_putchar(i8 signext 57)
ret void
}
char *mystrcpy(char *dest, const char *src) {
  char *p = dest;
  while (*src)
    *dest++ = *src++;
  *dest = 0;
  return p;
}


x86 assembly (clang, -O0):
<mystrcpy>:
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
cmpb   $0x0,(%rax)
je     1148 <mystrcpy+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <mystrcpy+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <mystrcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <mystrcpy+0x20>
movb   $0x0,(%rdx)
ret

LLVM IR (-O0):
define i8* @mystrcpy(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 = %11, %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
%14 = load i8, i8* %12
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
store i8 %14, i8* %15
br label %7
17: ; preds = %7
%18 = load i8*, i8** %3
store i8 0, i8* %18
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @mystrcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x63() {
  Assert_real((isupper(99) == 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_isupper.c",
              500, ("isupper should be 0 for c"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x63>:
push   %rax
mov    $0x63,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1f4,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for c\00"
define void @t_isupper_0x63() {
%1 = call i64 @isupper(i32 99)
%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 500, i8* getelementptr inbounds ([26 x i8], [26 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for c\00"
define void @t_isupper_0x63() {
%1 = tail call i64 @isupper(i32 99)
%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 500, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int bar() {
  int a = 0, i;
#pragma omp parallel for num_threads(3) reduction(+ : a) schedule(static, 1)
  for (i = 0; i < 10; i++)
    a += i;
  return a;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1133 <bar+0x33>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <bar+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bar() {
%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, 10
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, %7
store i32 %9, i32* %1
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
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 45
}
/* Variables and functions */
size_t *get_malloc_address_location(void *const);
void *get_actual_malloc_address(void *const mem) {
  size_t *const malloc_addr_location = get_malloc_address_location(mem);
  return (void *)(*malloc_addr_location);
}


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

x86 assembly (clang, -O2):
<get_actual_malloc_address>:
push   %rax
call   1030 <get_malloc_address_location@plt>
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @get_actual_malloc_address(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64* @get_malloc_address_location(i8* %4)
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_actual_malloc_address(i8* %0) {
%2 = tail call i64* @get_malloc_address_location(i8* %0)
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
struct rsn_pmksa_cache *
pmksa_cache_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry, void *ctx,
                                 enum pmksa_free_reason reason),
                 void *ctx, struct wpa_sm *sm) {
  return (void *)-1;
}


x86 assembly (clang, -O0):
<pmksa_cache_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmksa_cache_init>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
%struct.rsn_pmksa_cache = type opaque
%struct.wpa_sm = type opaque
define %struct.rsn_pmksa_cache* @pmksa_cache_init({}* %0, i8* %1, %struct.wpa_sm* %2) {
%4 = alloca {}*
%5 = alloca i8*
%6 = alloca %struct.wpa_sm*
store {}* %0, {}** %4
store i8* %1, i8** %5
store %struct.wpa_sm* %2, %struct.wpa_sm** %6
ret %struct.rsn_pmksa_cache* inttoptr (i64 -1 to %struct.rsn_pmksa_cache*)
}

LLVM IR (-O2):
%struct.rsn_pmksa_cache = type opaque
%struct.wpa_sm = type opaque
define %struct.rsn_pmksa_cache* @pmksa_cache_init({}* nocapture readnone %0, i8* nocapture readnone %1, %struct.wpa_sm* nocapture readnone %2) {
ret %struct.rsn_pmksa_cache* inttoptr (i64 -1 to %struct.rsn_pmksa_cache*)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b;
  scanf("%d", &a);
  b = a * a;
  printf("%d \n", b);
  b = a * b;
  printf("%d \n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
imul   %ebx,%ebx
lea    0xec0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
imul   0x4(%rsp),%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %5
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
double owon_b35_get_value(int);
float get_fusor_current_ma(void) {
  double ma;
  ma = owon_b35_get_value(1);
  if (ma == 1000002) {
    return 1000002;
  }
  return ma;
}


x86 assembly (clang, -O0):
<get_fusor_current_ma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <owon_b35_get_value@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1156 <get_fusor_current_ma+0x46>
jp     1156 <get_fusor_current_ma+0x46>
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1164 <get_fusor_current_ma+0x54>
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fusor_current_ma>:
push   %rax
mov    $0x1,%edi
call   1030 <owon_b35_get_value@plt>
ucomisd 0xedd(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jne    1133 <get_fusor_current_ma+0x23>
jp     1133 <get_fusor_current_ma+0x23>
movss  0xed5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @get_fusor_current_ma() {
%1 = alloca float
%2 = alloca double
%3 = call double @owon_b35_get_value(i32 1)
store double %3, double* %2
%4 = load double, double* %2
%5 = fcmp oeq double %4, 0x412E848400000000
br i1 %5, label %6, label %7
6: ; preds = %0
store float 0x412E848400000000, float* %1
br label %10
7: ; preds = %0
%8 = load double, double* %2
%9 = fptrunc double %8 to float
store float %9, float* %1
br label %10
10: ; preds = %7, %6
%11 = load float, float* %1
ret float %11
}

LLVM IR (-O2):
define float @get_fusor_current_ma() {
%1 = tail call double @owon_b35_get_value(i32 1)
%2 = fcmp oeq double %1, 0x412E848400000000
%3 = fptrunc double %1 to float
%4 = select i1 %2, float 0x412E848400000000, float %3
ret float %4
}
void uDMAChannelEnable(unsigned long ulChannelNum) {
  ;
  (*((volatile unsigned long *)(0x400FF028))) = 1 << (ulChannelNum & 0x1f);
}


x86 assembly (clang, -O0):
<uDMAChannelEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1f,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x400ff028,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelEnable>:
mov    %rdi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0x400ff028
40
ret

LLVM IR (-O0):
define void @uDMAChannelEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 31
%5 = trunc i64 %4 to i32
%6 = shl i32 1, %5
%7 = sext i32 %6 to i64
store volatile i64 %7, i64* inttoptr (i64 1074786344 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelEnable(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 31
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
store volatile i64 %5, i64* inttoptr (i64 1074786344 to i64*)
ret void
}