xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M143_f(char *s) {
  debug("M143_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [47 x i8] c"M143_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M143_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ poll(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
void ktr_sleep(int millis) { poll(NULL, 0, millis); }


x86 assembly (clang, -O0):
<ktr_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1030 <poll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ktr_sleep>:
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <poll@plt>

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

LLVM IR (-O2):
define void @ktr_sleep(i32 %0) {
%2 = tail call i32 @poll(i32* null, i32 0, i32 %0)
ret void
}
unsigned int test_06(volatile unsigned int *x) { return x[5]; }


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

x86 assembly (clang, -O2):
<test_06>:
mov    0x14(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test_06(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_06(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load volatile i32, i32* %2
ret i32 %3
}
int fb_dd_progress(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @fb_dd_progress() {
ret i32 1
}
/* Variables and functions */
int cos(float);
float tsec(float a) { return (1 / cos(a)); }


x86 assembly (clang, -O0):
<tsec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cos@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsec>:
push   %rax
call   1030 <cos@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tsec(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @cos(float %3)
%5 = sdiv i32 1, %4
%6 = sitofp i32 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @tsec(float %0) {
%2 = tail call i32 @cos(float %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to float
ret float %6
}
int x33_process_syn(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x33_process_syn(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
int test_imm_B4uint8_mem(unsigned char *val) {
  return ((*val) & (0xB4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B4uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xb4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B4uint8_mem>:
testb  $0xb4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B4uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 180
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_B4uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -76
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void tdefault_terminal_save_ours(struct target_ops *self) {}


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

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

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

LLVM IR (-O2):
%struct.target_ops = type opaque
define void @tdefault_terminal_save_ours(%struct.target_ops* nocapture %0) {
ret void
}
/* Type definitions */
struct Universidad {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ balancearCursos(struct Universidad *);
int main() {
  struct Universidad *pucv;
  int sigla = 0;
  balancearCursos(pucv);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.Universidad = type { i32 }
define i32 @main() {
%1 = tail call i32 @balancearCursos(%struct.Universidad* undef)
ret i32 0
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int get_1970_sec_0_am();
time_t get_1970_usec_0_am() { return get_1970_sec_0_am() * 1000000; }


x86 assembly (clang, -O0):
<get_1970_usec_0_am>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_1970_sec_0_am@plt>
imul   $0xf4240,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_1970_usec_0_am>:
push   %rax
xor    %eax,%eax
call   1030 <get_1970_sec_0_am@plt>
imul   $0xf4240,%eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_1970_usec_0_am() {
%1 = call i32 (...) @get_1970_sec_0_am()
%2 = mul nsw i32 %1, 1000000
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_1970_usec_0_am() {
%1 = tail call i32 (...) @get_1970_sec_0_am()
%2 = mul nsw i32 %1, 1000000
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int multiplicar(int a, int b) {
  a *= b;
  printf("\nLa multiplicacion es: %d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<multiplicar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplicar>:
push   %rax
imul   %edi,%esi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\0ALa multiplicacion es: %d\0A\00"
define i32 @multiplicar(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 = load i32, i32* %3
%7 = mul nsw i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0ALa multiplicacion es: %d\0A\00"
define i32 @multiplicar(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *argv0) {
  printf("Usage: %s <polar list filename>\n", argv0);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: %s <polar list filename>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"Usage: %s <polar list filename>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void transfer_VYU888_to_YUVA8888(unsigned char *(*output),
                                 unsigned char *input) {
  (*output)[0] = input[1];
  (*output)[1] = input[2];
  (*output)[2] = input[0];
  (*output)[3] = 0xff;
  (*output) += 4;
}


x86 assembly (clang, -O0):
<transfer_VYU888_to_YUVA8888>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movb   $0xff,0x3(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_VYU888_to_YUVA8888>:
mov    0x1(%rsi),%al
mov    (%rdi),%rcx
mov    %al,(%rcx)
mov    0x2(%rsi),%al
mov    (%rdi),%rcx
mov    %al,0x1(%rcx)
mov    (%rsi),%al
mov    (%rdi),%rcx
mov    %al,0x2(%rcx)
mov    (%rdi),%rax
movb   $0xff,0x3(%rax)
addq   $0x4,(%rdi)
ret

LLVM IR (-O0):
define void @transfer_VYU888_to_YUVA8888(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %7, i8* %10
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 2
%13 = load i8, i8* %12
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %13, i8* %16
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = load i8**, i8*** %3
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %19, i8* %22
%23 = load i8**, i8*** %3
%24 = load i8*, i8** %23
%25 = getelementptr inbounds i8, i8* %24, i64 3
store i8 -1, i8* %25
%26 = load i8**, i8*** %3
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8, i8* %27, i64 4
store i8* %28, i8** %26
ret void
}

LLVM IR (-O2):
define void @transfer_VYU888_to_YUVA8888(i8** nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %3
%5 = load i8*, i8** %0
store i8 %4, i8* %5
%6 = getelementptr inbounds i8, i8* %1, i64 2
%7 = load i8, i8* %6
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %7, i8* %9
%10 = load i8, i8* %1
%11 = load i8*, i8** %0
%12 = getelementptr inbounds i8, i8* %11, i64 2
store i8 %10, i8* %12
%13 = load i8*, i8** %0
%14 = getelementptr inbounds i8, i8* %13, i64 3
store i8 -1, i8* %14
%15 = load i8*, i8** %0
%16 = getelementptr inbounds i8, i8* %15, i64 4
store i8* %16, i8** %0
ret void
}
void AlarmToTimerC$0$Timer$stop(void) { AlarmToTimerC$0$Alarm$stop(); }


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

x86 assembly (clang, -O2):
<AlarmToTimerC$0$Timer$stop>:
xor    %eax,%eax
jmp    1030 <AlarmToTimerC$0$Alarm$stop@plt>

LLVM IR (-O0):
define void @"AlarmToTimerC$0$Timer$stop"() {
%1 = call i32 (...) @"AlarmToTimerC$0$Alarm$stop"()
ret void
}

LLVM IR (-O2):
define void @"AlarmToTimerC$0$Timer$stop"() {
%1 = tail call i32 (...) @"AlarmToTimerC$0$Alarm$stop"()
ret void
}
double gamma(double number) {
  double sum = 1;
  for (unsigned int i = 1; i < number; i++) {
    sum *= i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<gamma>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cvtsi2sd %rax,%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1154 <gamma+0x54>
mov    -0x14(%rbp),%eax
cvtsi2sd %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111d <gamma+0x1d>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1137 <gamma+0x37>
movsd  0xeea(%rip),%xmm2
mov    $0x2,%eax
movapd %xmm2,%xmm1
nop
mulsd  %xmm2,%xmm1
mov    %eax,%ecx
xorps  %xmm2,%xmm2
cvtsi2sd %rcx,%xmm2
add    $0x1,%eax
ucomisd %xmm2,%xmm0
ja     1120 <gamma+0x20>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @gamma(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %2
store double 1.000000e+00, double* %3
store i32 1, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %4
%7 = uitofp i32 %6 to double
%8 = load double, double* %2
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i32, i32* %4
%12 = uitofp i32 %11 to double
%13 = load double, double* %3
%14 = fmul double %13, %12
store double %14, double* %3
br label %15
15: ; preds = %10
%16 = load i32, i32* %4
%17 = add i32 %16, 1
store i32 %17, i32* %4
br label %5
18: ; preds = %5
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @gamma(double %0) {
%2 = fcmp ogt double %0, 1.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %5, %1
%4 = phi double [ 1.000000e+00, %1 ], [ %9, %5 ]
ret double %4
5: ; preds = %1, %5
%6 = phi double [ %11, %5 ], [ 1.000000e+00, %1 ]
%7 = phi i32 [ %10, %5 ], [ 1, %1 ]
%8 = phi double [ %9, %5 ], [ 1.000000e+00, %1 ]
%9 = fmul double %8, %6
%10 = add i32 %7, 1
%11 = uitofp i32 %10 to double
%12 = fcmp olt double %11, %0
br i1 %12, label %5, label %3
}
/* Variables and functions */
int __unimplemented_syscall(char *);
int __umount(void) { return __unimplemented_syscall("umount"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"umount\00"
define i32 @__umount() {
%1 = tail call i32 @__unimplemented_syscall(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void dummy_mem_man(void) {}


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

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

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

LLVM IR (-O2):
define void @dummy_mem_man() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ glutTimerFunc(int, void (*)(int), int);
void timer(int dt) {
  glutPostRedisplay();
  glutTimerFunc(dt, timer, dt);
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    0x2ea1(%rip),%rsi
call   1030 <glutTimerFunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <glutPostRedisplay@plt>
mov    0x2eaf(%rip),%rsi
mov    %ebx,%edi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <glutTimerFunc@plt>

LLVM IR (-O0):
define void @timer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @glutPostRedisplay()
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @glutTimerFunc(i32 %4, void (i32)* @timer, i32 %5)
ret void
}

LLVM IR (-O2):
define void @timer(i32 %0) {
%2 = tail call i32 (...) @glutPostRedisplay()
%3 = tail call i32 @glutTimerFunc(i32 %0, void (i32)* @timer, i32 %0)
ret void
}
int cmp_int(int check, int baseline) {
  return (((((check)) <= ((baseline)))
               ? ((((check)) < ((baseline))) ? ((-1)) : ((0)))
               : ((1))));
}


x86 assembly (clang, -O0):
<cmp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1130 <cmp_int+0x30>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <cmp_int+0x3d>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <cmp_int+0x3d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int>:
xor    %ecx,%ecx
cmp    %esi,%edi
setl   %cl
neg    %ecx
cmp    %esi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_int(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 = icmp sle i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -1, i32 0
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %8
%16 = phi i32 [ %13, %8 ], [ 1, %14 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @cmp_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = icmp slt i32 %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ accel_x();
int /*<<< orphan*/ accel_y();
int /*<<< orphan*/ accel_z();
scalar_t__ pow(int /*<<< orphan*/, int);
float sqrt(scalar_t__);
float accel_mag() {
  return sqrt(pow(accel_x(), 2) + pow(accel_y(), 2) + pow(accel_z(), 2));
}


x86 assembly (clang, -O0):
<accel_mag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1070 <accel_x@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <accel_y@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <accel_z@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1050 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accel_mag>:
push   %rbx
xor    %eax,%eax
call   1070 <accel_x@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <accel_y@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
add    %rax,%rbx
xor    %eax,%eax
call   1060 <accel_z@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <sqrt@plt>

LLVM IR (-O0):
define float @accel_mag() {
%1 = call i32 (...) @accel_x()
%2 = call i64 @pow(i32 %1, i32 2)
%3 = call i32 (...) @accel_y()
%4 = call i64 @pow(i32 %3, i32 2)
%5 = add nsw i64 %2, %4
%6 = call i32 (...) @accel_z()
%7 = call i64 @pow(i32 %6, i32 2)
%8 = add nsw i64 %5, %7
%9 = call float @sqrt(i64 %8)
ret float %9
}

LLVM IR (-O2):
define float @accel_mag() {
%1 = tail call i32 (...) @accel_x()
%2 = tail call i64 @pow(i32 %1, i32 2)
%3 = tail call i32 (...) @accel_y()
%4 = tail call i64 @pow(i32 %3, i32 2)
%5 = add nsw i64 %4, %2
%6 = tail call i32 (...) @accel_z()
%7 = tail call i64 @pow(i32 %6, i32 2)
%8 = add nsw i64 %5, %7
%9 = tail call float @sqrt(i64 %8)
ret float %9
}
int stat(s, b)
char *s;
struct stat *b;
{
  return (0);
}


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @stat(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1) {
ret i32 0
}
unsigned short ShortToHost(unsigned short shortword) { return shortword; }


x86 assembly (clang, -O0):
<ShortToHost>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShortToHost>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @ShortToHost(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @ShortToHost(i16 returned zeroext %0) {
ret i16 %0
}
void EVP_PKEY_get_attr_count(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_PKEY_get_attr_count() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void memcpy_s(void *dest, size_t numberOfElements, const void *src,
              size_t count) {
  memcpy(dest, src, count);
}


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

x86 assembly (clang, -O2):
<memcpy_s>:
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @memcpy_s(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 @memcpy(i8* %0, i8* %2, i64 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_wait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
int pwait_event(pthread_cond_t *cond, pthread_mutex_t *mtx) {
  int ret;
  pthread_mutex_lock(mtx);
  ret = pthread_cond_wait(cond, mtx);
  pthread_mutex_unlock(mtx);
  return ret;
}


x86 assembly (clang, -O0):
<pwait_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pthread_cond_wait@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwait_event>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <pthread_mutex_lock@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <pthread_cond_wait@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pwait_event(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = call i32 @pthread_mutex_lock(i32* %6)
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @pthread_cond_wait(i32* %8, i32* %9)
store i32 %10, i32* %5
%11 = load i32*, i32** %4
%12 = call i32 @pthread_mutex_unlock(i32* %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @pwait_event(i32* %0, i32* %1) {
%3 = tail call i32 @pthread_mutex_lock(i32* %1)
%4 = tail call i32 @pthread_cond_wait(i32* %0, i32* %1)
%5 = tail call i32 @pthread_mutex_unlock(i32* %1)
ret i32 %4
}
int main(int argc, char const *argv[]) {
  char *str = "hello";
  int array[2][5];
  int arraya[10];
  int *p = arraya;
  int *pa = &arraya;
  printf("%s\n", str);
  printf("%d %d %d %d\n", sizeof(array), sizeof(&array), sizeof(*p),
         sizeof(*pa));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    -0x70(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
mov    $0x28,%esi
mov    $0x8,%edx
mov    $0x4,%r8d
mov    %r8,%rcx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed2(%rip),%rdi
mov    $0x28,%esi
mov    $0x8,%edx
mov    $0x4,%ecx
mov    $0x4,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.2 = [13 x i8] c"%d %d %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 40, i64 8, i64 4, i64 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_dvector(int *v, int nl) { free((char *)(v + nl)); }


x86 assembly (clang, -O0):
<free_dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dvector>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_dvector(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = bitcast i32* %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @free_dvector(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void setup() {
  time_t t;
  srand((unsigned)time(&t));
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @setup() {
%1 = alloca i32
%2 = call i64 @time(i32* %1)
%3 = trunc i64 %2 to i32
%4 = call i32 @srand(i32 %3)
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @time(i32* %1)
%4 = trunc i64 %3 to i32
%5 = call i32 @srand(i32 %4)
ret void
}
void (*setsignal(int sig, void (*func)(int)))(int) {
  return (signal(sig, func));
}


x86 assembly (clang, -O0):
<setsignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <signal@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void (i32)* @setsignal(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%5 = load i32, i32* %3
%6 = load void (i32)*, void (i32)** %4
%7 = call i32 (i32, void (i32)*, ...) bitcast (i32 (...)* @signal to i32 (i32, void (i32)*, ...)*)(i32 %5, void (i32)* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to void (i32)*
ret void (i32)* %9
}

LLVM IR (-O2):
define void (i32)* @setsignal(i32 %0, void (i32)* %1) {
%3 = tail call i32 (i32, void (i32)*, ...) bitcast (i32 (...)* @signal to i32 (i32, void (i32)*, ...)*)(i32 %0, void (i32)* %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to void (i32)*
ret void (i32)* %5
}
int luaO_int2fb(unsigned int x) {
  int m = 0;
  while (x >= (1 << 3)) {
    x = (x + 1) >> 1;
    m++;
  }
  return (m << 3) | ((int)(x));
}


x86 assembly (clang, -O0):
<luaO_int2fb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x4(%rbp)
jb     1132 <luaO_int2fb+0x32>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <luaO_int2fb+0xe>
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
or     -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaO_int2fb>:
xor    %ecx,%ecx
cmp    $0x8,%edi
jb     1124 <luaO_int2fb+0x24>
xor    %ecx,%ecx
nopl   0x0(%rax)
add    $0x1,%edi
mov    %edi,%eax
shr    %eax
add    $0x8,%ecx
cmp    $0xf,%edi
mov    %eax,%edi
ja     1110 <luaO_int2fb+0x10>
or     %ecx,%eax
ret
mov    %edi,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @luaO_int2fb(i32 %0) {
%2 = icmp ugt i32 %0, 7
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, 1
%7 = lshr i32 %6, 1
%8 = add nuw nsw i32 %4, 1
%9 = icmp ugt i32 %6, 15
br i1 %9, label %3, label %10
10: ; preds = %3
%11 = shl i32 %8, 3
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ %0, %1 ], [ %7, %10 ]
%14 = phi i32 [ 0, %1 ], [ %11, %10 ]
%15 = or i32 %14, %13
ret i32 %15
}
/* Variables and functions */
unsigned long long __blsi_u64(unsigned long long);
unsigned long long func_blsi64(unsigned long long X) { return __blsi_u64(X); }


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

x86 assembly (clang, -O2):
<func_blsi64>:
jmp    1030 <__blsi_u64@plt>

LLVM IR (-O0):
define i64 @func_blsi64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @__blsi_u64(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @func_blsi64(i64 %0) {
%2 = tail call i64 @__blsi_u64(i64 %0)
ret i64 %2
}
void pr8183(unsigned long long test) {
  (void)((((void *)0)) && (*((unsigned long long *)(((void *)0))) =
                               ((unsigned long long)((test)) %
                                (unsigned long long)((1000000000)))));
  (*((unsigned long long *)(((void *)0))) =
       ((unsigned long long)((test)) % (unsigned long long)((1000000000))));
}


x86 assembly (clang, -O0):
<pr8183>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
test   $0x1,%al
mov    %al,-0x9(%rbp)
jne    111a <pr8183+0x1a>
jmp    1137 <pr8183+0x37>
mov    -0x8(%rbp),%rax
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %rcx
xor    %eax,%eax
mov    %rdx,(%rax)
cmp    $0x0,%rdx
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rax
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %rcx
xor    %eax,%eax
mov    %rdx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @pr8183(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br i1 false, label %3, label %7
3: ; preds = %1
%4 = load i64, i64* %2
%5 = urem i64 %4, 1000000000
store i64 %5, i64* null
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %3, %1
%8 = phi i1 [ false, %1 ], [ %6, %3 ]
%9 = zext i1 %8 to i32
%10 = load i64, i64* %2
%11 = urem i64 %10, 1000000000
store i64 %11, i64* null
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int yylex();
int main(void) {
  int ntoken, vtoken;
  ntoken = yylex();
  while (ntoken) {
    printf("%d \n", ntoken);
    ntoken = yylex();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <yylex@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1161 <main+0x41>
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <yylex@plt>
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <yylex@plt>
test   %eax,%eax
je     1155 <main+0x35>
lea    0xecd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <yylex@plt>
test   %eax,%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = tail call i32 (...) @yylex()
%2 = icmp eq i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @yylex()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
char *getenv(char const *);
int /*<<< orphan*/ sscanf(char const *, char *, int *);
int configint(const char *name, int fallback) {
  const char *str = getenv(name);
  int value = fallback;
  if (str) {
    sscanf(str, "%d", &value);
  }
  return value;
}


x86 assembly (clang, -O0):
<configint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <configint+0x41>
mov    -0x18(%rbp),%rdi
lea    0xea8(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configint>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
call   1030 <getenv@plt>
mov    %ebx,0xc(%rsp)
test   %rax,%rax
je     114d <configint+0x2d>
lea    0xec4(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1040 <sscanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @configint(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i8* @getenv(i8* %7)
store i8* %8, i8** %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
br label %15
15: ; preds = %12, %2
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @configint(i8* nocapture %0, i32 %1) {
%3 = alloca i32
%4 = tail call i8* @getenv(i8* %0)
%5 = bitcast i32* %3 to i8*
store i32 %1, i32* %3
%6 = icmp eq i8* %4, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
br label %10
10: ; preds = %7, %2
%11 = phi i32 [ %9, %7 ], [ %1, %2 ]
ret i32 %11
}
/* Variables and functions */
int fn_sq_ch_72_ch_97_ch_115_ch_75_ch_101_ch_121(char const *);
int fn_al_sq_ch_72_ch_97_ch_115_ch_75_ch_101_ch_121(const char *text) {
  int pos = 0;
  pos = fn_sq_ch_72_ch_97_ch_115_ch_75_ch_101_ch_121(text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_72_ch_97_ch_115_ch_75_ch_101_ch_121>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_72_ch_97_ch_115_ch_75_ch_101_ch_121@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_72_ch_97_ch_115_ch_75_ch_101_ch_121+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_72_ch_97_ch_115_ch_75_ch_101_ch_121+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_72_ch_97_ch_115_ch_75_ch_101_ch_121>:
jmp    1030 <fn_sq_ch_72_ch_97_ch_115_ch_75_ch_101_ch_121@plt>

LLVM IR (-O0):
define i32 @fn_al_sq_ch_72_ch_97_ch_115_ch_75_ch_101_ch_121(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @fn_sq_ch_72_ch_97_ch_115_ch_75_ch_101_ch_121(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @fn_al_sq_ch_72_ch_97_ch_115_ch_75_ch_101_ch_121(i8* %0) {
%2 = tail call i32 @fn_sq_ch_72_ch_97_ch_115_ch_75_ch_101_ch_121(i8* %0)
ret i32 %2
}
void core_unload(void) {}


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

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

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

LLVM IR (-O2):
define void @core_unload() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *getenv(char *);
int cgiIsCGI(void) {
  return ((getenv("HTTP_HOST") != NULL) || (getenv("HTTP_USER_AGENT") != NULL));
}


x86 assembly (clang, -O0):
<cgiIsCGI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    114c <cgiIsCGI+0x3c>
lea    0xecd(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiIsCGI>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     112c <cgiIsCGI+0x1c>
pop    %rcx
ret
lea    0xed7(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"HTTP_HOST\00"
@.str.1 = [16 x i8] c"HTTP_USER_AGENT\00"
define i32 @cgiIsCGI() {
%1 = call i32* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i32* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i32* %4, null
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ true, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [10 x i8] c"HTTP_HOST\00"
@.str.1 = [16 x i8] c"HTTP_USER_AGENT\00"
define i32 @cgiIsCGI() {
%1 = tail call i32* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  int dummy;
};

/* Variables and functions */
int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize,
               struct passwd **result) {
  return 0;
}


x86 assembly (clang, -O0):
<getpwuid_r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i32 @getpwuid_r(i32 %0, %struct.passwd* %1, i8* %2, i64 %3, %struct.passwd** %4) {
%6 = alloca i32
%7 = alloca %struct.passwd*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca %struct.passwd**
store i32 %0, i32* %6
store %struct.passwd* %1, %struct.passwd** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store %struct.passwd** %4, %struct.passwd*** %10
ret i32 0
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i32 @getpwuid_r(i32 %0, %struct.passwd* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, %struct.passwd** nocapture readnone %4) {
ret i32 0
}
void Hal_hook_wr_sgndrecfield_recelema(void) {}


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

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

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

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

/* Variables and functions */
int midi_cmd_size(uint8_t cmd) {
  static const int sizes[] = {3, 3, 3, 3, 2, 2, 3, 1};
  if (cmd < 128)
    return 0;
  return sizes[(cmd >> 4) - 8];
}


x86 assembly (clang, -O0):
<midi_cmd_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    1120 <midi_cmd_size+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1139 <midi_cmd_size+0x39>
mov    -0x8(%rbp),%eax
sar    $0x4,%eax
sub    $0x8,%eax
movslq %eax,%rcx
lea    0xecd(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<midi_cmd_size>:
xor    %eax,%eax
cmp    $0x80,%edi
jl     111a <midi_cmd_size+0x1a>
shr    $0x4,%edi
add    $0xfffffff8,%edi
lea    0xee9(%rip),%rax
mov    (%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
@midi_cmd_size.sizes = internal constant [8 x i32] [i32 3, i32 3, i32 3, i32 3, i32 2, i32 2, i32 3, i32 1]
define i32 @midi_cmd_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %14
7: ; preds = %1
%8 = load i32, i32* %3
%9 = ashr i32 %8, 4
%10 = sub nsw i32 %9, 8
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [8 x i32], [8 x i32]* @midi_cmd_size.sizes, i64 0, i64 %11
%13 = load i32, i32* %12
store i32 %13, i32* %2
br label %14
14: ; preds = %7, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@midi_cmd_size.sizes = internal unnamed_addr constant [8 x i32] [i32 3, i32 3, i32 3, i32 3, i32 2, i32 2, i32 3, i32 1]
define i32 @midi_cmd_size(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = lshr i32 %0, 4
%5 = add nsw i32 %4, -8
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* @midi_cmd_size.sizes, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ 0, %1 ]
ret i32 %10
}