xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memmove(int *, int *, unsigned int const);
void swip(int *data, const unsigned int i, const unsigned int j) {
  int tmp = data[j];
  memmove(data + i + 1, data + i, (j - i) * sizeof(int));
  data[i] = tmp;
}


x86 assembly (clang, -O0):
<swip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
shl    $0x2,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,%eax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swip>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    %edx,%eax
mov    (%rdi,%rax,4),%r14d
mov    %esi,%ebp
lea    (%rdi,%rbp,4),%rax
lea    (%rdi,%rbp,4),%rdi
add    $0x4,%rdi
sub    %esi,%edx
shl    $0x2,%edx
mov    %rax,%rsi
call   1030 <memmove@plt>
mov    %r14d,(%rbx,%rbp,4)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @swip(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %6
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = sub i32 %22, %23
%25 = zext i32 %24 to i64
%26 = mul i64 %25, 4
%27 = trunc i64 %26 to i32
%28 = call i32 @memmove(i32* %17, i32* %21, i32 %27)
%29 = load i32, i32* %7
%30 = load i32*, i32** %4
%31 = load i32, i32* %5
%32 = zext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %30, i64 %32
store i32 %29, i32* %33
ret void
}

LLVM IR (-O2):
define void @swip(i32* %0, i32 %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = zext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = sub i32 %2, %1
%11 = shl i32 %10, 2
%12 = tail call i32 @memmove(i32* %9, i32* %8, i32 %11)
store i32 %6, i32* %8
ret void
}
void _start(unsigned int *info) {}


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

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

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

