xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
size_t regerror(int errcode, const regex_t *__restrict__ preg,
                char *__restrict__ errbuf, size_t errbuf_size) {
  strncpy(errbuf, "invalid regular expression (sorry)", errbuf_size);
  return strlen(errbuf);
}


x86 assembly (clang, -O0):
<regerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xeba(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regerror>:
push   %rbx
mov    %rdx,%rbx
lea    0xed5(%rip),%rsi
mov    %rdx,%rdi
mov    %rcx,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strlen@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"invalid regular expression (sorry)\00"
define i64 @regerror(i32 %0, i32* noalias %1, i8* noalias %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %7
%10 = load i64, i64* %8
%11 = call i32 @strncpy(i8* %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = load i8*, i8** %7
%13 = call i64 @strlen(i8* %12)
ret i64 %13
}

LLVM IR (-O2):
@.str = [35 x i8] c"invalid regular expression (sorry)\00"
define i64 @regerror(i32 %0, i32* noalias nocapture readnone %1, i8* noalias %2, i64 %3) {
%5 = tail call i32 @strncpy(i8* %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %3)
%6 = tail call i64 @strlen(i8* dereferenceable(1) %2)
ret i64 %6
}
double(_ceil)(double x) {
  return ((x - ((long)x)) > 0.0) ? (((long)x) + 1.0) : x;
}


x86 assembly (clang, -O0):
<_ceil>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvttsd2si -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114b <_ceil+0x4b>
cvttsd2si -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  0xec3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1155 <_ceil+0x55>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ceil>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm2
movapd %xmm0,%xmm3
subsd  %xmm2,%xmm3
addsd  0xee6(%rip),%xmm2
xorpd  %xmm1,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @_ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
%6 = sitofp i64 %5 to double
%7 = fsub double %3, %6
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load double, double* %2
%11 = fptosi double %10 to i64
%12 = sitofp i64 %11 to double
%13 = fadd double %12, 1.000000e+00
br label %16
14: ; preds = %1
%15 = load double, double* %2
br label %16
16: ; preds = %14, %9
%17 = phi double [ %13, %9 ], [ %15, %14 ]
ret double %17
}

LLVM IR (-O2):
define double @_ceil(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fcmp ogt double %4, 0.000000e+00
%6 = fadd double %3, 1.000000e+00
%7 = select i1 %5, double %6, double %0
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ safe_exit(int /*<<< orphan*/);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void sigINT_handler(int sig) {
  signal(sig, SIG_IGN);
  safe_exit(0);
}


x86 assembly (clang, -O0):
<sigINT_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %edi,%edi
call   1040 <safe_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigINT_handler>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <safe_exit@plt>

LLVM IR (-O0):
@SIG_IGN = global i32 0
define void @sigINT_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIG_IGN
%5 = call i32 @signal(i32 %3, i32 %4)
%6 = call i32 @safe_exit(i32 0)
ret void
}

LLVM IR (-O2):
@SIG_IGN = global i32 0
define void @sigINT_handler(i32 %0) {
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %0, i32 %2)
%4 = tail call i32 @safe_exit(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ input_joystick_available();
char const *lang_get(char *);
const char *f_input_fire6() {
  return lang_get(input_joystick_available() ? "INPUT_JOY_FIRE6"
                                             : "INPUT_KEYB_FIRE6");
}


x86 assembly (clang, -O0):
<f_input_fire6>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <input_joystick_available@plt>
mov    %rax,%rcx
lea    0xedb(%rip),%rdi
lea    0xec4(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1030 <lang_get@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_input_fire6>:
push   %rax
xor    %eax,%eax
call   1040 <input_joystick_available@plt>
test   %rax,%rax
lea    0xede(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <lang_get@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"INPUT_JOY_FIRE6\00"
@.str.1 = [17 x i8] c"INPUT_KEYB_FIRE6\00"
define i8* @f_input_fire6() {
%1 = call i64 (...) @input_joystick_available()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0)
%5 = call i8* @lang_get(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"INPUT_JOY_FIRE6\00"
@.str.1 = [17 x i8] c"INPUT_KEYB_FIRE6\00"
define i8* @f_input_fire6() {
%1 = tail call i64 (...) @input_joystick_available()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
%4 = tail call i8* @lang_get(i8* %3)
ret i8* %4
}
/* Type definitions */
struct snd_kcontrol {
  int dummy;
};
struct snd_ctl_elem_info {
  int dummy;
};

/* Variables and functions */
int snd_ctl_enum_info(struct snd_ctl_elem_info *, int, int,
                      char const *const *);
int snd_ac97_stac9758_phonesel_info(struct snd_kcontrol *kcontrol,
                                    struct snd_ctl_elem_info *uinfo) {
  static const char *const texts[3] = {"None", "Front Jack", "Rear Jack"};
  return snd_ctl_enum_info(uinfo, 1, 3, texts);
}


x86 assembly (clang, -O0):
<snd_ac97_stac9758_phonesel_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
lea    0x2ccb(%rip),%rcx
call   1030 <snd_ctl_enum_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snd_ac97_stac9758_phonesel_info>:
mov    %rsi,%rdi
lea    0x2ce6(%rip),%rcx
mov    $0x1,%esi
mov    $0x3,%edx
jmp    1030 <snd_ctl_enum_info@plt>

LLVM IR (-O0):
%struct.snd_kcontrol = type { i32 }
%struct.snd_ctl_elem_info = type { i32 }
@snd_ac97_stac9758_phonesel_info.texts = internal constant [3 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0)]
@.str = [5 x i8] c"None\00"
@.str.1 = [11 x i8] c"Front Jack\00"
@.str.2 = [10 x i8] c"Rear Jack\00"
define i32 @snd_ac97_stac9758_phonesel_info(%struct.snd_kcontrol* %0, %struct.snd_ctl_elem_info* %1) {
%3 = alloca %struct.snd_kcontrol*
%4 = alloca %struct.snd_ctl_elem_info*
store %struct.snd_kcontrol* %0, %struct.snd_kcontrol** %3
store %struct.snd_ctl_elem_info* %1, %struct.snd_ctl_elem_info** %4
%5 = load %struct.snd_ctl_elem_info*, %struct.snd_ctl_elem_info** %4
%6 = call i32 @snd_ctl_enum_info(%struct.snd_ctl_elem_info* %5, i32 1, i32 3, i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @snd_ac97_stac9758_phonesel_info.texts, i64 0, i64 0))
ret i32 %6
}

LLVM IR (-O2):
%struct.snd_kcontrol = type { i32 }
%struct.snd_ctl_elem_info = type { i32 }
@snd_ac97_stac9758_phonesel_info.texts = internal constant [3 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0)]
@.str = [5 x i8] c"None\00"
@.str.1 = [11 x i8] c"Front Jack\00"
@.str.2 = [10 x i8] c"Rear Jack\00"
define i32 @snd_ac97_stac9758_phonesel_info(%struct.snd_kcontrol* nocapture readnone %0, %struct.snd_ctl_elem_info* %1) {
%3 = tail call i32 @snd_ctl_enum_info(%struct.snd_ctl_elem_info* %1, i32 1, i32 3, i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @snd_ac97_stac9758_phonesel_info.texts, i64 0, i64 0))
ret i32 %3
}
float fnCalcDiscriminant(float a, float b, float c) {
  return (b * b - 4 * a * c);
}


x86 assembly (clang, -O0):
<fnCalcDiscriminant>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  0xedb(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnCalcDiscriminant>:
mulss  0xef8(%rip),%xmm0
mulss  %xmm2,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fnCalcDiscriminant(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %5
%9 = load float, float* %4
%10 = fmul float 4.000000e+00, %9
%11 = load float, float* %6
%12 = fmul float %10, %11
%13 = fneg float %12
%14 = call float @llvm.fmuladd.f32(float %7, float %8, float %13)
ret float %14
}

LLVM IR (-O2):
define float @fnCalcDiscriminant(float %0, float %1, float %2) {
%4 = fmul float %0, -4.000000e+00
%5 = fmul float %4, %2
%6 = tail call float @llvm.fmuladd.f32(float %1, float %1, float %5)
ret float %6
}
/* Variables and functions */
float acosf(float);
void sAcos_process(float bIn, float *bOut) { *bOut = acosf(bIn); }


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

x86 assembly (clang, -O2):
<sAcos_process>:
push   %rbx
mov    %rdi,%rbx
call   1030 <acosf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sAcos_process(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 = call float @acosf(float %5)
%7 = load float*, float** %4
store float %6, float* %7
ret void
}

LLVM IR (-O2):
define void @sAcos_process(float %0, float* nocapture writeonly %1) {
%3 = tail call float @acosf(float %0)
store float %3, float* %1
ret void
}
int test_isucc(int i) { return (i + 1); }


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

x86 assembly (clang, -O2):
<test_isucc>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test_isucc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @test_isucc(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __chk_fail();
int getdomainname(char *, size_t);
int __getdomainname_chk(char *buf, size_t buflen, size_t nreal) {
  if (buflen > nreal)
    __chk_fail();
  return getdomainname(buf, buflen);
}


x86 assembly (clang, -O0):
<__getdomainname_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1149 <__getdomainname_chk+0x29>
mov    $0x0,%al
call   1040 <__chk_fail@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <getdomainname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getdomainname_chk>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
cmp    %rdx,%rsi
jbe    1136 <__getdomainname_chk+0x16>
xor    %eax,%eax
call   1040 <__chk_fail@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <getdomainname@plt>

LLVM IR (-O0):
define i32 @__getdomainname_chk(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = load i64, i64* %6
%9 = icmp ugt i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 (...) @__chk_fail()
br label %12
12: ; preds = %10, %3
%13 = load i8*, i8** %4
%14 = load i64, i64* %5
%15 = call i32 @getdomainname(i8* %13, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @__getdomainname_chk(i8* %0, i64 %1, i64 %2) {
%4 = icmp ugt i64 %1, %2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (...) @__chk_fail()
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @getdomainname(i8* %0, i64 %1)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushcomplex16array_(char *x, unsigned int *n) { pushNarray(x, (*n * 16)); }


x86 assembly (clang, -O0):
<pushcomplex16array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x4,%esi
call   1030 <pushNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushcomplex16array_>:
mov    (%rsi),%esi
shl    $0x4,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushcomplex16array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 16
%9 = call i32 @pushNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushcomplex16array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 4
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}
/* Type definitions */
struct hash {
  int dummy;
};

/* Variables and functions */
struct hash *hashThisEqThatLine(char *, int, int);
struct hash *hashVarLine(char *line, int lineIx) {
  return hashThisEqThatLine(line, lineIx, 1);
}


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

x86 assembly (clang, -O2):
<hashVarLine>:
mov    $0x1,%edx
jmp    1030 <hashThisEqThatLine@plt>

LLVM IR (-O0):
%struct.hash = type { i32 }
define %struct.hash* @hashVarLine(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call %struct.hash* @hashThisEqThatLine(i8* %5, i32 %6, i32 1)
ret %struct.hash* %7
}

LLVM IR (-O2):
%struct.hash = type { i32 }
define %struct.hash* @hashVarLine(i8* %0, i32 %1) {
%3 = tail call %struct.hash* @hashThisEqThatLine(i8* %0, i32 %1, i32 1)
ret %struct.hash* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
float mod(float f, float s) {
  float t;
  t = (int)f % (int)s;
  if (t > 9999999 || t < -9999999) {
    printf("ERROR 5");
    printf("\n");
    exit(0);
  } else {
    return t;
  }
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
cvttss2si -0x4(%rbp),%eax
cvttss2si -0x8(%rbp),%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xeab(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     1170 <mod+0x50>
movss  0xe9e(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    118f <mod+0x6f>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
cvttss2si %xmm0,%eax
cvttss2si %xmm1,%ecx
cltd
idiv   %ecx
lea    -0x989680(%rdx),%eax
cmp    $0xfeced300,%eax
jbe    1150 <mod+0x20>
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
ret
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ERROR 5\00"
@.str.1 = [2 x i8] c"\0A\00"
define float @mod(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = fptosi float %6 to i32
%8 = load float, float* %4
%9 = fptosi float %8 to i32
%10 = srem i32 %7, %9
%11 = sitofp i32 %10 to float
store float %11, float* %5
%12 = load float, float* %5
%13 = fcmp ogt float %12, 0x416312CFE0000000
br i1 %13, label %17, label %14
14: ; preds = %2
%15 = load float, float* %5
%16 = fcmp olt float %15, 0xC16312CFE0000000
br i1 %16, label %17, label %21
17: ; preds = %14, %2
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %14
%22 = load float, float* %5
ret float %22
}

LLVM IR (-O2):
@.str = [8 x i8] c"ERROR 5\00"
define float @mod(float %0, float %1) {
%3 = fptosi float %0 to i32
%4 = fptosi float %1 to i32
%5 = srem i32 %3, %4
%6 = add i32 %5, -10000000
%7 = icmp ult i32 %6, -19999999
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 @exit(i32 0)
unreachable
12: ; preds = %2
%13 = sitofp i32 %5 to float
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int nice(int incr) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<nice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nice>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @nice(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @nice(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
int pasc_position(int row, int column) {
  if (column == 0)
    return 1;
  if (row == 0)
    return 0;
  return pasc_position(row - 1, column - 1) + pasc_position(row - 1, column);
}


x86 assembly (clang, -O0):
<pasc_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <pasc_position+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1176 <pasc_position+0x66>
cmpl   $0x0,-0x8(%rbp)
jne    114a <pasc_position+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1176 <pasc_position+0x66>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <pasc_position@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
call   1030 <pasc_position@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pasc_position>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <pasc_position+0x33>
mov    %edi,%ebp
test   %edi,%edi
je     114a <pasc_position+0x3a>
mov    %esi,%r14d
add    $0xffffffff,%r14d
add    $0xffffffff,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <pasc_position@plt>
add    %eax,%ebx
add    $0xffffffff,%ebp
jb     1130 <pasc_position+0x20>
jmp    114c <pasc_position+0x3c>
mov    $0x1,%ebx
jmp    114c <pasc_position+0x3c>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pasc_position(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* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %24
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 0, i32* %3
br label %24
13: ; preds = %9
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = load i32, i32* %5
%17 = sub nsw i32 %16, 1
%18 = call i32 @pasc_position(i32 %15, i32 %17)
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = load i32, i32* %5
%22 = call i32 @pasc_position(i32 %20, i32 %21)
%23 = add nsw i32 %18, %22
store i32 %23, i32* %3
br label %24
24: ; preds = %13, %12, %8
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @pasc_position(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = icmp eq i32 %0, 0
br i1 %6, label %14, label %7
7: ; preds = %4, %7
%8 = phi i32 [ %12, %7 ], [ 0, %4 ]
%9 = phi i32 [ %10, %7 ], [ %0, %4 ]
%10 = add nsw i32 %9, -1
%11 = tail call i32 @pasc_position(i32 %10, i32 %5)
%12 = add nsw i32 %11, %8
%13 = icmp eq i32 %10, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %4, %2
%15 = phi i32 [ 1, %2 ], [ 0, %4 ], [ %12, %7 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ FreePool(int);
void FreePools() {
  int i;
  for (i = 0; i < 10; i++)
    FreePool(i);
}


x86 assembly (clang, -O0):
<FreePools>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    113f <FreePools+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <FreePool@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <FreePools+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreePools>:
push   %rax
xor    %edi,%edi
call   1030 <FreePool@plt>
mov    $0x1,%edi
call   1030 <FreePool@plt>
mov    $0x2,%edi
call   1030 <FreePool@plt>
mov    $0x3,%edi
call   1030 <FreePool@plt>
mov    $0x4,%edi
call   1030 <FreePool@plt>
mov    $0x5,%edi
call   1030 <FreePool@plt>
mov    $0x6,%edi
call   1030 <FreePool@plt>
mov    $0x7,%edi
call   1030 <FreePool@plt>
mov    $0x8,%edi
call   1030 <FreePool@plt>
mov    $0x9,%edi
pop    %rax
jmp    1030 <FreePool@plt>

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

LLVM IR (-O2):
define void @FreePools() {
%1 = tail call i32 @FreePool(i32 0)
%2 = tail call i32 @FreePool(i32 1)
%3 = tail call i32 @FreePool(i32 2)
%4 = tail call i32 @FreePool(i32 3)
%5 = tail call i32 @FreePool(i32 4)
%6 = tail call i32 @FreePool(i32 5)
%7 = tail call i32 @FreePool(i32 6)
%8 = tail call i32 @FreePool(i32 7)
%9 = tail call i32 @FreePool(i32 8)
%10 = tail call i32 @FreePool(i32 9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ Nokia5110_OutChar(int);
int fputc(int ch, FILE *f) {
  Nokia5110_OutChar(ch);
  return 1;
}


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

x86 assembly (clang, -O2):
<fputc>:
push   %rax
call   1030 <Nokia5110_OutChar@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fputc(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 = call i32 @Nokia5110_OutChar(i32 %5)
ret i32 1
}

LLVM IR (-O2):
define i32 @fputc(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 @Nokia5110_OutChar(i32 %0)
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x;
};
struct TYPE_4__ {
  TYPE_1__ xconfigure;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xconfigure_x(void *_p, int _v) {
  ((XEvent *)_p)->xconfigure.x = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xconfigure_x>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xconfigure_x(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xconfigure_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M550_f(char *s) {
  debug("M550_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M550_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M550_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M550_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M550_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M550_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M550_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *gen_timestamp(char *a, time_t b) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @gen_timestamp(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ chatData;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void *recv_c_message(void *arg) {
  char chatData[1024];
  int n;
  int c_socket = (int)arg;
  while (1) {
    memset(chatData, 0, sizeof(chatData));
    if ((n = read(c_socket, chatData, sizeof(chatData))) > 0) {
      write(1, chatData, n);
    }
  }
}


x86 assembly (clang, -O0):
<recv_c_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
mov    -0x418(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
call   1050 <read@plt>
mov    %eax,-0x414(%rbp)
cmp    $0x0,%eax
jle    1199 <recv_c_message+0x69>
lea    -0x410(%rbp),%rsi
mov    -0x414(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
jmp    1149 <recv_c_message+0x19>

x86 assembly (clang, -O2):
<recv_c_message>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1050 <read@plt>
test   %eax,%eax
jle    1140 <recv_c_message+0x10>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
jmp    1140 <recv_c_message+0x10>

LLVM IR (-O0):
define i8* @recv_c_message(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i32
store i32 %7, i32* %5
br label %8
8: ; preds = %1, %19
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%10 = call i32 @memset(i8* %9, i32 0, i32 1024)
%11 = load i32, i32* %5
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%13 = call i32 @read(i32 %11, i8* %12, i32 1024)
store i32 %13, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %8
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%17 = load i32, i32* %4
%18 = call i32 @write(i32 1, i8* %16, i32 %17)
br label %19
19: ; preds = %15, %8
br label %8
}

LLVM IR (-O2):
define noalias i8* @recv_c_message(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %12, %1
%7 = call i32 @memset(i8* %3, i32 0, i32 1024)
%8 = call i32 @read(i32 %5, i8* %3, i32 1024)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @write(i32 1, i8* %3, i32 %8)
br label %12
12: ; preds = %10, %6
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ shandler(int);
int s1handler() { shandler(1); }


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

x86 assembly (clang, -O2):
<s1handler>:
mov    $0x1,%edi
jmp    1030 <shandler@plt>

LLVM IR (-O0):
define i32 @s1handler() {
%1 = alloca i32
%2 = call i32 @shandler(i32 1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @s1handler() {
%1 = tail call i32 @shandler(i32 1)
ret i32 undef
}
void kvmppc_enable_clear_ref_mod_hcalls(void) {}


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

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

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

LLVM IR (-O2):
define void @kvmppc_enable_clear_ref_mod_hcalls() {
ret void
}
/* Variables and functions */
int rand();
int get_rand_level(void) { return 0 + rand() % (3 - 0 + 1); }


x86 assembly (clang, -O0):
<get_rand_level>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand_level>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_rand_level() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 4
%3 = add nsw i32 0, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_rand_level() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 4
ret i32 %2
}
void platform_deinit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @platform_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
void *__malloc0(size_t);
int /*<<< orphan*/ errno;
void *calloc(size_t m, size_t n) {
  if (n && m > (size_t)-1 / n) {
    errno = ENOMEM;
    return 0;
  }
  return __malloc0(n * m);
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1171 <calloc+0x61>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jbe    1171 <calloc+0x61>
mov    0x2e87(%rip),%rax
mov    (%rax),%ecx
mov    0x2e76(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1183 <calloc+0x73>
mov    -0x18(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1030 <__malloc0@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
test   %rsi,%rsi
je     1132 <calloc+0x22>
mov    %rsi,%rax
mul    %rdi
jno    1132 <calloc+0x22>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
mov    0x2eab(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret
imul   %rdi,%rsi
mov    %rsi,%rdi
jmp    1030 <__malloc0@plt>

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = udiv i64 -1, %10
%12 = icmp ugt i64 %9, %11
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i32, i32* @ENOMEM
store i32 %14, i32* @errno
store i8* null, i8** %3
br label %20
15: ; preds = %8, %2
%16 = load i64, i64* %5
%17 = load i64, i64* %4
%18 = mul i64 %16, %17
%19 = call i8* @__malloc0(i64 %18)
store i8* %19, i8** %3
br label %20
20: ; preds = %15, %13
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define i8* @calloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %1, i64 %0)
%6 = extractvalue { i64, i1 } %5, 1
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = load i32, i32* @ENOMEM
store i32 %8, i32* @errno
br label %12
9: ; preds = %4, %2
%10 = mul i64 %1, %0
%11 = tail call i8* @__malloc0(i64 %10)
br label %12
12: ; preds = %9, %7
%13 = phi i8* [ null, %7 ], [ %11, %9 ]
ret i8* %13
}
/* Variables and functions */
int glutGetWindow();
int /*<<< orphan*/ printf(char *, int, int);
void entry(int state) {
  int win = glutGetWindow();
  printf("Win: %d, state: %d\n", win, state);
}


x86 assembly (clang, -O0):
<entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <glutGetWindow@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entry>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <glutGetWindow@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Win: %d, state: %d\0A\00"
define void @entry(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @glutGetWindow()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Win: %d, state: %d\0A\00"
define void @entry(i32 %0) {
%2 = tail call i32 (...) @glutGetWindow()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(int *, int *);
void __attribute__((noipa)) f(int *a, int *b) {
  for (int i = 0; i < 1024; ++i)
    g(a + i, b + i);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1165 <f+0x55>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
call   1030 <g@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <f+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   (%rax)
lea    (%r15,%rbx,1),%rdi
lea    (%r14,%rbx,1),%rsi
call   1030 <g@plt>
add    $0x4,%rbx
cmp    $0x1000,%rbx
jne    1120 <f+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @f(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 1024
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load i32*, i32** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = call i32 @g(i32* %13, i32* %17)
br label %19
19: ; preds = %9
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @f(i32* %0, i32* %1) {
br label %4
3: ; preds = %4
ret void
4: ; preds = %2, %4
%5 = phi i64 [ 0, %2 ], [ %9, %4 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = getelementptr inbounds i32, i32* %1, i64 %5
%8 = tail call i32 @g(i32* %6, i32* %7)
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, 1024
br i1 %10, label %3, label %4
}
int func2(int limit) {
  int i;
  i = 0;
  do {
    i = i + 1;
  } while (i < limit);
  i = 0;
  while (i < 2 * limit) {
    i = i + 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     110e <func2+0xe>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    1149 <func2+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112a <func2+0x2a>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
lea    (%rdi,%rdi,1),%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @func2(i32 %0) {
%2 = shl i32 %0, 1
%3 = call i32 @llvm.smax.i32(i32 %2, i32 0)
ret i32 %3
}
void gtk_widget_region_intersect() {}


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

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

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

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

/* Variables and functions */
uint8_t findfirstbitset(uint8_t x) {
  if (x == 0) {
    return 0;
  }
  uint8_t i = 1, pos = 1;
  while (!(i & x)) {
    i = i << 1;
    ++pos;
  }
  return pos;
}


x86 assembly (clang, -O0):
<findfirstbitset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <findfirstbitset+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1163 <findfirstbitset+0x63>
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1146 <findfirstbitset+0x46>
jmp    115d <findfirstbitset+0x5d>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <findfirstbitset+0x2b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findfirstbitset>:
test   %edi,%edi
je     112a <findfirstbitset+0x2a>
mov    $0x1,%eax
test   $0x1,%dil
jne    1129 <findfirstbitset+0x29>
mov    $0x1,%eax
mov    $0x1,%ecx
nopl   0x0(%rax)
add    %ecx,%ecx
add    $0x1,%eax
test   %edi,%ecx
je     1120 <findfirstbitset+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @findfirstbitset(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i32 [ %9, %6 ], [ 1, %3 ]
%9 = shl i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i32 %9, %0
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Type definitions */
struct assoc_array {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assoc_free(struct assoc_array *);
int /*<<< orphan*/ read_config(int /*<<< orphan*/ *);
void free_config(struct assoc_array *array) {
  assoc_free(array);
  read_config(NULL);
}


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

x86 assembly (clang, -O2):
<free_config>:
push   %rax
call   1030 <assoc_free@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <read_config@plt>

LLVM IR (-O0):
%struct.assoc_array = type { i32 }
define void @free_config(%struct.assoc_array* %0) {
%2 = alloca %struct.assoc_array*
store %struct.assoc_array* %0, %struct.assoc_array** %2
%3 = load %struct.assoc_array*, %struct.assoc_array** %2
%4 = call i32 @assoc_free(%struct.assoc_array* %3)
%5 = call i32 @read_config(i32* null)
ret void
}

LLVM IR (-O2):
%struct.assoc_array = type { i32 }
define void @free_config(%struct.assoc_array* %0) {
%2 = tail call i32 @assoc_free(%struct.assoc_array* %0)
%3 = tail call i32 @read_config(i32* null)
ret void
}
double muli(double a, double b, double c, double d) { return a * d + b * c; }


x86 assembly (clang, -O0):
<muli>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<muli>:
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @muli(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %8
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = call double @llvm.fmuladd.f64(double %9, double %10, double %13)
ret double %14
}

LLVM IR (-O2):
define double @muli(double %0, double %1, double %2, double %3) {
%5 = fmul double %1, %2
%6 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %5)
ret double %6
}
void putbuf(char c, void *context) {
  char *buf = *((char **)context);
  *buf++ = c;
  *((char **)context) = buf;
}


x86 assembly (clang, -O0):
<putbuf>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putbuf>:
mov    (%rsi),%rax
mov    %dil,(%rax)
add    $0x1,%rax
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @putbuf(i8 signext %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %0, i8* %4
store i8* %5, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ native_io_delay();
__attribute__((always_)) void slow_down_io(void) { native_io_delay(); }


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

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

LLVM IR (-O0):
define void @slow_down_io() {
%1 = call i32 (...) @native_io_delay()
ret void
}

LLVM IR (-O2):
define void @slow_down_io() {
%1 = tail call i32 (...) @native_io_delay()
ret void
}