xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ declarations();
int /*<<< orphan*/ postLabel(char *, char *);
int /*<<< orphan*/ statements();
void doBlock(char name) {
  char progName[2] = {name, 0x00};
  declarations();
  postLabel(progName, "# Program entry point");
  statements();
}


x86 assembly (clang, -O0):
<doBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
mov    $0x0,%al
call   1050 <declarations@plt>
lea    -0x3(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1040 <postLabel@plt>
mov    $0x0,%al
call   1030 <statements@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doBlock>:
push   %rax
mov    %dil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
xor    %eax,%eax
call   1050 <declarations@plt>
lea    0xeb7(%rip),%rsi
lea    0x6(%rsp),%rdi
call   1040 <postLabel@plt>
xor    %eax,%eax
call   1030 <statements@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"# Program entry point\00"
define void @doBlock(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %2
store i8 %5, i8* %4
%6 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %6
%7 = call i32 (...) @declarations()
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%9 = call i32 @postLabel(i8* %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @statements()
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"# Program entry point\00"
define void @doBlock(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 %0, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %4
%5 = tail call i32 (...) @declarations()
%6 = call i32 @postLabel(i8* %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @statements()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int search(int *, int, int);
int main() {
  int firstvec[] = {1, 2, 6, 8, 3, 9};
  int length = 6;
  printf("%d\n", search(&firstvec[0], length, 8));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x6,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    $0x8,%edx
call   1040 <search@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
mov    $0x8,%edx
call   1040 <search@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.firstvec = [6 x i32] [i32 1, i32 2, i32 6, i32 8, i32 3, i32 9]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = bitcast [6 x i32]* %1 to i8*
store i32 6, i32* %2
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @search(i32* %4, i32 %5, i32 8)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.firstvec = [6 x i32] [i32 1, i32 2, i32 6, i32 8, i32 3, i32 9]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 6, i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
double exp(double);
double gamma(double);
double log(double);
double sphere_volume(double dimension) {
  const double log_pi = log(3.1415926535);
  double log_gamma, log_volume;
  log_gamma = gamma(dimension / 2.0 + 1);
  log_volume = dimension / 2.0 * log_pi - log_gamma;
  return exp(log_volume);
}


x86 assembly (clang, -O0):
<sphere_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
call   1050 <log@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xea0(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <gamma@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe7d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sphere_volume>:
push   %rax
movapd %xmm0,%xmm1
mulsd  0xed3(%rip),%xmm1
movsd  %xmm1,(%rsp)
movsd  0xece(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <gamma@plt>
movsd  (%rsp),%xmm1
mulsd  0xec0(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
jmp    1040 <exp@plt>

LLVM IR (-O0):
define double @sphere_volume(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = call double @log(double 0x400921FB54411744)
store double %6, double* %3
%7 = load double, double* %2
%8 = fdiv double %7, 2.000000e+00
%9 = fadd double %8, 1.000000e+00
%10 = call double @gamma(double %9)
store double %10, double* %4
%11 = load double, double* %2
%12 = fdiv double %11, 2.000000e+00
%13 = load double, double* %3
%14 = load double, double* %4
%15 = fneg double %14
%16 = call double @llvm.fmuladd.f64(double %12, double %13, double %15)
store double %16, double* %5
%17 = load double, double* %5
%18 = call double @exp(double %17)
ret double %18
}

LLVM IR (-O2):
define double @sphere_volume(double %0) {
%2 = fmul double %0, 5.000000e-01
%3 = fadd double %2, 1.000000e+00
%4 = tail call double @gamma(double %3)
%5 = fneg double %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FF250D048E5AAEB, double %5)
%7 = tail call double @exp(double %6)
ret double %7
}
void troca_ponto(char resultado[]) {
  int i;
  for (i = 0; resultado[i] != '\0'; i++) {
    if (resultado[i] == '@') {
      resultado[i] = '.';
    }
  }
}


x86 assembly (clang, -O0):
<troca_ponto>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <troca_ponto+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x40,%eax
jne    1145 <troca_ponto+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x2e,(%rax,%rcx,1)
jmp    114a <troca_ponto+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <troca_ponto+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<troca_ponto>:
jmp    1117 <troca_ponto+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x2e,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x40,%al
je     1110 <troca_ponto+0x10>
test   %al,%al
jne    1113 <troca_ponto+0x13>
ret

LLVM IR (-O0):
define void @troca_ponto(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %26, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %29
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%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, 64
br i1 %19, label %20, label %25
20: ; preds = %12
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 46, i8* %24
br label %25
25: ; preds = %20, %12
br label %26
26: ; preds = %25
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %4
29: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @troca_ponto(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 64, label %6
]
6: ; preds = %2
store i8 46, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xd3() {
  Assert_real((isalpha(211) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1060, ("isalpha should be 0 for 0xd3"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xd3>:
push   %rax
mov    $0xd3,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x424,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xd3\00"
define void @t_isalpha_0xd3() {
%1 = call i64 @isalpha(i32 211)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1060, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xd3\00"
define void @t_isalpha_0xd3() {
%1 = tail call i64 @isalpha(i32 211)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1060, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ r();
int main(int argc, char **argv) {
  r();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @r()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
call_sleep_inf() {
  while (1) {
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<call_sleep_inf>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <call_sleep_inf+0x9>
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1119 <call_sleep_inf+0x9>

x86 assembly (clang, -O2):
<call_sleep_inf>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <call_sleep_inf+0x10>

LLVM IR (-O0):
define i32 @call_sleep_inf() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @sleep(i32 1)
br label %1
}

LLVM IR (-O2):
define i32 @call_sleep_inf() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 1)
br label %1
}
int func3() {
#pragma critTer : 10 :../../ test / resources / functionNumber.c:
  return 0;
#pragma critTer : 11 :../../ test / resources / functionNumber.c:
}


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

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

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

LLVM IR (-O2):
define i32 @func3() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pmu_reg_write(int, int);
int /*<<< orphan*/ pmu_setting_temp_based();
void pmu_set_clk_init() {
  pmu_setting_temp_based();
  pmu_reg_write(0x05, ((0 << 13) | (0 << 12) | (1 << 11) | (0 << 10) |
                       (0 << 9) | (0 << 8) | (0 << 7) | (52)));
  pmu_reg_write(0x05, ((1 << 13) | (0 << 12) | (1 << 11) | (0 << 10) |
                       (1 << 9) | (0 << 8) | (1 << 7) | (52)));
}


x86 assembly (clang, -O0):
<pmu_set_clk_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pmu_setting_temp_based@plt>
mov    $0x5,%edi
mov    $0x834,%esi
call   1040 <pmu_reg_write@plt>
mov    $0x5,%edi
mov    $0x2ab4,%esi
call   1040 <pmu_reg_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_set_clk_init>:
push   %rax
xor    %eax,%eax
call   1030 <pmu_setting_temp_based@plt>
mov    $0x5,%edi
mov    $0x834,%esi
call   1040 <pmu_reg_write@plt>
mov    $0x5,%edi
mov    $0x2ab4,%esi
pop    %rax
jmp    1040 <pmu_reg_write@plt>

LLVM IR (-O0):
define void @pmu_set_clk_init() {
%1 = call i32 (...) @pmu_setting_temp_based()
%2 = call i32 @pmu_reg_write(i32 5, i32 2100)
%3 = call i32 @pmu_reg_write(i32 5, i32 10932)
ret void
}

LLVM IR (-O2):
define void @pmu_set_clk_init() {
%1 = tail call i32 (...) @pmu_setting_temp_based()
%2 = tail call i32 @pmu_reg_write(i32 5, i32 2100)
%3 = tail call i32 @pmu_reg_write(i32 5, i32 10932)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void CANIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000000))) &= ~ui32IntFlags;
}


x86 assembly (clang, -O0):
<CANIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @CANIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add i64 %7, 0
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @CANIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, %6
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void version(void) {
  printf("Version %s, %s\n", "V00.06.00", "2017-02-08 06:30:59");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xef1(%rip),%rdx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xef5(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Version %s, %s\0A\00"
@.str.1 = [10 x i8] c"V00.06.00\00"
@.str.2 = [20 x i8] c"2017-02-08 06:30:59\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Version %s, %s\0A\00"
@.str.1 = [10 x i8] c"V00.06.00\00"
@.str.2 = [20 x i8] c"2017-02-08 06:30:59\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void parent() { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<parent>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @parent() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @parent() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int ArgNum();
int GetFlag(int);
int /*<<< orphan*/ SetFlag(int, int);
void Act_Mul(void) {
  int a = ArgNum();
  SetFlag(a, GetFlag(a) * ArgNum());
}


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

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

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

LLVM IR (-O2):
define void @Act_Mul() {
%1 = tail call i32 (...) @ArgNum()
%2 = tail call i32 @GetFlag(i32 %1)
%3 = tail call i32 (...) @ArgNum()
%4 = mul nsw i32 %3, %2
%5 = tail call i32 @SetFlag(i32 %1, i32 %4)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool event_bitmask_get(uint8_t *bitmask, unsigned int event) {
  return (bitmask[event / 8] & (1 << (event % 8))) ? true : false;
}


x86 assembly (clang, -O0):
<event_bitmask_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,4),%edx
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_bitmask_get>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%eax
mov    (%rdi,%rax,4),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @event_bitmask_get(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 = udiv i32 %6, 8
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = urem i32 %11, 8
%13 = shl i32 1, %12
%14 = and i32 %10, %13
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
ret i32 %17
}

LLVM IR (-O2):
define i32 @event_bitmask_get(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 7
%8 = lshr i32 %6, %7
%9 = and i32 %8, 1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ doubles_quat_to_mat44(double *, double *);
int /*<<< orphan*/ doubles_rpy_to_quat(double const *, double *);
void doubles_rpy_to_mat44(const double rpy[3], double M[16]) {
  double q[4];
  doubles_rpy_to_quat(rpy, q);
  doubles_quat_to_mat44(q, M);
}


x86 assembly (clang, -O0):
<doubles_rpy_to_mat44>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <doubles_rpy_to_quat@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <doubles_quat_to_mat44@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubles_rpy_to_mat44>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
call   1040 <doubles_rpy_to_quat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <doubles_quat_to_mat44@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @doubles_rpy_to_mat44(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [4 x double]
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%8 = call i32 @doubles_rpy_to_quat(double* %6, double* %7)
%9 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @doubles_quat_to_mat44(double* %9, double* %10)
ret void
}

LLVM IR (-O2):
define void @doubles_rpy_to_mat44(double* %0, double* %1) {
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %3 to i8*
%5 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%6 = call i32 @doubles_rpy_to_quat(double* %0, double* %5)
%7 = call i32 @doubles_quat_to_mat44(double* %5, double* %1)
ret void
}
/* Type definitions */
struct stat {
  scalar_t__ st_dev;
  scalar_t__ st_ino;
};

/* Variables and functions */
int stat_equal(struct stat *a, struct stat *b) {
  return a->st_dev == b->st_dev && a->st_ino == b->st_ino;
}


x86 assembly (clang, -O0):
<stat_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
mov    %al,-0x11(%rbp)
jne    113b <stat_equal+0x3b>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    0x8(%rcx),%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat_equal>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
jne    1117 <stat_equal+0x17>
mov    0x8(%rdi),%rcx
xor    %eax,%eax
cmp    0x8(%rsi),%rcx
sete   %al
ret

LLVM IR (-O0):
%struct.stat = type { i64, i64 }
define i32 @stat_equal(%struct.stat* %0, %struct.stat* %1) {
%3 = alloca %struct.stat*
%4 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load %struct.stat*, %struct.stat** %3
%6 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = load %struct.stat*, %struct.stat** %4
%9 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = icmp eq i64 %7, %10
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = load %struct.stat*, %struct.stat** %3
%14 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 1
%15 = load i64, i64* %14
%16 = load %struct.stat*, %struct.stat** %4
%17 = getelementptr inbounds %struct.stat, %struct.stat* %16, i32 0, i32 1
%18 = load i64, i64* %17
%19 = icmp eq i64 %15, %18
br label %20
20: ; preds = %12, %2
%21 = phi i1 [ false, %2 ], [ %19, %12 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
%struct.stat = type { i64, i64 }
define i32 @stat_equal(%struct.stat* nocapture %0, %struct.stat* nocapture %1) {
%3 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 1
%10 = load i64, i64* %9
%11 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 1
%12 = load i64, i64* %11
%13 = icmp eq i64 %10, %12
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %8, %2
%16 = phi i32 [ 0, %2 ], [ %14, %8 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ init(char *);
scalar_t__ malloc(int);
int main(int argc, const char *argv[]) {
  char *p;
  init(p);
  p = (char *)malloc(42);
  if (argc > 0) {
    if (!p) {
      return 1;
    }
  } else {
    return 2;
  }
  p[0] = '\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)
mov    -0x18(%rbp),%rdi
call   1030 <init@plt>
mov    $0x2a,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1173 <main+0x53>
cmpq   $0x0,-0x18(%rbp)
jne    116e <main+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1186 <main+0x66>
jmp    117f <main+0x5f>
movl   $0x2,-0x4(%rbp)
jmp    1186 <main+0x66>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
call   1030 <init@plt>
mov    $0x2a,%edi
call   1040 <malloc@plt>
test   %ebx,%ebx
jle    1142 <main+0x22>
test   %rax,%rax
je     1149 <main+0x29>
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbx
ret
mov    $0x2,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8*, i8** %6
%8 = call i32 @init(i8* %7)
%9 = call i64 @malloc(i32 42)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %6
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = icmp ne i8* %14, null
br i1 %15, label %17, label %16
16: ; preds = %13
store i32 1, i32* %3
br label %22
17: ; preds = %13
br label %19
18: ; preds = %2
store i32 2, i32* %3
br label %22
19: ; preds = %17
%20 = load i8*, i8** %6
%21 = getelementptr inbounds i8, i8* %20, i64 0
store i8 0, i8* %21
br label %22
22: ; preds = %19, %18, %16
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @init(i8* undef)
%4 = tail call i64 @malloc(i32 42)
%5 = inttoptr i64 %4 to i8*
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = icmp eq i64 %4, 0
br i1 %8, label %10, label %9
9: ; preds = %7
store i8 0, i8* %5
br label %10
10: ; preds = %2, %7, %9
%11 = phi i32 [ 0, %9 ], [ 1, %7 ], [ 2, %2 ]
ret i32 %11
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ teardown();
void sig_handler(int s) {
  if (s == SIGINT) {
    teardown();
    printf("\nGoodbye.\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
jne    1167 <sig_handler+0x37>
mov    $0x0,%al
call   1050 <teardown@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
mov    0x2eb0(%rip),%rax
cmp    %edi,(%rax)
je     113e <sig_handler+0xe>
pop    %rax
ret
xor    %eax,%eax
call   1050 <teardown@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [11 x i8] c"\0AGoodbye.\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 (...) @teardown()
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@str = [10 x i8] c"\0AGoodbye.\00"
define void @sig_handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (...) @teardown()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void di_end() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @di_end() {
%1 = tail call i32 (...) @endwin()
ret void
}
char test_58_0(char *mem) { return __atomic_xor_fetch(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_58_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    0x4(%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
xor    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    1152 <test_58_0+0x52>
jmp    1127 <test_58_0+0x27>
mov    -0xc(%rbp),%cl
mov    -0x19(%rbp),%al
xor    %cl,%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_58_0>:
mov    0x4(%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
xor    $0x1,%cl
lock cmpxchg %cl,0x4(%rdi)
jne    1110 <test_58_0+0x10>
xor    $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @test_58_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 4
store i8 1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw xor i8* %6, i8 %7 acq_rel
%9 = xor i8 %8, %7
store i8 %9, i8* %4
%10 = load i8, i8* %4
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @test_58_0(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = atomicrmw xor i8* %2, i8 1 acq_rel
%4 = xor i8 %3, 1
ret i8 %4
}
void av_opt_ptr() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_ptr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ retire();
void storm_out() {
  printf("Hamurabi: I cannot do what you wish.\n");
  printf("Get yourself another steward!!!!!\n");
  retire();
}


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

x86 assembly (clang, -O2):
<storm_out>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <retire@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Hamurabi: I cannot do what you wish.\0A\00"
@.str.1 = [35 x i8] c"Get yourself another steward!!!!!\0A\00"
define void @storm_out() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @retire()
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Hamurabi: I cannot do what you wish.\00"
@str.2 = [34 x i8] c"Get yourself another steward!!!!!\00"
define void @storm_out() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @retire()
ret void
}
int ssds_set_group_data_asc(int pcfd, char *list_name, char *data) {
  return -1;
}


x86 assembly (clang, -O0):
<ssds_set_group_data_asc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ssds_set_group_data_asc(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ SendWeaponPref();
void DirectionChar_OnChange(void) { SendWeaponPref(); }


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

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

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

LLVM IR (-O2):
define void @DirectionChar_OnChange() {
%1 = tail call i32 (...) @SendWeaponPref()
ret void
}
/* Variables and functions */
double fmod(double, double);
double npitopi(double r) {
  r = fmod(r, 6.28318530717958647693);
  if (r > 3.14159265358979323846)
    r -= 6.28318530717958647693;
  else if (r <= -1.0 * 3.14159265358979323846)
    r += 6.28318530717958647693;
  return r;
}


x86 assembly (clang, -O0):
<npitopi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1166 <npitopi+0x56>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1190 <npitopi+0x80>
movsd  0xea2(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     118b <npitopi+0x7b>
movsd  0xe87(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1190 <npitopi+0x80>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<npitopi>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <fmod@plt>
ucomisd 0xee2(%rip),%xmm0
jbe    1132 <npitopi+0x22>
addsd  0xee8(%rip),%xmm0
pop    %rax
ret
movsd  0xed6(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     1148 <npitopi+0x38>
addsd  0xeb8(%rip),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @npitopi(double %0) {
%2 = tail call double @fmod(double %0, double 0x401921FB54442D18)
%3 = fcmp ogt double %2, 0x400921FB54442D18
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = fadd double %2, 0xC01921FB54442D18
br label %10
6: ; preds = %1
%7 = fcmp ugt double %2, 0xC00921FB54442D18
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = fadd double %2, 0x401921FB54442D18
br label %10
10: ; preds = %6, %8, %4
%11 = phi double [ %5, %4 ], [ %9, %8 ], [ %2, %6 ]
ret double %11
}
int bigToNative(const unsigned char *x) {
  return (x[0] << 24) + (x[1] << 16) + (x[2] << 8) + x[3];
}


x86 assembly (clang, -O0):
<bigToNative>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigToNative>:
mov    (%rdi),%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @bigToNative(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ retval;

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_formatted_time() {
  time_t rawtime;
  struct tm *timeinfo;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  static char retval[20];
  strftime(retval, sizeof(retval), "%Y-%m-%d %H:%M:%S", timeinfo);
  return retval;
}


x86 assembly (clang, -O0):
<get_formatted_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0x2ef7(%rip),%rdi
mov    $0x14,%esi
lea    0xe9b(%rip),%rdx
call   1050 <strftime@plt>
lea    0x2edf(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_formatted_time>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
lea    0x2eff(%rip),%rbx
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@get_formatted_time.retval = internal global [20 x i8] zeroinitializer
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @get_formatted_time() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = call i32 @strftime(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @get_formatted_time.retval, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @get_formatted_time.retval, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@get_formatted_time.retval = internal global [20 x i8] zeroinitializer
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @get_formatted_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = call i32 @strftime(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @get_formatted_time.retval, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @get_formatted_time.retval, i64 0, i64 0)
}
void vnum_test7(int *data) {
  int i, j, k;
  int m = data[1];
  int n = data[3];
  if (data[0]) {
    j = m * n;
    i = data[2];
    data[i] = 2;
    k = m * n;
  } else {
    j = 5;
    k = 5;
  }
  data[0] = k - j;
}


x86 assembly (clang, -O0):
<vnum_test7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     115b <vnum_test7+0x5b>
mov    -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1169 <vnum_test7+0x69>
movl   $0x5,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
sub    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnum_test7>:
cmpl   $0x0,(%rdi)
je     1110 <vnum_test7+0x10>
movslq 0x8(%rdi),%rax
movl   $0x2,(%rdi,%rax,4)
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @vnum_test7(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 2, i32* %8
br label %9
9: ; preds = %1, %4
store i32 0, i32* %0
ret void
}
__attribute__((always_)) void __plic_set_pending(unsigned int source) {
  volatile unsigned int *current_ptr =
      (volatile unsigned int *)(0x0 + (0x00001000UL) + ((source >> 5) << 2));
  *current_ptr = (1 << (source & 0x1F));
}


x86 assembly (clang, -O0):
<__plic_set_pending>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
shl    $0x2,%eax
mov    %eax,%eax
add    $0x1000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__plic_set_pending>:
mov    %edi,%ecx
mov    %edi,%eax
shr    $0x3,%eax
and    $0xfffffffc,%eax
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,0x1000(%rax)
ret

LLVM IR (-O0):
define void @__plic_set_pending(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 5
%6 = shl i32 %5, 2
%7 = zext i32 %6 to i64
%8 = add i64 4096, %7
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
%10 = load i32, i32* %2
%11 = and i32 %10, 31
%12 = shl i32 1, %11
%13 = load i32*, i32** %3
store volatile i32 %12, i32* %13
ret void
}

LLVM IR (-O2):
define void @__plic_set_pending(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 536870908
%4 = add nuw nsw i32 %3, 4096
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = and i32 %0, 31
%8 = shl nuw i32 1, %7
store volatile i32 %8, i32* %6
ret void
}
void print_function() {}


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

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

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

LLVM IR (-O2):
define void @print_function() {
ret void
}
/* Variables and functions */
int FD_CLOEXEC;
int /*<<< orphan*/ F_GETFD;
int /*<<< orphan*/ F_SETFD;
int fcntl(int, int /*<<< orphan*/, int);
int set_cloexec(int fd) {
  int val;
  if ((val = fcntl(fd, F_GETFD, 0)) < 0) {
    return -1;
  }
  val |= FD_CLOEXEC;
  return fcntl(fd, F_SETFD, val);
}


x86 assembly (clang, -O0):
<set_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1146 <set_cloexec+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <set_cloexec+0x5c>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cloexec>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
js     1143 <set_cloexec+0x33>
mov    0x2eaa(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFD = global i32 0
@FD_CLOEXEC = global i32 0
@F_SETFD = global i32 0
define i32 @set_cloexec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFD
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %18
10: ; preds = %1
%11 = load i32, i32* @FD_CLOEXEC
%12 = load i32, i32* %4
%13 = or i32 %12, %11
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* @F_SETFD
%16 = load i32, i32* %4
%17 = call i32 @fcntl(i32 %14, i32 %15, i32 %16)
store i32 %17, i32* %2
br label %18
18: ; preds = %10, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@F_GETFD = global i32 0
@FD_CLOEXEC = global i32 0
@F_SETFD = global i32 0
define i32 @set_cloexec(i32 %0) {
%2 = load i32, i32* @F_GETFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @FD_CLOEXEC
%7 = or i32 %6, %3
%8 = load i32, i32* @F_SETFD
%9 = tail call i32 @fcntl(i32 %0, i32 %8, i32 %7)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ -1, %1 ]
ret i32 %11
}