xunge/DecIR huggingface dataset:
/* Variables and functions */
int RTLD_GLOBAL;
int RTLD_LAZY;
int /*<<< orphan*/ dlopen(char *, int);
int main(void) {
  dlopen("gnu-gettext-GetURL$1", RTLD_GLOBAL | RTLD_LAZY);
  dlopen("gnu-gettext-GetURL${1", RTLD_GLOBAL | RTLD_LAZY);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
mov    0x2ea9(%rip),%rax
or     (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <dlopen@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
mov    0x2e8b(%rip),%rax
or     (%rax),%esi
lea    0xebf(%rip),%rdi
call   1030 <dlopen@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
mov    0x2eb6(%rip),%rbx
mov    (%rbx),%esi
or     (%r14),%esi
lea    0xed2(%rip),%rdi
call   1030 <dlopen@plt>
mov    (%rbx),%esi
or     (%r14),%esi
lea    0xed6(%rip),%rdi
call   1030 <dlopen@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"gnu-gettext-GetURL$1\00"
@RTLD_GLOBAL = global i32 0
@RTLD_LAZY = global i32 0
@.str.1 = [22 x i8] c"gnu-gettext-GetURL${1\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @RTLD_GLOBAL
%3 = load i32, i32* @RTLD_LAZY
%4 = or i32 %2, %3
%5 = call i32 @dlopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @RTLD_GLOBAL
%7 = load i32, i32* @RTLD_LAZY
%8 = or i32 %6, %7
%9 = call i32 @dlopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"gnu-gettext-GetURL$1\00"
@RTLD_GLOBAL = global i32 0
@RTLD_LAZY = global i32 0
@.str.1 = [22 x i8] c"gnu-gettext-GetURL${1\00"
define i32 @main() {
%1 = load i32, i32* @RTLD_GLOBAL
%2 = load i32, i32* @RTLD_LAZY
%3 = or i32 %2, %1
%4 = tail call i32 @dlopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @RTLD_GLOBAL
%6 = load i32, i32* @RTLD_LAZY
%7 = or i32 %6, %5
%8 = tail call i32 @dlopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
scalar_t__ RAND_MAX;
float rand();
int /*<<< orphan*/ srand(int);
float gezira_random(float min, float max) {
  static int called_srand = 0;
  if (!called_srand)
    srand(1234567);
  called_srand = 1;
  return rand() / (float)RAND_MAX * (max - min) + min;
}


x86 assembly (clang, -O0):
<gezira_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
cmpl   $0x0,0x2eff(%rip)
jne    1149 <gezira_random+0x29>
mov    $0x12d687,%edi
call   1030 <srand@plt>
movl   $0x1,0x2ee5(%rip)
mov    $0x0,%al
call   1040 <rand@plt>
mov    0x2e87(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gezira_random>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
cmpb   $0x0,0x2f05(%rip)
jne    113f <gezira_random+0x1f>
mov    $0x12d687,%edi
call   1030 <srand@plt>
movb   $0x1,0x2ef2(%rip)
xor    %eax,%eax
call   1040 <rand@plt>
mov    0x2e94(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movss  0x4(%rsp),%xmm1
movss  (%rsp),%xmm2
subss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@gezira_random.called_srand = internal global i32 0
@RAND_MAX = global i64 0
define float @gezira_random(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load i32, i32* @gezira_random.called_srand
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @srand(i32 1234567)
br label %9
9: ; preds = %7, %2
store i32 1, i32* @gezira_random.called_srand
%10 = call float (...) @rand()
%11 = load i64, i64* @RAND_MAX
%12 = sitofp i64 %11 to float
%13 = fdiv float %10, %12
%14 = load float, float* %4
%15 = load float, float* %3
%16 = fsub float %14, %15
%17 = load float, float* %3
%18 = call float @llvm.fmuladd.f32(float %13, float %16, float %17)
ret float %18
}

LLVM IR (-O2):
@gezira_random.called_srand = internal unnamed_addr global i1 false
@RAND_MAX = global i64 0
define float @gezira_random(float %0, float %1) {
%3 = load i1, i1* @gezira_random.called_srand
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @srand(i32 1234567)
br label %6
6: ; preds = %4, %2
store i1 true, i1* @gezira_random.called_srand
%7 = tail call float (...) @rand()
%8 = load i64, i64* @RAND_MAX
%9 = sitofp i64 %8 to float
%10 = fdiv float %7, %9
%11 = fsub float %1, %0
%12 = tail call float @llvm.fmuladd.f32(float %10, float %11, float %0)
ret float %12
}
/* Variables and functions */
int isupper(char);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char c;
  c = 'C';
  printf("Return value when uppercase character is passed to isupper(): %d",
         isupper(c));
  c = '+';
  printf("\nReturn value when uppercase character is not passed to is "
         "isupper(): %d",
         isupper(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x43,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <isupper@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movb   $0x2b,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <isupper@plt>
mov    %eax,%esi
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x43,%edi
call   1040 <isupper@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2b,%edi
call   1040 <isupper@plt>
lea    0xef7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [65 x i8] c"Return value when uppercase character is passed to isupper(): %d\00"
@.str.1 = [73 x i8] c"\0AReturn value when uppercase character is not passed to is isupper(): %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 67, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @isupper(i8 signext %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %4)
store i8 43, i8* %2
%6 = load i8, i8* %2
%7 = call i32 @isupper(i8 signext %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [65 x i8] c"Return value when uppercase character is passed to isupper(): %d\00"
@.str.1 = [73 x i8] c"\0AReturn value when uppercase character is not passed to is isupper(): %d\00"
define i32 @main() {
%1 = tail call i32 @isupper(i8 signext 67)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @isupper(i8 signext 43)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
struct ibv_pd {
  int dummy;
};
struct ibv_mr {
  int dummy;
};

/* Variables and functions */
int IBV_ACCESS_LOCAL_WRITE;
int IBV_ACCESS_REMOTE_READ;
int IBV_ACCESS_REMOTE_WRITE;
struct ibv_mr *ibv_reg_mr(struct ibv_pd *, void *, size_t, int);
struct ibv_mr *zillians_ibv_reg_mr(struct ibv_pd *pd, void *addr,
                                   size_t length) {
  return ibv_reg_mr(pd, addr, length,
                    IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_WRITE |
                        IBV_ACCESS_REMOTE_READ);
}


x86 assembly (clang, -O0):
<zillians_ibv_reg_mr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2ea9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea8(%rip),%rax
or     (%rax),%ecx
mov    0x2e87(%rip),%rax
or     (%rax),%ecx
call   1030 <ibv_reg_mr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zillians_ibv_reg_mr>:
mov    0x2ec9(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2ea7(%rip),%rax
or     (%rax),%ecx
jmp    1030 <ibv_reg_mr@plt>

LLVM IR (-O0):
%struct.ibv_mr = type { i32 }
%struct.ibv_pd = type { i32 }
@IBV_ACCESS_LOCAL_WRITE = global i32 0
@IBV_ACCESS_REMOTE_WRITE = global i32 0
@IBV_ACCESS_REMOTE_READ = global i32 0
define %struct.ibv_mr* @zillians_ibv_reg_mr(%struct.ibv_pd* %0, i8* %1, i64 %2) {
%4 = alloca %struct.ibv_pd*
%5 = alloca i8*
%6 = alloca i64
store %struct.ibv_pd* %0, %struct.ibv_pd** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.ibv_pd*, %struct.ibv_pd** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i32, i32* @IBV_ACCESS_LOCAL_WRITE
%11 = load i32, i32* @IBV_ACCESS_REMOTE_WRITE
%12 = or i32 %10, %11
%13 = load i32, i32* @IBV_ACCESS_REMOTE_READ
%14 = or i32 %12, %13
%15 = call %struct.ibv_mr* @ibv_reg_mr(%struct.ibv_pd* %7, i8* %8, i64 %9, i32 %14)
ret %struct.ibv_mr* %15
}

LLVM IR (-O2):
%struct.ibv_mr = type { i32 }
%struct.ibv_pd = type { i32 }
@IBV_ACCESS_LOCAL_WRITE = global i32 0
@IBV_ACCESS_REMOTE_WRITE = global i32 0
@IBV_ACCESS_REMOTE_READ = global i32 0
define %struct.ibv_mr* @zillians_ibv_reg_mr(%struct.ibv_pd* %0, i8* %1, i64 %2) {
%4 = load i32, i32* @IBV_ACCESS_LOCAL_WRITE
%5 = load i32, i32* @IBV_ACCESS_REMOTE_WRITE
%6 = or i32 %5, %4
%7 = load i32, i32* @IBV_ACCESS_REMOTE_READ
%8 = or i32 %6, %7
%9 = tail call %struct.ibv_mr* @ibv_reg_mr(%struct.ibv_pd* %0, i8* %1, i64 %2, i32 %8)
ret %struct.ibv_mr* %9
}
/* Variables and functions */
int /*<<< orphan*/ I2C2_DriverIRQHandler();
__attribute__((weak)) void I2C2_IRQHandler(void) { I2C2_DriverIRQHandler(); }


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

x86 assembly (clang, -O2):
<I2C2_IRQHandler>:
xor    %eax,%eax
jmp    1030 <I2C2_DriverIRQHandler@plt>

LLVM IR (-O0):
define weak void @I2C2_IRQHandler() {
%1 = call i32 (...) @I2C2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @I2C2_IRQHandler() {
%1 = tail call i32 (...) @I2C2_DriverIRQHandler()
ret void
}
char *langRomTypeWaveSCSI1mb() { return "1MB WAVE-SCSI"; }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"1MB WAVE-SCSI\00"
define i8* @langRomTypeWaveSCSI1mb() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"1MB WAVE-SCSI\00"
define i8* @langRomTypeWaveSCSI1mb() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
void xfree(pointer) void *pointer;
{
  if (pointer)
    free(pointer);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     111a <xfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @free(i8* %0)
br label %4
4: ; preds = %3, %1
ret void
}
/* Type definitions */
struct vector {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec_set(struct vector *, float, float, float);
void get_main_board_xyz(struct vector *p, int main_board) {
  vec_set(p, -2.f * 20.f + main_board * 2.f * 20.f, 0.f,
          80.f - main_board * 80.f);
}


x86 assembly (clang, -O0):
<get_main_board_xyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
cvtsi2ssl -0xc(%rbp),%xmm0
movss  0xedc(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xec8(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xec0(%rip),%xmm1
addss  %xmm1,%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
movss  0xe9a(%rip),%xmm1
mulss  %xmm1,%xmm2
addss  %xmm1,%xmm2
xorps  %xmm1,%xmm1
call   1030 <vec_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_main_board_xyz>:
cvtsi2ss %esi,%xmm1
movaps %xmm1,%xmm0
addss  %xmm1,%xmm0
mulss  0xedd(%rip),%xmm0
addss  0xed9(%rip),%xmm0
movss  0xed5(%rip),%xmm2
mulss  %xmm2,%xmm1
subss  %xmm1,%xmm2
xorps  %xmm1,%xmm1
jmp    1030 <vec_set@plt>

LLVM IR (-O0):
%struct.vector = type { i32 }
define void @get_main_board_xyz(%struct.vector* %0, i32 %1) {
%3 = alloca %struct.vector*
%4 = alloca i32
store %struct.vector* %0, %struct.vector** %3
store i32 %1, i32* %4
%5 = load %struct.vector*, %struct.vector** %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to float
%8 = fmul float %7, 2.000000e+00
%9 = call float @llvm.fmuladd.f32(float %8, float 2.000000e+01, float -4.000000e+01)
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to float
%12 = fneg float %11
%13 = call float @llvm.fmuladd.f32(float %12, float 8.000000e+01, float 8.000000e+01)
%14 = call i32 @vec_set(%struct.vector* %5, float %9, float 0.000000e+00, float %13)
ret void
}

LLVM IR (-O2):
%struct.vector = type { i32 }
define void @get_main_board_xyz(%struct.vector* %0, i32 %1) {
%3 = sitofp i32 %1 to float
%4 = fmul float %3, 2.000000e+00
%5 = tail call float @llvm.fmuladd.f32(float %4, float 2.000000e+01, float -4.000000e+01)
%6 = fneg float %3
%7 = tail call float @llvm.fmuladd.f32(float %6, float 8.000000e+01, float 8.000000e+01)
%8 = tail call i32 @vec_set(%struct.vector* %0, float %5, float 0.000000e+00, float %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __vm_wait();
int syscall(int, void *, size_t);
int __munmap(void *start, size_t len) {
  __vm_wait();
  return syscall(91, start, len);
}


x86 assembly (clang, -O0):
<__munmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <__vm_wait@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x5b,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__munmap>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <__vm_wait@plt>
mov    $0x5b,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @__munmap(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = call i32 (...) @__vm_wait()
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 @syscall(i32 91, i8* %6, i64 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @__munmap(i8* %0, i64 %1) {
%3 = tail call i32 (...) @__vm_wait()
%4 = tail call i32 @syscall(i32 91, i8* %0, i64 %1)
ret i32 %4
}
long TIMES(buffer)
long *buffer;
{ return ((long)times(buffer)); }


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

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

LLVM IR (-O0):
define i64 @TIMES(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = call i32 (i64*, ...) bitcast (i32 (...)* @times to i32 (i64*, ...)*)(i64* %3)
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @TIMES(i64* %0) {
%2 = tail call i32 (i64*, ...) bitcast (i32 (...)* @times to i32 (i64*, ...)*)(i64* %0)
%3 = sext i32 %2 to i64
ret i64 %3
}
unsigned move_closer_by(unsigned cur_pos, unsigned goal_pos,
                        unsigned time_passed) {
  if (cur_pos > goal_pos) {
    return cur_pos - time_passed;
  } else {
    return cur_pos + time_passed;
  }
}


x86 assembly (clang, -O0):
<move_closer_by>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1127 <move_closer_by+0x27>
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <move_closer_by+0x30>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_closer_by>:
mov    %edx,%eax
neg    %eax
cmp    %esi,%edi
cmovbe %edx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @move_closer_by(i32 %0, i32 %1, i32 %2) {
%4 = icmp ugt i32 %0, %1
%5 = sub i32 0, %2
%6 = select i1 %4, i32 %5, i32 %2
%7 = add i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void abc(char *s) {
  if (s[0] == '\0')
    return;
  abc(s + 1);
  abc(s + 1);
  printf("%c", s[0]);
}


x86 assembly (clang, -O0):
<abc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1141 <abc+0x21>
jmp    116e <abc+0x4e>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <abc@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <abc@plt>
mov    -0x8(%rbp),%rax
lea    0xe9a(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abc>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1156 <abc+0x36>
mov    %rdi,%rbx
lea    0x1(%rdi),%r14
mov    %r14,%rdi
call   1040 <abc@plt>
mov    %r14,%rdi
call   1040 <abc@plt>
movsbl (%rbx),%esi
lea    0xeb6(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @abc(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1, %5
ret void
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
tail call void @abc(i8* %6)
tail call void @abc(i8* %6)
%7 = load i8, i8* %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
br label %4
}
/* Variables and functions */
int bis(int, int);
int bool_or(int x, int y) { return bis(x, y); }


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

x86 assembly (clang, -O2):
<bool_or>:
jmp    1030 <bis@plt>

LLVM IR (-O0):
define i32 @bool_or(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 = load i32, i32* %4
%7 = call i32 @bis(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @bool_or(i32 %0, i32 %1) {
%3 = tail call i32 @bis(i32 %0, i32 %1)
ret i32 %3
}
int remote_kill(id, sig)
int id;
int sig;
{ return -1; }


x86 assembly (clang, -O0):
<remote_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @remote_kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @remote_kill(i32 %0, i32 %1) {
ret i32 -1
}
int main(int argc, char **argv) { return 23; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x17,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 23
}
double test2(double x) {
  double s, c;
  x = x * 2;
  s = __builtin_sin(x);
  c = __builtin_cos(x);
  return s + c;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
sub    $0x18,%rsp
addsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @test2(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fmul double %5, 2.000000e+00
store double %6, double* %2
%7 = load double, double* %2
%8 = call double @sin(double %7)
store double %8, double* %3
%9 = load double, double* %2
%10 = call double @cos(double %9)
store double %10, double* %4
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fadd double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @test2(double %0) {
%2 = fmul double %0, 2.000000e+00
%3 = tail call double @sin(double %2)
%4 = tail call double @cos(double %2)
%5 = fadd double %3, %4
ret double %5
}
unsigned int heap_perfect_log2(unsigned int number) {
  int log = 0, original_number = number;
  while (number >>= 1)
    ++log;
  return original_number - (1 << log);
}


x86 assembly (clang, -O0):
<heap_perfect_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1134 <heap_perfect_log2+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <heap_perfect_log2+0x14>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_perfect_log2>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jb     111c <heap_perfect_log2+0x1c>
xor    %ecx,%ecx
mov    %edi,%eax
mov    %edi,%edx
nopl   (%rax)
shr    %edx
add    $0x1,%ecx
cmp    $0x3,%eax
mov    %edx,%eax
ja     1110 <heap_perfect_log2+0x10>
mov    $0xffffffff,%eax
shl    %cl,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @heap_perfect_log2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = lshr i32 %4, 1
%7 = add nuw nsw i32 %5, 1
%8 = icmp ult i32 %4, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
%11 = shl nsw i32 -1, %10
%12 = add i32 %11, %0
ret i32 %12
}
/* Variables and functions */
scalar_t__ is_keyword(char *, char *);
scalar_t__ matches(char *, char *);
int is_index(char *line, char *type) {
  return is_keyword(line, "index") && matches(line + 1 + 6, type);
}


x86 assembly (clang, -O0):
<is_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <is_keyword@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1171 <is_index+0x51>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x6,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <matches@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_index>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rsi
call   1030 <is_keyword@plt>
test   %rax,%rax
je     1157 <is_index+0x37>
add    $0x7,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <matches@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1159 <is_index+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"index\00"
define i32 @is_index(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 = call i64 @is_keyword(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = getelementptr inbounds i8, i8* %10, i64 6
%12 = load i8*, i8** %4
%13 = call i64 @matches(i8* %11, i8* %12)
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %8, %2
%16 = phi i1 [ false, %2 ], [ %14, %8 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@.str = [6 x i8] c"index\00"
define i32 @is_index(i8* %0, i8* %1) {
%3 = tail call i64 @is_keyword(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 7
%7 = tail call i64 @matches(i8* %6, i8* %1)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %2
%11 = phi i32 [ 0, %2 ], [ %9, %5 ]
ret i32 %11
}
unsigned int cpuid(unsigned int eax, char *sig) {
  unsigned int *sig32 = (unsigned int *)sig;
  asm volatile("xchgl %%ebx,%1; xor %%ebx,%%ebx; cpuid; xchgl %%ebx,%1"
               : "=a"(eax), "+r"(sig32[0]), "=c"(sig32[1]), "=d"(sig32[2])
               : "0"(eax));
  sig[12] = 0;
  return eax;
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    (%rdi),%r8d
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
xchg   %r8d,%ebx
xor    %ebx,%ebx
cpuid
xchg   %r8d,%ebx
mov    %eax,%r9d
mov    -0x28(%rbp),%rax
mov    %ecx,%esi
mov    -0x20(%rbp),%rcx
mov    %r9d,-0x4(%rbp)
mov    %r8d,(%rdi)
mov    %esi,0x4(%rcx)
mov    %edx,0x8(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0xc(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
mov    %edi,%eax
mov    (%rsi),%edi
xchg   %edi,%ebx
xor    %ebx,%ebx
cpuid
xchg   %edi,%ebx
mov    %edi,(%rsi)
mov    %ecx,0x4(%rsi)
mov    %edx,0x8(%rsi)
movb   $0x0,0xc(%rsi)
ret

LLVM IR (-O0):
define i32 @cpuid(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %3
%16 = call { i32, i32, i32, i32 } asm sideeffect "xchgl %ebx,$1; xor %ebx,%ebx; cpuid; xchgl %ebx,$1", "={ax},=r,={cx},={dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %15, i32 %10)
%17 = extractvalue { i32, i32, i32, i32 } %16, 0
%18 = extractvalue { i32, i32, i32, i32 } %16, 1
%19 = extractvalue { i32, i32, i32, i32 } %16, 2
%20 = extractvalue { i32, i32, i32, i32 } %16, 3
store i32 %17, i32* %3
store i32 %18, i32* %9
store i32 %19, i32* %12
store i32 %20, i32* %14
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 12
store i8 0, i8* %22
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @cpuid(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = getelementptr inbounds i8, i8* %1, i64 4
%6 = bitcast i8* %5 to i32*
%7 = getelementptr inbounds i8, i8* %1, i64 8
%8 = bitcast i8* %7 to i32*
%9 = tail call { i32, i32, i32, i32 } asm sideeffect "xchgl %ebx,$1; xor %ebx,%ebx; cpuid; xchgl %ebx,$1", "={ax},=r,={cx},={dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %4)
%10 = extractvalue { i32, i32, i32, i32 } %9, 0
%11 = extractvalue { i32, i32, i32, i32 } %9, 1
%12 = extractvalue { i32, i32, i32, i32 } %9, 2
%13 = extractvalue { i32, i32, i32, i32 } %9, 3
store i32 %11, i32* %3
store i32 %12, i32* %6
store i32 %13, i32* %8
%14 = getelementptr inbounds i8, i8* %1, i64 12
store i8 0, i8* %14
ret i32 %10
}
/* Variables and functions */
char *str_alloc_debug(scalar_t__, char *, int);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *str_dup(const char *str) {
  char *retval;
  retval = str_alloc_debug((strlen(str) + 1),
                           "/scratch/repos/new/home/jordi_armengol_estape/"
                           "c-scraper/outputs/2022-01-22/02-19-57/repos/davean/"
                           "stunnel-xforwardfor/refs/heads/master/src/str.c",
                           80);
  strcpy(retval, str);
  return retval;
}


x86 assembly (clang, -O0):
<str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
lea    0xead(%rip),%rsi
mov    $0x50,%edx
call   1050 <str_alloc_debug@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x50,%edx
call   1050 <str_alloc_debug@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/davean/stunnel-xforwardfor/refs/heads/master/src/str.c\00"
define i8* @str_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @str_alloc_debug(i64 %6, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 80)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/davean/stunnel-xforwardfor/refs/heads/master/src/str.c\00"
define i8* @str_dup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @str_alloc_debug(i64 %3, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 80)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
uint32_t readBigInt(FILE *file) {
  uint32_t c1 = getc(file) << 24;
  uint32_t c2 = getc(file) << 16;
  uint32_t c3 = getc(file) << 8;
  uint32_t c4 = getc(file);
  return (c1 | c2 | c3 | c4);
}


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

x86 assembly (clang, -O2):
<readBigInt>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <getc@plt>
mov    %eax,%ebp
shl    $0x18,%ebp
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
or     %ebp,%ebx
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %r14,%rdi
call   1030 <getc@plt>
or     %ebp,%eax
or     %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readBigInt(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %2
%7 = load i32*, i32** %2
%8 = call i32 @getc(i32* %7)
%9 = shl i32 %8, 24
store i32 %9, i32* %3
%10 = load i32*, i32** %2
%11 = call i32 @getc(i32* %10)
%12 = shl i32 %11, 16
store i32 %12, i32* %4
%13 = load i32*, i32** %2
%14 = call i32 @getc(i32* %13)
%15 = shl i32 %14, 8
store i32 %15, i32* %5
%16 = load i32*, i32** %2
%17 = call i32 @getc(i32* %16)
store i32 %17, i32* %6
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = or i32 %18, %19
%21 = load i32, i32* %5
%22 = or i32 %20, %21
%23 = load i32, i32* %6
%24 = or i32 %22, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @readBigInt(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = shl i32 %2, 24
%4 = tail call i32 @getc(i32* %0)
%5 = shl i32 %4, 16
%6 = tail call i32 @getc(i32* %0)
%7 = shl i32 %6, 8
%8 = tail call i32 @getc(i32* %0)
%9 = or i32 %5, %3
%10 = or i32 %9, %7
%11 = or i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ morse_char(char);
int /*<<< orphan*/ pause(int);
void morse_string(char *s) {
  char c;
  while ((c = *s++)) {
    if (c == ' ')
      pause(5);
    else
      morse_char(c);
  }
}


x86 assembly (clang, -O0):
<morse_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     1172 <morse_string+0x52>
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
jne    1164 <morse_string+0x44>
mov    $0x5,%edi
call   1030 <pause@plt>
jmp    116d <morse_string+0x4d>
movsbl -0x9(%rbp),%edi
call   1040 <morse_char@plt>
jmp    112c <morse_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<morse_string>:
push   %rbx
mov    %rdi,%rbx
jmp    113a <morse_string+0x1a>
cs nopw 0x0(%rax,%rax,1)
mov    $0x5,%edi
call   1030 <pause@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
cmp    $0x20,%al
je     1130 <morse_string+0x10>
test   %al,%al
je     1153 <morse_string+0x33>
movsbl %al,%edi
call   1040 <morse_char@plt>
jmp    113a <morse_string+0x1a>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @morse_string(i8* nocapture %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i8* [ %0, %1 ], [ %4, %10 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 32, label %6
]
6: ; preds = %2
%7 = tail call i32 @pause(i32 5)
br label %10
8: ; preds = %2
%9 = tail call i32 @morse_char(i8 signext %5)
br label %10
10: ; preds = %8, %6
br label %2
11: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_global(int);
int main(void) {
  set_global(1);
  set_global(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <set_global@plt>
mov    $0x2,%edi
call   1030 <set_global@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <set_global@plt>
mov    $0x2,%edi
call   1030 <set_global@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @set_global(i32 1)
%2 = tail call i32 @set_global(i32 2)
ret i32 0
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
float randf(float a, float b) {
  return ((b - a) * ((float)rand() / RAND_MAX)) + a;
}


x86 assembly (clang, -O0):
<randf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movss  -0xc(%rbp),%xmm0
cvtsi2ss %rax,%xmm2
mov    0x2e9f(%rip),%rax
divss  (%rax),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randf>:
push   %rax
movss  %xmm0,0x4(%rsp)
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    0x2eb2(%rip),%rax
divss  (%rax),%xmm0
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @randf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fsub float %5, %6
%8 = call i64 (...) @rand()
%9 = sitofp i64 %8 to float
%10 = load float, float* @RAND_MAX
%11 = fdiv float %9, %10
%12 = load float, float* %3
%13 = call float @llvm.fmuladd.f32(float %7, float %11, float %12)
ret float %13
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @randf(float %0, float %1) {
%3 = fsub float %1, %0
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to float
%6 = load float, float* @RAND_MAX
%7 = fdiv float %5, %6
%8 = tail call float @llvm.fmuladd.f32(float %3, float %7, float %0)
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ tputchar_safe(char const);
void tputs_safe(const char *str, size_t len) {
  while (len--) {
    tputchar_safe(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<tputs_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1156 <tputs_safe+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tputchar_safe@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <tputs_safe+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tputs_safe>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1143 <tputs_safe+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <tputchar_safe@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <tputs_safe+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @tputs_safe(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %10, %4 ], [ %0, %2 ]
%7 = add i64 %5, -1
%8 = load i8, i8* %6
%9 = tail call i32 @tputchar_safe(i8 signext %8)
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = icmp eq i64 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void even(void) {
  int i;
  for (i = 0; i <= 10; i = i + 2)
    printf("%3d", i);
  return;
}


x86 assembly (clang, -O0):
<even>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jg     1146 <even+0x36>
mov    -0x4(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <even+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<even>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%3d\00"
define void @even() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ function_child();
int /*<<< orphan*/ printf(char *);
void function_stepparent(void) {
  printf("sp[");
  function_child();
  printf("] ");
}


x86 assembly (clang, -O0):
<function_stepparent>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <function_child@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_stepparent>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <function_child@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"sp[\00"
@.str.1 = [3 x i8] c"] \00"
define void @function_stepparent() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @function_child()
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"sp[\00"
@.str.1 = [3 x i8] c"] \00"
define void @function_stepparent() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @function_child()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo628() {}


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

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

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

LLVM IR (-O2):
define void @foo628() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void Initialize(uint32_t *s) {
  s[0] = 0x67452301ul;
  s[1] = 0xEFCDAB89ul;
  s[2] = 0x98BADCFEul;
  s[3] = 0x10325476ul;
  s[4] = 0xC3D2E1F0ul;
}


x86 assembly (clang, -O0):
<Initialize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x67452301,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xefcdab89,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x98badcfe,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x10325476,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0xc3d2e1f0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Initialize>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movl   $0xc3d2e1f0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @Initialize(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 1732584193, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 -271733879, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 -1732584194, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 271733878, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 4
store i32 -1009589776, i32* %12
ret void
}

LLVM IR (-O2):
define void @Initialize(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1732584193, i32 -271733879, i32 -1732584194, i32 271733878>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 -1009589776, i32* %3
ret void
}