xunge/DecIR huggingface dataset:
/* Type definitions */
struct Cyc_Port_Cenv {
  int dummy;
};
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Port_gen_exp(int /*<<< orphan*/, struct Cyc_Port_Cenv *,
                                    struct Cyc_Absyn_Exp *);
void *Cyc_Port_gen_exp_false(struct Cyc_Port_Cenv *env,
                             struct Cyc_Absyn_Exp *e) {
  return ({ Cyc_Port_gen_exp(0, env, e); });
}


x86 assembly (clang, -O0):
<Cyc_Port_gen_exp_false>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1030 <Cyc_Port_gen_exp@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Port_gen_exp_false>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
call   1030 <Cyc_Port_gen_exp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_Port_Cenv = type { i32 }
%struct.Cyc_Absyn_Exp = type { i32 }
define i8* @Cyc_Port_gen_exp_false(%struct.Cyc_Port_Cenv* %0, %struct.Cyc_Absyn_Exp* %1) {
%3 = alloca %struct.Cyc_Port_Cenv*
%4 = alloca %struct.Cyc_Absyn_Exp*
%5 = alloca i32
store %struct.Cyc_Port_Cenv* %0, %struct.Cyc_Port_Cenv** %3
store %struct.Cyc_Absyn_Exp* %1, %struct.Cyc_Absyn_Exp** %4
%6 = load %struct.Cyc_Port_Cenv*, %struct.Cyc_Port_Cenv** %3
%7 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %4
%8 = call i32 @Cyc_Port_gen_exp(i32 0, %struct.Cyc_Port_Cenv* %6, %struct.Cyc_Absyn_Exp* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
%struct.Cyc_Port_Cenv = type { i32 }
%struct.Cyc_Absyn_Exp = type { i32 }
define i8* @Cyc_Port_gen_exp_false(%struct.Cyc_Port_Cenv* %0, %struct.Cyc_Absyn_Exp* %1) {
%3 = tail call i32 @Cyc_Port_gen_exp(i32 0, %struct.Cyc_Port_Cenv* %0, %struct.Cyc_Absyn_Exp* %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_ListPresets(void *, char *);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPRenderingControl_ListPresets(void *upnptoken,
                                      unsigned int InstanceID) {
  printf("Invoke: UPnPRenderingControl_ListPresets(%u);\r\n", InstanceID);
  UPnPResponse_RenderingControl_ListPresets(upnptoken, "Sample String");
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_ListPresets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xee7(%rip),%rsi
call   1040 <UPnPResponse_RenderingControl_ListPresets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_ListPresets>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef9(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UPnPResponse_RenderingControl_ListPresets@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Invoke: UPnPRenderingControl_ListPresets(%u);\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UPnPRenderingControl_ListPresets(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 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_RenderingControl_ListPresets(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Invoke: UPnPRenderingControl_ListPresets(%u);\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UPnPRenderingControl_ListPresets(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_RenderingControl_ListPresets(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ opl_timer_over(int /*<<< orphan*/, int);
void opl_timer_callback01(void *p) { opl_timer_over(0, 1); }


x86 assembly (clang, -O0):
<opl_timer_callback01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <opl_timer_over@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opl_timer_callback01>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <opl_timer_over@plt>

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

LLVM IR (-O2):
define void @opl_timer_callback01(i8* nocapture readnone %0) {
%2 = tail call i32 @opl_timer_over(i32 0, i32 1)
ret void
}
/* Variables and functions */
int test();
int main(void) {
  int answer;
  answer = test();
  return answer;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
ret i32 %1
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_insert_item(struct list *, struct list *);
void list_insert(struct list **head, struct list *self) {
  if (*head)
    list_insert_item(*head, self);
  *head = self;
}


x86 assembly (clang, -O0):
<list_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     113e <list_insert+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <list_insert_item@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_insert>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112a <list_insert+0x1a>
mov    %r14,%rsi
call   1030 <list_insert_item@plt>
mov    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_insert(%struct.list** %0, %struct.list* %1) {
%3 = alloca %struct.list**
%4 = alloca %struct.list*
store %struct.list** %0, %struct.list*** %3
store %struct.list* %1, %struct.list** %4
%5 = load %struct.list**, %struct.list*** %3
%6 = load %struct.list*, %struct.list** %5
%7 = icmp ne %struct.list* %6, null
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load %struct.list**, %struct.list*** %3
%10 = load %struct.list*, %struct.list** %9
%11 = load %struct.list*, %struct.list** %4
%12 = call i32 @list_insert_item(%struct.list* %10, %struct.list* %11)
br label %13
13: ; preds = %8, %2
%14 = load %struct.list*, %struct.list** %4
%15 = load %struct.list**, %struct.list*** %3
store %struct.list* %14, %struct.list** %15
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_insert(%struct.list** nocapture %0, %struct.list* %1) {
%3 = load %struct.list*, %struct.list** %0
%4 = icmp eq %struct.list* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @list_insert_item(%struct.list* %3, %struct.list* %1)
br label %7
7: ; preds = %5, %2
store %struct.list* %1, %struct.list** %0
ret void
}
void foo_2_2_2_2_2_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_2_1_2_2_1() {
ret void
}
int f2(enum {AA = 7, BB} E) { return AA; }


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

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

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

LLVM IR (-O2):
define i32 @f2(i32 %0) {
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ grecs_free_fun(void *);
void grecs_free(void *ptr) { grecs_free_fun(ptr); }


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

x86 assembly (clang, -O2):
<grecs_free>:
jmp    1030 <grecs_free_fun@plt>

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

LLVM IR (-O2):
define void @grecs_free(i8* %0) {
%2 = tail call i32 @grecs_free_fun(i8* %0)
ret void
}
/* Type definitions */
struct expr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ isspace(char const);
int find_string(const char *remain, struct expr *e) {
  return !isspace(*remain);
}


x86 assembly (clang, -O0):
<find_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_string>:
push   %rax
movsbl (%rdi),%edi
call   1030 <isspace@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.expr = type { i32 }
define i32 @find_string(i8* %0, %struct.expr* %1) {
%3 = alloca i8*
%4 = alloca %struct.expr*
store i8* %0, i8** %3
store %struct.expr* %1, %struct.expr** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = call i32 @isspace(i8 signext %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.expr = type { i32 }
define i32 @find_string(i8* nocapture %0, %struct.expr* nocapture readnone %1) {
%3 = load i8, i8* %0
%4 = tail call i32 @isspace(i8 signext %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
long double f(long double x) { return 4.0L / (1.0L + x * x); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fmul   %st,%st(0)
fld1
faddp  %st,%st(1)
flds   0xee7(%rip)
fdivp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
fldt   0x8(%rsp)
fmul   %st,%st(0)
fld1
faddp  %st,%st(1)
fdivrs 0xef0(%rip)
ret

LLVM IR (-O0):
define x86_fp80 @f(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %3, x86_fp80 %4, x86_fp80 0xK3FFF8000000000000000)
%6 = fdiv x86_fp80 0xK40018000000000000000, %5
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @f(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %0, x86_fp80 %0, x86_fp80 0xK3FFF8000000000000000)
%3 = fdiv x86_fp80 0xK40018000000000000000, %2
ret x86_fp80 %3
}
double f(double g) { return g / 3; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 3.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fdiv double %0, 3.000000e+00
ret double %2
}
int pathconN_nm9_n_in(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @pathconN_nm9_n_in() {
ret i32 1
}

LLVM IR (-O2):
define i32 @pathconN_nm9_n_in() {
ret i32 1
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int clamp_s16(int);
void sample_mix(int16_t *dst, int16_t src, int16_t gain) {
  *dst = clamp_s16(*dst + ((src * gain) >> 15));
}


x86 assembly (clang, -O0):
<sample_mix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
sar    $0xf,%eax
add    %eax,%edi
call   1030 <clamp_s16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_mix>:
push   %rbx
mov    %rdi,%rbx
imul   %edx,%esi
sar    $0xf,%esi
add    (%rdi),%esi
mov    %esi,%edi
call   1030 <clamp_s16@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sample_mix(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
%12 = ashr i32 %11, 15
%13 = add nsw i32 %8, %12
%14 = call i32 @clamp_s16(i32 %13)
%15 = load i32*, i32** %4
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @sample_mix(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = mul nsw i32 %2, %1
%6 = ashr i32 %5, 15
%7 = add nsw i32 %4, %6
%8 = tail call i32 @clamp_s16(i32 %7)
store i32 %8, i32* %0
ret void
}
void sys_init_memory(void) {}


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

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

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

LLVM IR (-O2):
define void @sys_init_memory() {
ret void
}
/* Variables and functions */
double atof(char *);
int getfield(int, char *, char *, int, char);
int getflddbl(int fldno, char *str, double *dst, char sep) {
  char tmp[21];
  int ret;
  *dst = 0;
  ret = getfield(fldno, str, tmp, 20, sep);
  if (ret)
    *dst = atof(tmp);
  return (ret);
}


x86 assembly (clang, -O0):
<getflddbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %cl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x14,%ecx
movsbl -0x19(%rbp),%r8d
call   1030 <getfield@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     117b <getflddbl+0x5b>
lea    -0x30(%rbp),%rdi
call   1040 <atof@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getflddbl>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r8d
mov    %rdx,%rbx
movq   $0x0,(%rdx)
mov    %rsp,%rdx
mov    $0x14,%ecx
call   1030 <getfield@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1152 <getflddbl+0x32>
mov    %rsp,%rdi
call   1040 <atof@plt>
movsd  %xmm0,(%rbx)
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getflddbl(i32 %0, i8* %1, double* %2, i8 signext %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca double*
%8 = alloca i8
%9 = alloca [21 x i8]
%10 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store double* %2, double** %7
store i8 %3, i8* %8
%11 = load double*, double** %7
store double 0.000000e+00, double* %11
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%15 = load i8, i8* %8
%16 = call i32 @getfield(i32 %12, i8* %13, i8* %14, i32 20, i8 signext %15)
store i32 %16, i32* %10
%17 = load i32, i32* %10
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %4
%20 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%21 = call double @atof(i8* %20)
%22 = load double*, double** %7
store double %21, double* %22
br label %23
23: ; preds = %19, %4
%24 = load i32, i32* %10
ret i32 %24
}

LLVM IR (-O2):
define i32 @getflddbl(i32 %0, i8* %1, double* nocapture writeonly %2, i8 signext %3) {
%5 = alloca [21 x i8]
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %5, i64 0, i64 0
store double 0.000000e+00, double* %2
%7 = call i32 @getfield(i32 %0, i8* %1, i8* %6, i32 20, i8 signext %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = call double @atof(i8* %6)
store double %10, double* %2
br label %11
11: ; preds = %9, %4
ret i32 %7
}
void e_testFunc() { extern int e_i; }


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

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

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

LLVM IR (-O2):
define void @e_testFunc() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *fftw_malloc(size_t n) {
  void *p;
  p = malloc(n);
  return p;
}


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

x86 assembly (clang, -O2):
<fftw_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @fftw_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void PWM1Generator2_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<PWM1Generator2_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <PWM1Generator2_Handler+0x9>
jmp    1109 <PWM1Generator2_Handler+0x9>

x86 assembly (clang, -O2):
<PWM1Generator2_Handler>:
jmp    1100 <PWM1Generator2_Handler>

LLVM IR (-O0):
define void @PWM1Generator2_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @PWM1Generator2_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ test_sort(int);
int main() {
  int i = 0;
  for (i = 16; i <= 1024; i *= 2) {
    test_sort(i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x10,-0x8(%rbp)
cmpl   $0x400,-0x8(%rbp)
jg     1150 <main+0x40>
mov    -0x8(%rbp),%edi
call   1030 <test_sort@plt>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x10,%edi
call   1030 <test_sort@plt>
mov    $0x20,%edi
call   1030 <test_sort@plt>
mov    $0x40,%edi
call   1030 <test_sort@plt>
mov    $0x80,%edi
call   1030 <test_sort@plt>
mov    $0x100,%edi
call   1030 <test_sort@plt>
mov    $0x200,%edi
call   1030 <test_sort@plt>
mov    $0x400,%edi
call   1030 <test_sort@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 16, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 1024
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @test_sort(i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, 2
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_sort(i32 16)
%2 = tail call i32 @test_sort(i32 32)
%3 = tail call i32 @test_sort(i32 64)
%4 = tail call i32 @test_sort(i32 128)
%5 = tail call i32 @test_sort(i32 256)
%6 = tail call i32 @test_sort(i32 512)
%7 = tail call i32 @test_sort(i32 1024)
ret i32 0
}
void sd_zbc_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @sd_zbc_exit() {
ret void
}
void do_rmdir(argc, argv) char **argv;
{
  while (argc-- > 1) {
    if (rmdir(argv[1]) < 0)
      perror(argv[1]);
    argv++;
  }
}


x86 assembly (clang, -O0):
<do_rmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x1,%eax
jle    117b <do_rmdir+0x5b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1030 <rmdir@plt>
cmp    $0x0,%eax
jge    116a <do_rmdir+0x4a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1040 <perror@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <do_rmdir+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_rmdir>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1166 <do_rmdir+0x46>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
add    $0x8,%rbx
jmp    114c <do_rmdir+0x2c>
cs nopw 0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
add    $0x8,%rbx
cmp    $0x2,%ebp
jbe    1166 <do_rmdir+0x46>
mov    (%rbx),%rdi
xor    %eax,%eax
call   1030 <rmdir@plt>
test   %eax,%eax
jns    1140 <do_rmdir+0x20>
mov    (%rbx),%rdi
xor    %eax,%eax
call   1040 <perror@plt>
jmp    1140 <do_rmdir+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @do_rmdir(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %17
4: ; preds = %2, %15
%5 = phi i32 [ %7, %15 ], [ %0, %2 ]
%6 = phi i8** [ %8, %15 ], [ %1, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @rmdir to i32 (i8*, ...)*)(i8* %9)
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i8*, i8** %8
%14 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %13)
br label %15
15: ; preds = %12, %4
%16 = icmp ugt i32 %5, 2
br i1 %16, label %4, label %17
17: ; preds = %15, %2
ret void
}
/* Variables and functions */
int chmod(char *, int /*<<< orphan*/);
int bad_chmod(void *addr) { return chmod((char *)addr, 0); }


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

x86 assembly (clang, -O2):
<bad_chmod>:
xor    %esi,%esi
jmp    1030 <chmod@plt>

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

LLVM IR (-O2):
define i32 @bad_chmod(i8* nocapture %0) {
%2 = tail call i32 @chmod(i8* %0, i32 0)
ret i32 %2
}
void usb_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @usb_iomux_config() {
ret void
}
/* Type definitions */
struct iam_container {
  int dummy;
};
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
__u32 iam_lfix_root_ptr(struct iam_container *c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iam_container = type { i32 }
define i32 @iam_lfix_root_ptr(%struct.iam_container* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int /*<<< orphan*/ strncpy(char *, char const *, long);
void safe_strcpy(char *out, long outlen, const char *in, long inlen) {
  if (inlen >= (outlen - 1)) {
    strncpy(out, in, outlen - 1);
    out[outlen - 1] = 0;
  } else {
    strcpy(out, in);
  }
}


x86 assembly (clang, -O0):
<safe_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jl     1177 <safe_strcpy+0x57>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1184 <safe_strcpy+0x64>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0xffffffffffffffff,%rbx
cmp    %rcx,%rbx
jle    1145 <safe_strcpy+0x25>
mov    %r14,%rdi
mov    %rdx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcpy@plt>
mov    %r14,%rdi
mov    %rdx,%rsi
mov    %rbx,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @safe_strcpy(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = add nsw i64 %1, -1
%6 = icmp sgt i64 %5, %3
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 @strncpy(i8* %0, i8* %2, i64 %5)
%9 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %9
br label %12
10: ; preds = %4
%11 = tail call i32 @strcpy(i8* %0, i8* %2)
br label %12
12: ; preds = %10, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  int n;
  assume(x == 0 && n > 0);
  while (x < n) {
    x++;
  }
  assert(x == n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jne    1148 <main+0x28>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116f <main+0x4f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <main+0x35>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assume@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br label %9
9: ; preds = %6, %0
%10 = phi i1 [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = call i32 @assume(i32 %11)
br label %13
13: ; preds = %17, %9
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %13
20: ; preds = %13
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = icmp eq i32 %21, %22
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int w_str_equal_case(const void *s1, const void *s2) {
  return strcasecmp((const char *)s1, (const char *)s2);
}


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

x86 assembly (clang, -O2):
<w_str_equal_case>:
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @w_str_equal_case(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcasecmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @w_str_equal_case(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ toc_close();
void serv_close() { toc_close(); }


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

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

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

LLVM IR (-O2):
define void @serv_close() {
%1 = tail call i32 (...) @toc_close()
ret void
}
int isCPUIDSupported() {
  int supported = 2;
  asm("pushfq\n\t"
      "popq   %%rax\n\t"
      "movq   %%rax, %%rcx\n\t"
      "xorq   $0x200000, %%rax\n\t"
      "pushq  %%rax\n\t"
      "popfq\n\t"
      "pushfq\n\t"
      "popq   %%rax\n\t"
      "xorl   %%ecx, %%eax\n\t"
      "movl   %%eax, %0\n\t"
      : "=r"(supported)::"eax", "ecx");
  return supported != 0;
}


x86 assembly (clang, -O0):
<isCPUIDSupported>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
pushf
pop    %rax
mov    %rax,%rcx
xor    $0x200000,%rax
push   %rax
popf
pushf
pop    %rax
xor    %ecx,%eax
mov    %eax,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCPUIDSupported>:
pushf
pop    %rax
mov    %rax,%rcx
xor    $0x200000,%rax
push   %rax
popf
pushf
pop    %rax
xor    %ecx,%eax
mov    %eax,%edx
xor    %eax,%eax
test   %edx,%edx
setne  %al
ret

LLVM IR (-O0):
define i32 @isCPUIDSupported() {
%1 = alloca i32
store i32 2, i32* %1
%2 = call i32 asm "pushfq\0A\09popq %rax\0A\09movq %rax, %rcx\0A\09xorq $$0x200000, %rax\0A\09pushq %rax\0A\09popfq\0A\09pushfq\0A\09popq %rax\0A\09xorl %ecx, %eax\0A\09movl %eax, $0\0A\09", "=r,~{eax},~{ecx},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isCPUIDSupported() {
%1 = tail call i32 asm "pushfq\0A\09popq %rax\0A\09movq %rax, %rcx\0A\09xorq $$0x200000, %rax\0A\09pushq %rax\0A\09popfq\0A\09pushfq\0A\09popq %rax\0A\09xorl %ecx, %eax\0A\09movl %eax, $0\0A\09", "=r,~{eax},~{ecx},~{dirflag},~{fpsr},~{flags}"()
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ handle_GRANT(int /*<<< orphan*/);
int gen_GRANT() {
  handle_GRANT(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_GRANT() {
%1 = call i32 @handle_GRANT(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_GRANT() {
%1 = tail call i32 @handle_GRANT(i32 0)
ret i32 0
}
const char *cmp_to_cstr(int cmp) {
  const char *result;
  if (cmp == 0) {
    result = "is same as";
  } else if (cmp < 0) {
    result = "is older than";
  } else if (cmp > 0) {
    result = "is newer than";
  }
  return result;
}


x86 assembly (clang, -O0):
<cmp_to_cstr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1121 <cmp_to_cstr+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    115a <cmp_to_cstr+0x5a>
cmpl   $0x0,-0x4(%rbp)
jge    113b <cmp_to_cstr+0x3b>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1155 <cmp_to_cstr+0x55>
cmpl   $0x0,-0x4(%rbp)
jle    1150 <cmp_to_cstr+0x50>
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1155 <cmp_to_cstr+0x55>
jmp    115a <cmp_to_cstr+0x5a>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_to_cstr>:
test   %edi,%edi
lea    0xf02(%rip),%rax
lea    0xf09(%rip),%rcx
cmovs  %rax,%rcx
lea    0xee5(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"is same as\00"
@.str.1 = [14 x i8] c"is older than\00"
@.str.2 = [14 x i8] c"is newer than\00"
define i8* @cmp_to_cstr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %3
br label %17
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %16
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %15
15: ; preds = %14, %11
br label %16
16: ; preds = %15, %10
br label %17
17: ; preds = %16, %6
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [11 x i8] c"is same as\00"
@.str.1 = [14 x i8] c"is older than\00"
@.str.2 = [14 x i8] c"is newer than\00"
define i8* @cmp_to_cstr(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = icmp slt i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0)
%5 = select i1 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void recurse(int count) {
  if (count > 5) {
    return;
  }
  recurse(count + 1);
  printf("Count = %d\n", count);
}


x86 assembly (clang, -O0):
<recurse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jle    113a <recurse+0x1a>
jmp    1154 <recurse+0x34>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <recurse@plt>
mov    -0x4(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurse>:
cmp    $0x6,%edi
jl     1126 <recurse+0x6>
ret
push   %rbx
mov    %edi,%ebx
lea    0x1(%rbx),%edi
call   1030 <recurse@plt>
lea    0xec8(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"Count = %d\0A\00"
define void @recurse(i32 %0) {
%2 = icmp sgt i32 %0, 5
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = add nsw i32 %0, 1
tail call void @recurse(i32 %5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_destroy(int /*<<< orphan*/ *);
void sys_mutex_destroy(pthread_mutex_t *mtx) {
  if (mtx != NULL) {
    pthread_mutex_destroy(mtx);
    free(mtx);
  }
}


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

x86 assembly (clang, -O2):
<sys_mutex_destroy>:
test   %rdi,%rdi
je     1137 <sys_mutex_destroy+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <pthread_mutex_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @sys_mutex_destroy(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @pthread_mutex_destroy(i32* %0)
%5 = tail call i32 @free(i32* %0)
br label %6
6: ; preds = %3, %1
ret void
}
int potencia(int base, float exp) {
  int i, r = 1;
  for (i = 0; i < exp; i++) {
    r = r * base;
  }
  return r;
}


x86 assembly (clang, -O0):
<potencia>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1145 <potencia+0x45>
mov    -0x10(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <potencia+0x1a>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<potencia>:
mov    $0x1,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1132 <potencia+0x32>
mov    $0x1,%ecx
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
imul   %edi,%eax
add    $0x1,%ecx
ucomiss %xmm1,%xmm0
ja     1120 <potencia+0x20>
ret

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

LLVM IR (-O2):
define i32 @potencia(i32 %0, float %1) {
%3 = fcmp ogt float %1, 0.000000e+00
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 1, %2 ]
%6 = phi i32 [ %8, %4 ], [ 0, %2 ]
%7 = mul nsw i32 %5, %0
%8 = add nuw nsw i32 %6, 1
%9 = sitofp i32 %8 to float
%10 = fcmp olt float %9, %1
br i1 %10, label %4, label %11
11: ; preds = %4, %2
%12 = phi i32 [ 1, %2 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
size_t ZSTD_decompress(void *, size_t, void const *, size_t);
size_t ZSTDv03_decompress(void *dst, size_t maxOriginalSize, const void *src,
                          size_t compressedSize) {
  return ZSTD_decompress(dst, maxOriginalSize, src, compressedSize);
}


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

x86 assembly (clang, -O2):
<ZSTDv03_decompress>:
jmp    1030 <ZSTD_decompress@plt>

LLVM IR (-O0):
define i64 @ZSTDv03_decompress(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i64 @ZSTD_decompress(i8* %9, i64 %10, i8* %11, i64 %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @ZSTDv03_decompress(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i64 @ZSTD_decompress(i8* %0, i64 %1, i8* %2, i64 %3)
ret i64 %5
}
double valeur_absolue(double a) {
  if (a > 0) {
    return a;
  } else {
    return -a;
  }
}


x86 assembly (clang, -O0):
<valeur_absolue>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <valeur_absolue+0x2a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114b <valeur_absolue+0x4b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<valeur_absolue>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @valeur_absolue(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %3
store double %7, double* %2
br label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = fneg double %9
store double %10, double* %2
br label %11
11: ; preds = %8, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @valeur_absolue(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int sum(int);
int main() {
  int num, add;
  printf("Enter a positive integer:\n");
  scanf("%d", &num);
  add = sum(num);
  printf("sum=%d", add);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <sum@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <sum@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter a positive integer:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"sum=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @sum(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"sum=%d\00"
@str = [26 x i8] c"Enter a positive integer:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @sum(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned char request_code;
};
typedef TYPE_1__ XErrorEvent;

/* Variables and functions */
void set_XErrorEvent_request_code(void *_p, unsigned char _v) {
  ((XErrorEvent *)_p)->request_code = (unsigned char)_v;
}


x86 assembly (clang, -O0):
<set_XErrorEvent_request_code>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XErrorEvent_request_code>:
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XErrorEvent_request_code(i8* nocapture writeonly %0, i8 zeroext %1) {
store i8 %1, i8* %0
ret void
}
/* Variables and functions */
char *escape_string_internal(char *, int /*<<< orphan*/);
char *escape_string(char *s) { return escape_string_internal(s, 0); }


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

x86 assembly (clang, -O2):
<escape_string>:
xor    %esi,%esi
jmp    1030 <escape_string_internal@plt>

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

LLVM IR (-O2):
define i8* @escape_string(i8* %0) {
%2 = tail call i8* @escape_string_internal(i8* %0, i32 0)
ret i8* %2
}