xunge/DecIR huggingface dataset:
/* Variables and functions */
double fabs(double const);
double elliott_symmetric_derivative(const double value_before_activation,
                                    const double value_after_activation) {
  (void)value_after_activation;
  double temp = 1.0 + fabs(value_before_activation * 1.0);
  return 1.0 / (temp * temp);
}


x86 assembly (clang, -O0):
<elliott_symmetric_derivative>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movaps 0xeee(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xeb7(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<elliott_symmetric_derivative>:
andpd  0xef8(%rip),%xmm0
movsd  0xf00(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @elliott_symmetric_derivative(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fmul double %7, 1.000000e+00
%9 = call double @llvm.fabs.f64(double %8)
%10 = fadd double 1.000000e+00, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = load double, double* %5
%13 = fmul double %11, %12
%14 = fdiv double 1.000000e+00, %13
ret double %14
}

LLVM IR (-O2):
define double @elliott_symmetric_derivative(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %0)
%4 = fadd double %3, 1.000000e+00
%5 = fmul double %4, %4
%6 = fdiv double 1.000000e+00, %5
ret double %6
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int do_read(struct flashrom_flashctx *const, int /*<<< orphan*/ *);
int /*<<< orphan*/
prepare_layout_for_extraction(struct flashrom_flashctx *const);
int do_extract(struct flashrom_flashctx *const flash) {
  prepare_layout_for_extraction(flash);
  return do_read(flash, NULL);
}


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

x86 assembly (clang, -O2):
<do_extract>:
push   %rbx
mov    %rdi,%rbx
call   1040 <prepare_layout_for_extraction@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <do_read@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @do_extract(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
%3 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%4 = call i32 @prepare_layout_for_extraction(%struct.flashrom_flashctx* %3)
%5 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%6 = call i32 @do_read(%struct.flashrom_flashctx* %5, i32* null)
ret i32 %6
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @do_extract(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @prepare_layout_for_extraction(%struct.flashrom_flashctx* %0)
%3 = tail call i32 @do_read(%struct.flashrom_flashctx* %0, i32* null)
ret i32 %3
}
/* Variables and functions */
int error(char *);
int rotl16(int num, int n_shifts) {
  unsigned int buf;
  if (n_shifts < 0 || n_shifts > 15)
    return error("ldm: rotl16 called with illegal n_shifts");
  buf = ((unsigned int)num & 0xFFFF) << n_shifts;
  buf = (buf & 0xFFFF) | (buf >> 16);
  return (int)buf;
}


x86 assembly (clang, -O0):
<rotl16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1132 <rotl16+0x22>
cmpl   $0xf,-0xc(%rbp)
jle    1146 <rotl16+0x36>
lea    0xec7(%rip),%rdi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    116f <rotl16+0x5f>
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xffff,%eax
mov    -0x10(%rbp),%ecx
shr    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl16>:
cmp    $0x10,%esi
jb     1121 <rotl16+0x11>
lea    0xee4(%rip),%rdi
jmp    1030 <error@plt>
movzwl %di,%eax
mov    %esi,%ecx
shl    %cl,%eax
movzwl %ax,%ecx
shr    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
@.str = [41 x i8] c"ldm: rotl16 called with illegal n_shifts\00"
define i32 @rotl16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 15
br i1 %11, label %12, label %14
12: ; preds = %9, %2
%13 = call i32 @error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
store i32 %13, i32* %3
br label %25
14: ; preds = %9
%15 = load i32, i32* %4
%16 = and i32 %15, 65535
%17 = load i32, i32* %5
%18 = shl i32 %16, %17
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = and i32 %19, 65535
%21 = load i32, i32* %6
%22 = lshr i32 %21, 16
%23 = or i32 %20, %22
store i32 %23, i32* %6
%24 = load i32, i32* %6
store i32 %24, i32* %3
br label %25
25: ; preds = %14, %12
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@.str = [41 x i8] c"ldm: rotl16 called with illegal n_shifts\00"
define i32 @rotl16(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 15
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %12
6: ; preds = %2
%7 = and i32 %0, 65535
%8 = shl nuw nsw i32 %7, %1
%9 = and i32 %8, 65535
%10 = lshr i32 %8, 16
%11 = or i32 %9, %10
br label %12
12: ; preds = %6, %4
%13 = phi i32 [ %5, %4 ], [ %11, %6 ]
ret i32 %13
}
int min(int n, int *v) {
  if (n == 1)
    return v[n - 1];
  if (v[n - 1] < min(n - 1, v)) {
    return v[n - 1];
  } else {
    return min(n - 1, v);
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <min+0x31>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    119a <min+0x8a>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <min@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    1188 <min+0x78>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    119a <min+0x8a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <min@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
push   %rbx
cmp    $0x1,%edi
jne    111a <min+0xa>
mov    (%rsi),%eax
pop    %rbx
ret
movslq %edi,%rax
add    $0xffffffff,%edi
mov    -0x4(%rsi,%rax,4),%ebx
call   1030 <min@plt>
cmp    %eax,%ebx
cmovl  %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32* %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* %1
br label %6
6: ; preds = %4, %8
%7 = phi i32 [ %15, %8 ], [ %5, %4 ]
ret i32 %7
8: ; preds = %2
%9 = add nsw i32 %0, -1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = tail call i32 @min(i32 %9, i32* %1)
%14 = icmp slt i32 %12, %13
%15 = select i1 %14, i32 %12, i32 %13
br label %6
}
int test_imm_F1int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xF1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F1int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xf1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F1int64_highword_mem>:
testb  $0xf1,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F1int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 241
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_F1int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1035087118336
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test2() {
  int x = 4;
  int px = &x;
  int y = *(int *)px;
  printf("Testing reading (int*): %d\n", y);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rax
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%rax
cltq
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Testing reading (int*): %d\0A\00"
define void @test2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 4, i32* %1
%4 = ptrtoint i32* %1 to i32
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Testing reading (int*): %d\0A\00"
define void @test2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 4, i32* %1
%3 = ptrtoint i32* %1 to i64
%4 = shl i64 %3, 32
%5 = ashr exact i64 %4, 32
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
int q_isascii(int c) { return ((c & ~0x7f) == 0); }


x86 assembly (clang, -O0):
<q_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @q_isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -128
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @q_isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
void mpu_leave_powersave(void) {}


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

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

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

LLVM IR (-O2):
define void @mpu_leave_powersave() {
ret void
}
/* Variables and functions */
int ArgNum();
int GetFlag(int);
int /*<<< orphan*/ SetFlag(int, int);
void Act_MulF(void) {
  int a = ArgNum();
  SetFlag(a, GetFlag(a) * GetFlag(ArgNum()));
}


x86 assembly (clang, -O0):
<Act_MulF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ArgNum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <GetFlag@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <ArgNum@plt>
mov    %eax,%edi
call   1040 <GetFlag@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edi
imul   %eax,%esi
call   1030 <SetFlag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_MulF>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <ArgNum@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <GetFlag@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <ArgNum@plt>
mov    %eax,%edi
call   1040 <GetFlag@plt>
imul   %eax,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <SetFlag@plt>

LLVM IR (-O0):
define void @Act_MulF() {
%1 = alloca i32
%2 = call i32 (...) @ArgNum()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @GetFlag(i32 %4)
%6 = call i32 (...) @ArgNum()
%7 = call i32 @GetFlag(i32 %6)
%8 = mul nsw i32 %5, %7
%9 = call i32 @SetFlag(i32 %3, i32 %8)
ret void
}

LLVM IR (-O2):
define void @Act_MulF() {
%1 = tail call i32 (...) @ArgNum()
%2 = tail call i32 @GetFlag(i32 %1)
%3 = tail call i32 (...) @ArgNum()
%4 = tail call i32 @GetFlag(i32 %3)
%5 = mul nsw i32 %4, %2
%6 = tail call i32 @SetFlag(i32 %1, i32 %5)
ret void
}
void GPMCPrefetchSyncModeConfig(unsigned int baseAddr, unsigned int flag) {
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) &=
      ~(0x00000008u);
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) |=
      ((flag << (0x00000003u)) & (0x00000008u));
}


x86 assembly (clang, -O0):
<GPMCPrefetchSyncModeConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
shl    $0x3,%edx
and    $0x8,%edx
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCPrefetchSyncModeConfig>:
add    $0x1e0,%edi
andl   $0xfffffff7,(%rdi)
shl    $0x3,%esi
and    $0x8,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @GPMCPrefetchSyncModeConfig(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 = add i32 %5, 480
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -9
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = shl i32 %11, 3
%13 = and i32 %12, 8
%14 = load i32, i32* %3
%15 = add i32 %14, 480
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = or i32 %18, %13
store volatile i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @GPMCPrefetchSyncModeConfig(i32 %0, i32 %1) {
%3 = add i32 %0, 480
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -9
store volatile i32 %7, i32* %5
%8 = shl i32 %1, 3
%9 = and i32 %8, 8
%10 = load volatile i32, i32* %5
%11 = or i32 %10, %9
store volatile i32 %11, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ psdjf();
int main(void) {
  typedef enum { typeA = 3, typeB = 2 } typetest;
  typetest a = typeA;
  printf("%f", a);
  psdjf();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <psdjf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @psdjf()
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 (...) @psdjf()
ret i32 0
}
/* Variables and functions */
void *memrealloc_(void *, int);
void memrealloc(void *p, int size) {
  void **p1 = (void **)p;
  *p1 = memrealloc_(*p1, size);
}


x86 assembly (clang, -O0):
<memrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%esi
call   1030 <memrealloc_@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memrealloc>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <memrealloc_@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @memrealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8**
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i8**
store i8** %7, i8*** %5
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %8
%10 = load i32, i32* %4
%11 = call i8* @memrealloc_(i8* %9, i32 %10)
%12 = load i8**, i8*** %5
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @memrealloc(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = tail call i8* @memrealloc_(i8* %4, i32 %1)
store i8* %5, i8** %3
ret void
}
int fcmple(float a, float b) { return a <= b; }


x86 assembly (clang, -O0):
<fcmple>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcmple>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @fcmple(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ole float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @fcmple(float %0, float %1) {
%3 = fcmp ole float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ GPUkeypressed(int);
void ZN_GPUkeypressed(int keycode) { GPUkeypressed(keycode); }


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

x86 assembly (clang, -O2):
<ZN_GPUkeypressed>:
jmp    1030 <GPUkeypressed@plt>

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

LLVM IR (-O2):
define void @ZN_GPUkeypressed(i32 %0) {
%2 = tail call i32 @GPUkeypressed(i32 %0)
ret void
}
/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};
struct hostent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
struct hostent *gethostbyname2(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  int lsock;
  struct sockaddr_in6 sin;
  struct hostent *he;
  lsock = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);
  if (lsock == -1)
    printf("No Interface\n");
  exit(0x0);
  he = gethostbyname2("www.freenet6.org", AF_INET6);
  exit(0x0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
call   1050 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1178 <main+0x48>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
call   1050 <socket@plt>
cmp    $0xffffffff,%eax
jne    1162 <main+0x32>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32 }
%struct.hostent = type { i32 }
@AF_INET6 = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [14 x i8] c"No Interface\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sockaddr_in6
%4 = alloca %struct.hostent*
store i32 0, i32* %1
%5 = load i32, i32* @AF_INET6
%6 = load i32, i32* @SOCK_STREAM
%7 = load i32, i32* @IPPROTO_TCP
%8 = call i32 @socket(i32 %5, i32 %6, i32 %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %0
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@AF_INET6 = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@str = [13 x i8] c"No Interface\00"
define i32 @main() {
%1 = load i32, i32* @AF_INET6
%2 = load i32, i32* @SOCK_STREAM
%3 = load i32, i32* @IPPROTO_TCP
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct i8x_xctx {
  int dummy;
};
struct i8x_object {
  int dummy;
};

/* Variables and functions */
scalar_t__ i8x_ob_unref(struct i8x_object *);
struct i8x_xctx *__attribute__((always_)) i8x_xctx_unref(struct i8x_xctx *x) {
  return (struct i8x_xctx *)i8x_ob_unref((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_xctx_unref>:
jmp    1030 <i8x_ob_unref@plt>

LLVM IR (-O0):
%struct.i8x_xctx = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_xctx* @i8x_xctx_unref(%struct.i8x_xctx* %0) {
%2 = alloca %struct.i8x_xctx*
store %struct.i8x_xctx* %0, %struct.i8x_xctx** %2
%3 = load %struct.i8x_xctx*, %struct.i8x_xctx** %2
%4 = bitcast %struct.i8x_xctx* %3 to %struct.i8x_object*
%5 = call i64 @i8x_ob_unref(%struct.i8x_object* %4)
%6 = inttoptr i64 %5 to %struct.i8x_xctx*
ret %struct.i8x_xctx* %6
}

LLVM IR (-O2):
%struct.i8x_xctx = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_xctx* @i8x_xctx_unref(%struct.i8x_xctx* %0) {
%2 = bitcast %struct.i8x_xctx* %0 to %struct.i8x_object*
%3 = tail call i64 @i8x_ob_unref(%struct.i8x_object* %2)
%4 = inttoptr i64 %3 to %struct.i8x_xctx*
ret %struct.i8x_xctx* %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void rdyyfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<rdyyfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @rdyyfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int sem_post() {
  ;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @sem_post() {
ret i32 0
}

LLVM IR (-O2):
define i32 @sem_post() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ st103_get_rx_addr(int);
int /*<<< orphan*/ usb_lld_from_pmabuf(int /*<<< orphan*/ *, scalar_t__,
                                       size_t);
void usb_lld_rxcpy(uint8_t *dst, int ep_num, int offset, size_t len) {
  usb_lld_from_pmabuf(dst, st103_get_rx_addr(ep_num) + offset, len);
}


x86 assembly (clang, -O0):
<usb_lld_rxcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <st103_get_rx_addr@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
movslq -0x10(%rbp),%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
call   1040 <usb_lld_from_pmabuf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_lld_rxcpy>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <st103_get_rx_addr@plt>
movslq %ebp,%rsi
add    %rax,%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <usb_lld_from_pmabuf@plt>

LLVM IR (-O0):
define void @usb_lld_rxcpy(i32* %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i64 @st103_get_rx_addr(i32 %10)
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = add nsw i64 %11, %13
%15 = load i64, i64* %8
%16 = call i32 @usb_lld_from_pmabuf(i32* %9, i64 %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @usb_lld_rxcpy(i32* %0, i32 %1, i32 %2, i64 %3) {
%5 = tail call i64 @st103_get_rx_addr(i32 %1)
%6 = sext i32 %2 to i64
%7 = add nsw i64 %5, %6
%8 = tail call i32 @usb_lld_from_pmabuf(i32* %0, i64 %7, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_pf();
int /*<<< orphan*/ set_sf(int);
int /*<<< orphan*/ set_zf(int);
void set_pzs(int bits) {
  set_pf();
  set_zf(bits);
  set_sf(bits);
}


x86 assembly (clang, -O0):
<set_pzs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <set_pf@plt>
mov    -0x4(%rbp),%edi
call   1050 <set_zf@plt>
mov    -0x4(%rbp),%edi
call   1030 <set_sf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pzs>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <set_pf@plt>
mov    %ebx,%edi
call   1050 <set_zf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <set_sf@plt>

LLVM IR (-O0):
define void @set_pzs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @set_pf()
%4 = load i32, i32* %2
%5 = call i32 @set_zf(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @set_sf(i32 %6)
ret void
}

LLVM IR (-O2):
define void @set_pzs(i32 %0) {
%2 = tail call i32 (...) @set_pf()
%3 = tail call i32 @set_zf(i32 %0)
%4 = tail call i32 @set_sf(i32 %0)
ret void
}
void g_key_file_set_string() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_set_string() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x92() {
  Assert_real((ispunct(146) == 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_ispunct.c",
              735, ("ispunct should be 0 for 0x92"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x92>:
push   %rax
mov    $0x92,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2df,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x92\00"
define void @t_ispunct_0x92() {
%1 = call i64 @ispunct(i32 146)
%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 735, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x92\00"
define void @t_ispunct_0x92() {
%1 = tail call i64 @ispunct(i32 146)
%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 735, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int strlenght(char *pointer) {
  int lenght = 0;
  while (*pointer) {
    lenght += 1;
    *pointer++;
  }
  return (lenght);
}


x86 assembly (clang, -O0):
<strlenght>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <strlenght+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlenght+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlenght>:
cmpb   $0x0,(%rdi)
je     111c <strlenght+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlenght+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlenght(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
int valid_choice(int *p_choice) { return (1 == *p_choice || 2 == *p_choice); }


x86 assembly (clang, -O0):
<valid_choice>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%al
mov    $0x1,%ecx
cmp    (%rdx),%ecx
mov    %al,-0x9(%rbp)
je     112f <valid_choice+0x2f>
mov    -0x8(%rbp),%rcx
mov    $0x2,%eax
cmp    (%rcx),%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_choice>:
mov    (%rdi),%ecx
add    $0xffffffff,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @valid_choice(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp eq i32 1, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = icmp eq i32 2, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @valid_choice(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, -1
%4 = icmp ult i32 %3, 2
%5 = zext i1 %4 to i32
ret i32 %5
}
char btp_parse_digit(const char **input) {
  char digit = **input;
  if (digit < '0' || digit > '9')
    return '\0';
  ++*input;
  return digit;
}


x86 assembly (clang, -O0):
<btp_parse_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x30,%eax
jl     112e <btp_parse_digit+0x2e>
movsbl -0x11(%rbp),%eax
cmp    $0x39,%eax
jle    1137 <btp_parse_digit+0x37>
movb   $0x0,-0x1(%rbp)
jmp    114b <btp_parse_digit+0x4b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btp_parse_digit>:
mov    (%rdi),%rcx
mov    (%rcx),%al
lea    -0x3a(%rax),%edx
cmp    $0xf6,%dl
jae    1110 <btp_parse_digit+0x10>
xor    %eax,%eax
ret
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define signext i8 @btp_parse_digit(i8** %0) {
%2 = alloca i8
%3 = alloca i8**
%4 = alloca i8
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
store i8 %7, i8* %4
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 48
br i1 %10, label %15, label %11
11: ; preds = %1
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = icmp sgt i32 %13, 57
br i1 %14, label %15, label %16
15: ; preds = %11, %1
store i8 0, i8* %2
br label %21
16: ; preds = %11
%17 = load i8**, i8*** %3
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %17
%20 = load i8, i8* %4
store i8 %20, i8* %2
br label %21
21: ; preds = %16, %15
%22 = load i8, i8* %2
ret i8 %22
}

LLVM IR (-O2):
define signext i8 @btp_parse_digit(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -58
%5 = icmp ult i8 %4, -10
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %7, i8** %0
br label %8
8: ; preds = %1, %6
%9 = phi i8 [ %3, %6 ], [ 0, %1 ]
ret i8 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
FILE *ndb_df_getReadHandle(int fileNo) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i32* @ndb_df_getReadHandle(i32 %0) {
ret i32* null
}
/* Variables and functions */
int is_digit(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("program runs normally\n");
  printf("end\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"program runs normally\0A\00"
@.str.1 = [5 x i8] c"end\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"program runs normally\00"
@str.2 = [4 x i8] c"end\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t read_little_endian(const uint8_t *values) {
  return (uint32_t)((values[0] << 24) | (values[1] << 16) | (values[2] << 8) |
                    values[3]);
}


x86 assembly (clang, -O0):
<read_little_endian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_little_endian>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @read_little_endian(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @read_little_endian(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\t This is a paragon of commenting \n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"\09 This is a paragon of commenting \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"\09 This is a paragon of commenting \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CallLib();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("In main.c\n");
  printf("Calling CallLib() from main.c\n");
  CallLib();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <CallLib@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <CallLib@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"In main.c\0A\00"
@.str.1 = [31 x i8] c"Calling CallLib() from main.c\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @CallLib()
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"In main.c\00"
@str.2 = [30 x i8] c"Calling CallLib() from main.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @CallLib()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int wcslen(int /*<<< orphan*/ *);
int /*<<< orphan*/ wcsncpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                           size_t);
wchar_t *wcsncat(wchar_t *restrict whither, const wchar_t *restrict whence,
                 size_t maxlen) {
  wcsncpy(whither + wcslen(whither), whence, maxlen);
  return whither;
}


x86 assembly (clang, -O0):
<wcsncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wcslen@plt>
mov    -0x20(%rbp),%rdi
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <wcsncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsncat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <wcslen@plt>
cltq
lea    (%rbx,%rax,4),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <wcsncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @wcsncat(i32* noalias %0, i32* noalias %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %4
%9 = call i32 @wcslen(i32* %8)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %7, i64 %10
%12 = load i32*, i32** %5
%13 = load i64, i64* %6
%14 = call i32 @wcsncpy(i32* %11, i32* %12, i64 %13)
%15 = load i32*, i32** %4
ret i32* %15
}

LLVM IR (-O2):
define i32* @wcsncat(i32* noalias returned %0, i32* noalias %1, i64 %2) {
%4 = tail call i32 @wcslen(i32* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = tail call i32 @wcsncpy(i32* %6, i32* %1, i64 %2)
ret i32* %0
}
/* Type definitions */
struct aeEventLoop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ printf(char *, struct aeEventLoop *, long long, void *,
                          int /*<<< orphan*/);
int timerCallback(struct aeEventLoop *l, long long id, void *data) {
  printf("I'm time_cb,here [EventLoop: %p],[id : %lld],[data: %s],pid=%d \n", l,
         id, data, getpid());
  return 5000;
}


x86 assembly (clang, -O0):
<timerCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    %eax,%r8d
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1388,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerCallback>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %eax,%r8d
call   1040 <printf@plt>
mov    $0x1388,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.aeEventLoop = type { i32 }
@.str = [65 x i8] c"I'm time_cb,here [EventLoop: %p],[id : %lld],[data: %s],pid=%d \0A\00"
define i32 @timerCallback(%struct.aeEventLoop* %0, i64 %1, i8* %2) {
%4 = alloca %struct.aeEventLoop*
%5 = alloca i64
%6 = alloca i8*
store %struct.aeEventLoop* %0, %struct.aeEventLoop** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load %struct.aeEventLoop*, %struct.aeEventLoop** %4
%8 = load i64, i64* %5
%9 = load i8*, i8** %6
%10 = call i32 (...) @getpid()
%11 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), %struct.aeEventLoop* %7, i64 %8, i8* %9, i32 %10)
ret i32 5000
}

LLVM IR (-O2):
%struct.aeEventLoop = type { i32 }
@.str = [65 x i8] c"I'm time_cb,here [EventLoop: %p],[id : %lld],[data: %s],pid=%d \0A\00"
define i32 @timerCallback(%struct.aeEventLoop* %0, i64 %1, i8* %2) {
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), %struct.aeEventLoop* %0, i64 %1, i8* %2, i32 %4)
ret i32 5000
}