LLVM IR (-O2):
define void @_start(i32* nocapture %0) {
ret void
}
void VP8EncDspInitMSA(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8EncDspInitMSA() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compute(int);
int example_set_var4(int *array, int array_size) {
  compute(10);
  return 0;
}


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

x86 assembly (clang, -O2):
<example_set_var4>:
push   %rax
mov    $0xa,%edi
call   1030 <compute@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @example_set_var4(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @compute(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @example_set_var4(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @compute(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clrscr();
int /*<<< orphan*/ print(char *);
void kmain() {
  clrscr();
  char banner[] = {'C', 'l', 'e', 'e', 's', 'e', ' ', '2', '0', '0', '8', '\0'};
  print(banner);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clrscr@plt>
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <print@plt>
jmp    114c <kmain+0x2c>

x86 assembly (clang, -O2):
<kmain>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <clrscr@plt>
movabs $0x3220657365656c43,%rax
65 20 32
mov    %rax,0x8(%rsp)
movl   $0x383030,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <print@plt>
nopl   0x0(%rax)
jmp    1150 <kmain+0x30>

LLVM IR (-O0):
@__const.kmain.banner = [12 x i8] c"Cleese 2008\00"
define void @kmain() {
%1 = alloca [12 x i8]
%2 = call i32 (...) @clrscr()
%3 = bitcast [12 x i8]* %1 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%5 = call i32 @print(i8* %4)
br label %6
6: ; preds = %6, %0
br label %6
}

LLVM IR (-O2):
@__const.kmain.banner = [12 x i8] c"Cleese 2008\00"
define void @kmain() {
%1 = alloca [12 x i8]
%2 = tail call i32 (...) @clrscr()
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = call i32 @print(i8* %3)
br label %5
5: ; preds = %5, %0
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ send_str(int, char *);
void send_successful(int socket, int success_code) {
  if (success_code == 200) {
    send_str(socket, "HTTP/1.0 200 OK\r\n");
  }
}


x86 assembly (clang, -O0):
<send_successful>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jne    113a <send_successful+0x2a>
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1030 <send_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_successful>:
cmp    $0xc8,%esi
jne    1124 <send_successful+0x14>
lea    0xee1(%rip),%rsi
jmp    1030 <send_str@plt>
ret

LLVM IR (-O0):
@.str = [18 x i8] c"HTTP/1.0 200 OK\0D\0A\00"
define void @send_successful(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 200
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @send_str(i32 %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"HTTP/1.0 200 OK\0D\0A\00"
define void @send_successful(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 200
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @send_str(i32 %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
ret void
}
void b_impl(struct a *const this) {}


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

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

LLVM IR (-O0):
%struct.a = type opaque
define void @b_impl(%struct.a* %0) {
%2 = alloca %struct.a*
store %struct.a* %0, %struct.a** %2
ret void
}

LLVM IR (-O2):
%struct.a = type opaque
define void @b_impl(%struct.a* nocapture %0) {
ret void
}
double min1(double a, double b, double c) {
  if (a > b)
    a = b;
  if (a > c)
    a = c;
  return a;
}


x86 assembly (clang, -O0):
<min1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <min1+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1147 <min1+0x47>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min1>:
minsd  %xmm0,%xmm1
minsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @min1(double %0, double %1, double %2) {
%4 = fcmp ogt double %0, %1
%5 = select i1 %4, double %1, double %0
%6 = fcmp ogt double %5, %2
%7 = select i1 %6, double %2, double %5
ret double %7
}
int do_502() { return 502; }


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

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

LLVM IR (-O0):
define i32 @do_502() {
ret i32 502
}

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

/* Variables and functions */
int /*<<< orphan*/ m137common_setParams4101(int /*<<< orphan*/,
                                            int /*<<< orphan*/);
int /*<<< orphan*/ m138setChrBankPtr();
void m138setParams4101(uint16_t addr, uint8_t val) {
  m137common_setParams4101(addr, val);
  m138setChrBankPtr();
}


x86 assembly (clang, -O0):
<m138setParams4101>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <m137common_setParams4101@plt>
mov    $0x0,%al
call   1030 <m138setChrBankPtr@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @m138setParams4101(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @m137common_setParams4101(i32 %5, i32 %6)
%8 = call i32 (...) @m138setChrBankPtr()
ret void
}

LLVM IR (-O2):
define void @m138setParams4101(i32 %0, i32 %1) {
%3 = tail call i32 @m137common_setParams4101(i32 %0, i32 %1)
%4 = tail call i32 (...) @m138setChrBankPtr()
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMREE_get(void) { return U_WMRCORENONE_get("U_WMREE"); }


x86 assembly (clang, -O0):
<U_WMREE_get>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <U_WMRCORENONE_get@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMREE\00"
define i32 @U_WMREE_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMREE\00"
define i32 @U_WMREE_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void test46_Test1_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test46_Test1_targetInit__I() {
ret void
}
int setenv(const char *name, const char *value, int override) { return -1; }


x86 assembly (clang, -O0):
<setenv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @setenv(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
int msm_hsusb_phy_reset(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_hsusb_phy_reset() {
ret i32 0
}
int exact_square(int n) {
  int rootInt;
  float rootFloat;
  rootInt = sqrt(n);
  rootFloat = sqrt(n);
  if (rootFloat - rootInt == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    116b <exact_square+0x5b>
jp     116b <exact_square+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1172 <exact_square+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
push   %rbx
sub    $0x10,%rsp
cvtsi2sd %edi,%xmm2
sqrtsd %xmm2,%xmm1
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
movapd %xmm1,%xmm0
jae    114e <exact_square+0x3e>
movapd %xmm2,%xmm0
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,(%rsp)
call   1030 <sqrt@plt>
xorpd  %xmm3,%xmm3
movsd  (%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
cvttsd2si %xmm0,%ebx
ucomisd %xmm3,%xmm2
jae    1165 <exact_square+0x55>
movapd %xmm2,%xmm0
call   1030 <sqrt@plt>
movapd %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %ebx,%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cmpeqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @exact_square(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = call double @sqrt(double %7)
%9 = fptosi double %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to double
%12 = call double @sqrt(double %11)
%13 = fptrunc double %12 to float
store float %13, float* %5
%14 = load float, float* %5
%15 = load i32, i32* %4
%16 = sitofp i32 %15 to float
%17 = fsub float %14, %16
%18 = fcmp oeq float %17, 0.000000e+00
br i1 %18, label %19, label %20
19: ; preds = %1
store i32 1, i32* %2
br label %21
20: ; preds = %1
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @sqrt(double %2)
%4 = fptosi double %3 to i32
%5 = tail call double @sqrt(double %2)
%6 = fptrunc double %5 to float
%7 = sitofp i32 %4 to float
%8 = fsub float %6, %7
%9 = fcmp oeq float %8, 0.000000e+00
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: forth [-d] [files...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: forth [-d] [files...]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [29 x i8] c"Usage: forth [-d] [files...]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int fsync(int);
int /*<<< orphan*/ perror(char *);
void fsync_or_exit(int fd) {
  int result = -1;
  errno = 0;
  result = fsync(fd);
  if (result < 0) {
    perror("Can't fsync");
    exit(10);
  }
}


x86 assembly (clang, -O0):
<fsync_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    0x2e97(%rip),%rax
movq   $0x0,(%rax)
mov    -0x4(%rbp),%edi
call   1030 <fsync@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    117b <fsync_or_exit+0x4b>
lea    0xe94(%rip),%rdi
call   1040 <perror@plt>
mov    $0xa,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsync_or_exit>:
push   %rax
mov    0x2ea8(%rip),%rax
movq   $0x0,(%rax)
call   1030 <fsync@plt>
test   %eax,%eax
js     114a <fsync_or_exit+0x1a>
pop    %rax
ret
lea    0xeaf(%rip),%rdi
call   1040 <perror@plt>
mov    $0xa,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@.str = [12 x i8] c"Can't fsync\00"
define void @fsync_or_exit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
store i64 0, i64* @errno
%4 = load i32, i32* %2
%5 = call i32 @fsync(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 10)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [12 x i8] c"Can't fsync\00"
define void @fsync_or_exit(i32 %0) {
store i64 0, i64* @errno
%2 = tail call i32 @fsync(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 10)
unreachable
7: ; preds = %1
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ serial;
};
struct TYPE_4__ {
  TYPE_1__ xmap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xmap_serial(void *_p) {
  return (unsigned long)((XEvent *)_p)->xmap.serial;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xmap_serial>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @get_XEvent_xmap_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int fc8300_deinit(void *, unsigned short);
int bbm_com_deinit(void *handle, unsigned short devid) {
  int res;
  res = fc8300_deinit(handle, devid);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movzwl -0xa(%rbp),%esi
call   1030 <fc8300_deinit@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_deinit>:
jmp    1030 <fc8300_deinit@plt>

LLVM IR (-O0):
define i32 @bbm_com_deinit(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i32
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = load i8*, i8** %3
%7 = load i16, i16* %4
%8 = call i32 @fc8300_deinit(i8* %6, i16 zeroext %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @bbm_com_deinit(i8* %0, i16 zeroext %1) {
%3 = tail call i32 @fc8300_deinit(i8* %0, i16 zeroext %1)
ret i32 %3
}
/* Variables and functions */
double calculate_angle(int, int /*<<< orphan*/);
int test_invalid_hour() { return -1.0 == calculate_angle(13, 0); }


x86 assembly (clang, -O0):
<test_invalid_hour>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
xor    %esi,%esi
call   1030 <calculate_angle@plt>
movaps %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_invalid_hour>:
push   %rax
mov    $0xd,%edi
xor    %esi,%esi
call   1030 <calculate_angle@plt>
cmpeqsd 0xeda(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_invalid_hour() {
%1 = call double @calculate_angle(i32 13, i32 0)
%2 = fcmp oeq double -1.000000e+00, %1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @test_invalid_hour() {
%1 = tail call double @calculate_angle(i32 13, i32 0)
%2 = fcmp oeq double %1, -1.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
void VMR3ReleaseUVM(void) {}


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

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

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

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

/* Variables and functions */
void I2CRxFIFOConfigSet(uint32_t ui32Base, uint32_t ui32Config) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000F04))) &= 0x0000ffff;
  (*((volatile uint32_t *)(ui32Base + 0x00000F04))) |= ui32Config;
}


x86 assembly (clang, -O0):
<I2CRxFIFOConfigSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xf04,%eax
cltq
mov    (%rax),%ecx
and    $0xffff,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0xf04,%eax
cltq
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CRxFIFOConfigSet>:
movslq %edi,%rax
andl   $0xffff,0xf04(%rax)
or     %esi,0xf04(%rax)
ret

LLVM IR (-O0):
define void @I2CRxFIFOConfigSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 3844
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, 65535
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 3844
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = or i32 %16, %11
store volatile i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @I2CRxFIFOConfigSet(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 3844
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 65535
store volatile i32 %7, i32* %5
%8 = load volatile i32, i32* %5
%9 = or i32 %8, %1
store volatile i32 %9, i32* %5
ret void
}
int jac_chain_nm4_free(void *mem) {
  (void)mem;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @jac_chain_nm4_free(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_snansumkbn(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 0.0 / 0.0, 0.0 / 0.0};
  int64_t N = 5;
  int64_t stride = 2;
  float v = stdlib_strided_snansumkbn(N, x, stride);
  printf("sum: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0x5,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1040 <stdlib_strided_snansumkbn@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_snansumkbn@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [10 x float]* %1 to i8*
store i32 5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_snansumkbn(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_snansumkbn(i32 5, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
int strcmp(const char *cs, const char *ct) {
  unsigned char c1, c2;
  while (1) {
    c1 = *cs++;
    c2 = *ct++;
    if (c1 != c2) {
      return c1 < c2 ? -1 : 1;
    }
    if (!c1) {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movzbl -0x19(%rbp),%eax
movzbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
je     1163 <strcmp+0x63>
movzbl -0x19(%rbp),%edx
movzbl -0x1a(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    117e <strcmp+0x7e>
cmpb   $0x0,-0x19(%rbp)
jne    1172 <strcmp+0x72>
jmp    1177 <strcmp+0x77>
jmp    110c <strcmp+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
cmp    (%rsi,%rax,1),%cl
jne    1124 <strcmp+0x24>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
setae  %al
movzbl %al,%eax
add    %eax,%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %12, %2
%4 = phi i8* [ %1, %2 ], [ %13, %12 ]
%5 = phi i8* [ %0, %2 ], [ %14, %12 ]
%6 = load i8, i8* %5
%7 = load i8, i8* %4
%8 = icmp eq i8 %6, %7
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = icmp ult i8 %6, %7
%11 = select i1 %10, i32 -1, i32 1
br label %16
12: ; preds = %3
%13 = getelementptr inbounds i8, i8* %4, i64 1
%14 = getelementptr inbounds i8, i8* %5, i64 1
%15 = icmp eq i8 %6, 0
br i1 %15, label %16, label %3
16: ; preds = %12, %9
%17 = phi i32 [ %11, %9 ], [ 0, %12 ]
ret i32 %17
}
const char *getWindowTitle() { return "Hello World"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i8* @getWindowTitle() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i8* @getWindowTitle() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
bool chars_is_upper(char c) { return 'A' <= c && c <= 'Z'; }


x86 assembly (clang, -O0):
<chars_is_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x41,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <chars_is_upper+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars_is_upper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @chars_is_upper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ round(double);
double rpn_factorial(double number) {
  int num = (int)round(number);
  if (num == 1)
    return num;
  else
    return num * rpn_factorial(num - 1);
}


x86 assembly (clang, -O0):
<rpn_factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <round@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1153 <rpn_factorial+0x33>
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117d <rpn_factorial+0x5d>
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
call   1030 <rpn_factorial@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpn_factorial>:
push   %rax
call   1040 <round@plt>
cmp    $0x1,%eax
jne    1135 <rpn_factorial+0x15>
movsd  0xecd(%rip),%xmm0
pop    %rax
ret
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1030 <rpn_factorial@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rpn_factorial(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
%5 = load double, double* %3
%6 = call i64 @round(double %5)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %4
%12 = sitofp i32 %11 to double
store double %12, double* %2
br label %21
13: ; preds = %1
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to double
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 1
%18 = sitofp i32 %17 to double
%19 = call double @rpn_factorial(double %18)
%20 = fmul double %15, %19
store double %20, double* %2
br label %21
21: ; preds = %13, %10
%22 = load double, double* %2
ret double %22
}

LLVM IR (-O2):
define double @rpn_factorial(double %0) {
%2 = tail call i64 @round(double %0)
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1, %7
%6 = phi double [ %12, %7 ], [ 1.000000e+00, %1 ]
ret double %6
7: ; preds = %1
%8 = sitofp i32 %3 to double
%9 = add nsw i32 %3, -1
%10 = sitofp i32 %9 to double
%11 = tail call double @rpn_factorial(double %10)
%12 = fmul double %11, %8
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ find_track(char *);
int /*<<< orphan*/ find_track_regex(char *);
int main(int argc, char *argv[]) {
  char target = 'F';
  char *pattern = "Fr.*Fr.*";
  find_track(&target);
  find_track_regex(pattern);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x46,-0x11(%rbp)
lea    0xebf(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x11(%rbp),%rdi
call   1030 <find_track@plt>
mov    -0x20(%rbp),%rdi
call   1040 <find_track_regex@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x46,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1030 <find_track@plt>
lea    0xec9(%rip),%rdi
call   1040 <find_track_regex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Fr.*Fr.*\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 70, i8* %6
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = call i32 @find_track(i8* %6)
%9 = load i8*, i8** %7
%10 = call i32 @find_track_regex(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Fr.*Fr.*\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
store i8 70, i8* %3
%4 = call i32 @find_track(i8* %3)
%5 = call i32 @find_track_regex(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int cs(const char *str) {
  int i;
  i = 0;
  while (str[i]) {
    if (str[i] == '\n' || !str[i])
      return (i);
    i++;
  }
  return (-1);
}


x86 assembly (clang, -O0):
<cs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1161 <cs+0x61>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     1148 <cs+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
jne    1153 <cs+0x53>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <cs+0x68>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <cs+0xf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1123 <cs+0x23>
cmp    $0xa,%cl
je     1128 <cs+0x28>
add    $0x1,%rax
jmp    1110 <cs+0x10>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @cs(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %10
i8 10, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ %9, %8 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CSlaveBaseValid(unsigned long);
void I2CSlaveIntEnable(unsigned long ulBase) {
  DEBUG_ASSERT(I2CSlaveBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<I2CSlaveIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
or     $0x1,%rcx
mov    %rcx,0xc(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntEnable>:
push   %rbx
mov    %rdi,%rbx
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
orq    $0x1,0xc(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @I2CSlaveIntEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @I2CSlaveBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 12
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, 1
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntEnable(i64 %0) {
%2 = tail call i32 @I2CSlaveBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 12
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 1
store volatile i64 %7, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Declare a string variable and assign to it the following value:The "
         "\"use\" of quotations causes difficulties. \\n, \\t and \\ are also "
         "special characters.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [151 x i8] c"Declare a string variable and assign to it the following value:The \22use\22 of quotations causes difficulties. \\n, \\t and \\ are also special characters.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [150 x i8] c"Declare a string variable and assign to it the following value:The \22use\22 of quotations causes difficulties. \\n, \\t and \\ are also special characters.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([150 x i8], [150 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handle_TSTP(int /*<<< orphan*/);
int gen_TSTP() {
  handle_TSTP(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @gen_TSTP() {
%1 = tail call i32 @handle_TSTP(i32 0)
ret i32 0
}
int test6(int i, int j) { return ~i >= ~j; }


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
cmp    %ecx,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test6>:
xor    %eax,%eax
cmp    %edi,%esi
setge  %al
ret

LLVM IR (-O0):
define i32 @test6(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 = xor i32 %5, -1
%7 = load i32, i32* %4
%8 = xor i32 %7, -1
%9 = icmp sge i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @test6(i32 %0, i32 %1) {
%3 = icmp sge i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cleanup(int /*<<< orphan*/);
void DONE(void) { (void)cleanup(0); }


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

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

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

LLVM IR (-O2):
define void @DONE() {
%1 = tail call i32 @cleanup(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *LiaPrintThread2(void *argv) {
  while (1) {
    printf("LiaPrintThread2\n");
    sleep(2);
  }
  return (void *)0;
}


x86 assembly (clang, -O0):
<LiaPrintThread2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
jmp    112c <LiaPrintThread2+0xc>

x86 assembly (clang, -O2):
<LiaPrintThread2>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
jmp    1130 <LiaPrintThread2+0x10>

LLVM IR (-O0):
@.str = [17 x i8] c"LiaPrintThread2\0A\00"
define i8* @LiaPrintThread2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 2)
br label %3
}

LLVM IR (-O2):
@str = [16 x i8] c"LiaPrintThread2\00"
define noalias i8* @LiaPrintThread2(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 2)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ nrf24_ce_digitalWrite(int);
int /*<<< orphan*/ nrf24_configRegister(int, int);
int /*<<< orphan*/ nrf24_csn_digitalWrite(int);
int /*<<< orphan*/ spi_transfer(int);
void nrf24_powerUpRx() {
  nrf24_csn_digitalWrite(0);
  spi_transfer(0xE2);
  nrf24_csn_digitalWrite(1);
  nrf24_configRegister(0x07, (1 << 6) | (1 << 5) | (1 << 4));
  nrf24_ce_digitalWrite(0);
  nrf24_configRegister(0x00, ((1 << 3) | (0 << 2)) | ((1 << 1) | (1 << 0)));
  nrf24_ce_digitalWrite(1);
}


x86 assembly (clang, -O0):
<nrf24_powerUpRx>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <nrf24_csn_digitalWrite@plt>
mov    $0xe2,%edi
call   1050 <spi_transfer@plt>
mov    $0x1,%edi
call   1040 <nrf24_csn_digitalWrite@plt>
mov    $0x7,%edi
mov    $0x70,%esi
call   1030 <nrf24_configRegister@plt>
xor    %edi,%edi
call   1060 <nrf24_ce_digitalWrite@plt>
xor    %edi,%edi
mov    $0xb,%esi
call   1030 <nrf24_configRegister@plt>
mov    $0x1,%edi
call   1060 <nrf24_ce_digitalWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf24_powerUpRx>:
push   %rax
xor    %edi,%edi
call   1040 <nrf24_csn_digitalWrite@plt>
mov    $0xe2,%edi
call   1050 <spi_transfer@plt>
mov    $0x1,%edi
call   1040 <nrf24_csn_digitalWrite@plt>
mov    $0x7,%edi
mov    $0x70,%esi
call   1030 <nrf24_configRegister@plt>
xor    %edi,%edi
call   1060 <nrf24_ce_digitalWrite@plt>
xor    %edi,%edi
mov    $0xb,%esi
call   1030 <nrf24_configRegister@plt>
mov    $0x1,%edi
pop    %rax
jmp    1060 <nrf24_ce_digitalWrite@plt>

LLVM IR (-O0):
define void @nrf24_powerUpRx() {
%1 = call i32 @nrf24_csn_digitalWrite(i32 0)
%2 = call i32 @spi_transfer(i32 226)
%3 = call i32 @nrf24_csn_digitalWrite(i32 1)
%4 = call i32 @nrf24_configRegister(i32 7, i32 112)
%5 = call i32 @nrf24_ce_digitalWrite(i32 0)
%6 = call i32 @nrf24_configRegister(i32 0, i32 11)
%7 = call i32 @nrf24_ce_digitalWrite(i32 1)
ret void
}

LLVM IR (-O2):
define void @nrf24_powerUpRx() {
%1 = tail call i32 @nrf24_csn_digitalWrite(i32 0)
%2 = tail call i32 @spi_transfer(i32 226)
%3 = tail call i32 @nrf24_csn_digitalWrite(i32 1)
%4 = tail call i32 @nrf24_configRegister(i32 7, i32 112)
%5 = tail call i32 @nrf24_ce_digitalWrite(i32 0)
%6 = tail call i32 @nrf24_configRegister(i32 0, i32 11)
%7 = tail call i32 @nrf24_ce_digitalWrite(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flick_mem(char *, int /*<<< orphan*/, int, int,
                             int /*<<< orphan*/);
void i_asx_mem(void) { flick_mem("sa", 0, 1, 1, 0); }


x86 assembly (clang, -O0):
<i_asx_mem>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %r8d,%r8d
mov    $0x1,%ecx
mov    %r8d,%esi
mov    %ecx,%edx
call   1030 <flick_mem@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_asx_mem>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
jmp    1030 <flick_mem@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"sa\00"
define void @i_asx_mem() {
%1 = call i32 @flick_mem(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"sa\00"
define void @i_asx_mem() {
%1 = tail call i32 @flick_mem(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void *count_time(void *arg) {
  int i = 0;
  while (1) {
    sleep(1);
    printf("sec: %d\n", ++i);
  }
}


x86 assembly (clang, -O0):
<count_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
jmp    1133 <count_time+0x13>

x86 assembly (clang, -O2):
<count_time>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1130 <count_time+0x10>

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

LLVM IR (-O2):
@.str = [9 x i8] c"sec: %d\0A\00"
define noalias i8* @count_time(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @sleep(i32 1)
%5 = add nuw nsw i32 %3, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %2
}