xunge/DecIR huggingface dataset:
void uwsgi_opt_set_str(char *opt, char *value, void *key) {
  char **ptr = (char **)key;
  if (!value) {
    *ptr = "";
    return;
  }
  *ptr = (char *)value;
}


x86 assembly (clang, -O0):
<uwsgi_opt_set_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <uwsgi_opt_set_str+0x36>
mov    -0x20(%rbp),%rax
lea    0xed2(%rip),%rcx
mov    %rcx,(%rax)
jmp    1141 <uwsgi_opt_set_str+0x41>
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_opt_set_str>:
test   %rsi,%rsi
lea    0xef6(%rip),%rax
cmovne %rsi,%rax
mov    %rax,(%rdx)
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @uwsgi_opt_set_str(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8**
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to i8**
store i8** %9, i8*** %7
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %3
%13 = load i8**, i8*** %7
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %13
br label %17
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load i8**, i8*** %7
store i8* %15, i8** %16
br label %17
17: ; preds = %14, %12
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @uwsgi_opt_set_str(i8* nocapture readnone %0, i8* %1, i8* nocapture writeonly %2) {
%4 = icmp eq i8* %1, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%6 = bitcast i8* %2 to i8**
store i8* %5, i8** %6
ret void
}
int and6(int a) { return (a & 1) != 0; }


x86 assembly (clang, -O0):
<and6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @and6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @and6(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
float setArray(float *a, float x, int k) {
  a[k] = a[k] + x;
  return a[k];
}


x86 assembly (clang, -O0):
<setArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<setArray>:
movslq %esi,%rax
addss  (%rdi,%rax,4),%xmm0
movss  %xmm0,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define float @setArray(float* %0, float %1, i32 %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca i32
store float* %0, float** %4
store float %1, float* %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds float, float* %7, i64 %9
%11 = load float, float* %10
%12 = load float, float* %5
%13 = fadd float %11, %12
%14 = load float*, float** %4
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds float, float* %14, i64 %16
store float %13, float* %17
%18 = load float*, float** %4
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %18, i64 %20
%22 = load float, float* %21
ret float %22
}

LLVM IR (-O2):
define float @setArray(float* nocapture %0, float %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds float, float* %0, i64 %4
%6 = load float, float* %5
%7 = fadd float %6, %1
store float %7, float* %5
ret float %7
}
int execute_signalfd() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_signalfd() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glutMainLoop();
void run() { glutMainLoop(); }


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

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

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

LLVM IR (-O2):
define void @run() {
%1 = tail call i32 (...) @glutMainLoop()
ret void
}
/* Variables and functions */
int read(int /*<<< orphan*/);
int KEYPAD_Hit(void) { return read(0) == -1 ? 0 : 1; }


x86 assembly (clang, -O0):
<KEYPAD_Hit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <read@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<KEYPAD_Hit>:
push   %rax
xor    %edi,%edi
call   1030 <read@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @KEYPAD_Hit() {
%1 = call i32 @read(i32 0)
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 0, i32 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @KEYPAD_Hit() {
%1 = tail call i32 @read(i32 0)
%2 = icmp ne i32 %1, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double vec4d_norm(double *);
int /*<<< orphan*/ vec4d_scalarDiv(double *, double);
void vec4d_normalize(double v[4]) {
  double len = vec4d_norm(v);
  vec4d_scalarDiv(v, len);
}


x86 assembly (clang, -O0):
<vec4d_normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <vec4d_norm@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1030 <vec4d_scalarDiv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4d_normalize>:
push   %rbx
mov    %rdi,%rbx
call   1040 <vec4d_norm@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <vec4d_scalarDiv@plt>

LLVM IR (-O0):
define void @vec4d_normalize(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = call double @vec4d_norm(double* %4)
store double %5, double* %3
%6 = load double*, double** %2
%7 = load double, double* %3
%8 = call i32 @vec4d_scalarDiv(double* %6, double %7)
ret void
}

LLVM IR (-O2):
define void @vec4d_normalize(double* %0) {
%2 = tail call double @vec4d_norm(double* %0)
%3 = tail call i32 @vec4d_scalarDiv(double* %0, double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  int soma = 17, contagem = 5;
  double media;
  media = (double)soma / contagem;
  printf("media = %f\n", media);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"media = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 0, i32* %1
store i32 17, i32* %2
store i32 5, i32* %3
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = fdiv double %6, %8
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"media = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double 3.400000e+00)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_mem;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void callback(cl_mem memobj, void *user_data) {
  if (user_data == (void *)0xDEADBEEF)
    printf("OK\n");
  else
    printf("FAIL\n");
}


x86 assembly (clang, -O0):
<callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xdeadbeef,%eax
cmp    %rax,-0x10(%rbp)
jne    113f <callback+0x2f>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
jmp    114b <callback+0x3b>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback>:
mov    $0xdeadbeef,%eax
cmp    %rax,%rsi
lea    0xee6(%rip),%rax
lea    0xeda(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [5 x i8] c"FAIL\00"
@str.2 = [3 x i8] c"OK\00"
define void @callback(i32 %0, i8* readnone %1) {
%3 = icmp eq i8* %1, inttoptr (i64 3735928559 to i8*)
%4 = select i1 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
/* Variables and functions */
int strlen(char *pText) {
  int len = 0;
  for (; *pText != '\0'; pText++, len++)
    ;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113e <strlen+0x3e>
jmp    1124 <strlen+0x24>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %4
br label %10
10: ; preds = %9
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int feldspar_ivar_hook(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @feldspar_ivar_hook() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pear() { printf("FRUIT:: This is pear !\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"FRUIT:: This is pear !\0A\00"
define void @pear() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"FRUIT:: This is pear !\00"
define void @pear() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ val;
typedef int uint16_t;

/* Variables and functions */
uint16_t __fswab16(uint16_t val) {
  return ((uint16_t)((((uint16_t)(val) & (uint16_t)0x00ffU) << 8) |
                     (((uint16_t)(val) & (uint16_t)0xff00U) >> 8)));
}


x86 assembly (clang, -O0):
<__fswab16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fswab16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @__fswab16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__fswab16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int errno;
int socket_errno() { return errno; }


x86 assembly (clang, -O0):
<socket_errno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @socket_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @socket_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}
void feed(void) {
  *(volatile unsigned int *)0xE01FC08C = 0xAA;
  *(volatile unsigned int *)0xE01FC08C = 0x55;
}


x86 assembly (clang, -O0):
<feed>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe01fc08c,%eax
movl   $0xaa,(%rax)
mov    $0xe01fc08c,%eax
movl   $0x55,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed>:
mov    $0xe01fc08c,%eax
movl   $0xaa,(%rax)
movl   $0x55,(%rax)
ret

LLVM IR (-O0):
define void @feed() {
store volatile i32 170, i32* inttoptr (i64 3760177292 to i32*)
store volatile i32 85, i32* inttoptr (i64 3760177292 to i32*)
ret void
}

LLVM IR (-O2):
define void @feed() {
store volatile i32 170, i32* inttoptr (i64 3760177292 to i32*)
store volatile i32 85, i32* inttoptr (i64 3760177292 to i32*)
ret void
}
/* Variables and functions */
char *audio_error_name_1(int);
char *audio_error_name(int err) { return (audio_error_name_1(err)); }


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

x86 assembly (clang, -O2):
<audio_error_name>:
jmp    1030 <audio_error_name_1@plt>

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

LLVM IR (-O2):
define i8* @audio_error_name(i32 %0) {
%2 = tail call i8* @audio_error_name_1(i32 %0)
ret i8* %2
}
void fix_options(request) struct request_info *request;
{}


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

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

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

LLVM IR (-O2):
%struct.request_info = type opaque
define void @fix_options(%struct.request_info* nocapture %0) {
ret void
}
void div_const2_FP(int n) {
  int a[1];
  int x = (n * 2 + 1) / 2;
  a[x] = 0;
}


x86 assembly (clang, -O0):
<div_const2_FP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
movl   $0x0,-0x8(%rbp,%rax,4)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @div_const2_FP(i32 %0) {
%2 = alloca i32
%3 = alloca [1 x i32]
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 2
%7 = add nsw i32 %6, 1
%8 = sdiv i32 %7, 2
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 %10
store i32 0, i32* %11
ret void
}

LLVM IR (-O2):
define void @div_const2_FP(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Lcd_Write_Char(char);
void Lcd_Write_String(char *a) {
  int i;
  for (i = 0; a[i] != '\0'; i++)
    Lcd_Write_Char(a[i]);
}


x86 assembly (clang, -O0):
<Lcd_Write_String>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
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     1157 <Lcd_Write_String+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <Lcd_Write_Char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <Lcd_Write_String+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lcd_Write_String>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <Lcd_Write_String+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <Lcd_Write_Char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <Lcd_Write_String+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @Lcd_Write_String(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %19, %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 %22
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 = call i32 @Lcd_Write_Char(i8 signext %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %4
22: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @Lcd_Write_String(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @Lcd_Write_Char(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int is_prime(int n) {
  int f = 2;
  while (f * f <= n) {
    if (n % f == 0)
      return 0;
    f++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1148 <is_prime+0x48>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113a <is_prime+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    114f <is_prime+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%ecx
cmp    $0x4,%edi
jl     1125 <is_prime+0x25>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1128 <is_prime+0x28>
add    $0x1,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jle    1110 <is_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %11, label %6
3: ; preds = %6
%4 = mul nsw i32 %10, %10
%5 = icmp sgt i32 %4, %0
br i1 %5, label %11, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %10, %3 ], [ 2, %1 ]
%8 = srem i32 %0, %7
%9 = icmp eq i32 %8, 0
%10 = add nuw nsw i32 %7, 1
br i1 %9, label %11, label %3
11: ; preds = %6, %3, %1
%12 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
double limit_zero2one(double);
double dayfrac_to_local_hr(double dayfrac, float timezone) {
  return 24.0 * limit_zero2one(dayfrac + timezone / 24.0);
}


x86 assembly (clang, -O0):
<dayfrac_to_local_hr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xec8(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
call   1030 <limit_zero2one@plt>
movaps %xmm0,%xmm1
movsd  0xeb0(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dayfrac_to_local_hr>:
push   %rax
cvtss2sd %xmm1,%xmm1
divsd  0xee3(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <limit_zero2one@plt>
mulsd  0xed2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dayfrac_to_local_hr(double %0, float %1) {
%3 = alloca double
%4 = alloca float
store double %0, double* %3
store float %1, float* %4
%5 = load double, double* %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fdiv double %7, 2.400000e+01
%9 = fadd double %5, %8
%10 = call double @limit_zero2one(double %9)
%11 = fmul double 2.400000e+01, %10
ret double %11
}

LLVM IR (-O2):
define double @dayfrac_to_local_hr(double %0, float %1) {
%3 = fpext float %1 to double
%4 = fdiv double %3, 2.400000e+01
%5 = fadd double %4, %0
%6 = tail call double @limit_zero2one(double %5)
%7 = fmul double %6, 2.400000e+01
ret double %7
}
/* Variables and functions */
int f210(int *);
int f211(int *p) { return f210(p); }


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

x86 assembly (clang, -O2):
<f211>:
jmp    1030 <f210@plt>

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

LLVM IR (-O2):
define i32 @f211(i32* %0) {
%2 = tail call i32 @f210(i32* %0)
ret i32 %2
}
/* Type definitions */
struct bthost {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bthost *);
void bthost_destroy(struct bthost *bthost) {
  if (!bthost)
    return;
  free(bthost);
}


x86 assembly (clang, -O0):
<bthost_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <bthost_destroy+0x1c>
jmp    1135 <bthost_destroy+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bthost_destroy>:
test   %rdi,%rdi
je     111a <bthost_destroy+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.bthost = type { i32 }
define void @bthost_destroy(%struct.bthost* %0) {
%2 = icmp eq %struct.bthost* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.bthost* %0)
br label %5
5: ; preds = %1, %3
ret void
}
__attribute__((no)) _Bool bar(void) { return foo() & 1; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <foo@plt>
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i1 @bar() {
%1 = call i32 (...) @foo()
%2 = and i32 %1, 1
%3 = icmp ne i32 %2, 0
ret i1 %3
}

LLVM IR (-O2):
define zeroext i1 @bar() {
%1 = tail call i32 (...) @foo()
%2 = and i32 %1, 1
%3 = icmp ne i32 %2, 0
ret i1 %3
}
/* Variables and functions */
int strlen(char const *string) {
  char const *p = string;
  while (*(string++) != '\0')
    ;
  return string - p - 1;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1130 <strlen+0x30>
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %5
br label %5
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = sub nsw i64 %17, 1
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *realloc(void *, int);
void *xrealloc(void *p, int n) {
  p = realloc(p, n);
  if (p == ((void *)0))
    fatal("out of memory");
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <xrealloc+0x36>
lea    0xeaf(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xrealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int check_utf8(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int check_utf8_cstr(const char *buf) { return check_utf8(buf, strlen(buf)); }


x86 assembly (clang, -O0):
<check_utf8_cstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <check_utf8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_utf8_cstr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <check_utf8@plt>

LLVM IR (-O0):
define i32 @check_utf8_cstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @check_utf8(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @check_utf8_cstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @check_utf8(i8* %0, i32 %2)
ret i32 %3
}
int isOperator(char c) {
  switch (c) {
  case '+':
  case '-':
  case '*':
  case '/':
  case '%':
  case '^':
  case '!':
  case '~':
  case '_':
  case '$':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isOperator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffdf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5d,%eax
ja     1140 <isOperator+0x40>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1147 <isOperator+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOperator>:
add    $0xffffffdf,%edi
cmp    $0x5d,%edi
ja     111e <isOperator+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isOperator(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 43, label %6
i32 45, label %6
i32 42, label %6
i32 47, label %6
i32 37, label %6
i32 94, label %6
i32 33, label %6
i32 126, label %6
i32 95, label %6
i32 36, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isOperator(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 43, label %4
i32 45, label %4
i32 42, label %4
i32 47, label %4
i32 37, label %4
i32 94, label %4
i32 33, label %4
i32 126, label %4
i32 95, label %4
i32 36, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
void glutKeyboardFunc(void (*func)(unsigned char key, int x, int y)) {}


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

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

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

LLVM IR (-O2):
define void @glutKeyboardFunc(void (i8, i32, i32)* nocapture %0) {
ret void
}
int d_le_mr2(double *a1, double a2) { return !(((*a1) <= (a2))); }


x86 assembly (clang, -O0):
<d_le_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_le_mr2>:
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setb   %al
ret

LLVM IR (-O0):
define i32 @d_le_mr2(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp ole double %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_le_mr2(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ugt double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ deserialize_end();
void banshee_deserialize_end(void) { deserialize_end(); }


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

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

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

LLVM IR (-O2):
define void @banshee_deserialize_end() {
%1 = tail call i32 (...) @deserialize_end()
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rescure(int);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("the number of args is wrong!");
    return -1;
  }
  int deep = atoi(argv[1]);
  rescure(deep);
  sleep(100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1178 <main+0x38>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a1 <main+0x61>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <rescure@plt>
mov    $0x64,%edi
call   1060 <sleep@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1159 <main+0x19>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <rescure@plt>
mov    $0x64,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"the number of args is wrong!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %19
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = call i32 @rescure(i32 %16)
%18 = call i32 @sleep(i32 100)
store i32 0, i32* %3
br label %19
19: ; preds = %11, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [29 x i8] c"the number of args is wrong!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @rescure(i32 %9)
%11 = tail call i32 @sleep(i32 100)
br label %12
12: ; preds = %6, %4
%13 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void hide_acline() {
  ;
  printf("\r");
  printf("\x1b[K");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<hide_acline>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hide_acline>:
push   %rax
mov    $0xd,%edi
call   1030 <putchar@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0D\00"
@.str.1 = [4 x i8] c"\1B[K\00"
@stdout = global i32 0
define void @hide_acline() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"\1B[K\00"
@stdout = global i32 0
define void @hide_acline() {
%1 = tail call i32 @putchar(i32 13)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
double sin(double x) {
  return ({
    extern __typeof__(sin) module_libc_sin;
    &module_libc_sin;
  })(x);
}


x86 assembly (clang, -O0):
<sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ecc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin>:
jmp    1030 <module_libc_sin@plt>

LLVM IR (-O0):
define double @sin(double %0) {
%2 = alloca double
%3 = alloca double (double)*
store double %0, double* %2
store double (double)* @module_libc_sin, double (double)** %3
%4 = load double (double)*, double (double)** %3
%5 = load double, double* %2
%6 = call double %4(double %5)
ret double %6
}

LLVM IR (-O2):
define double @sin(double %0) {
%2 = tail call double @module_libc_sin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("BOOTLOADER,DRIVER:STT30USB,VERSION:34556123\n");
  printf("BOOTLOADER,DRIVER:WINUSB,VERSION:1234556\n");
  printf("RETURN:0,Successful Operation\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"BOOTLOADER,DRIVER:STT30USB,VERSION:34556123\0A\00"
@.str.1 = [42 x i8] c"BOOTLOADER,DRIVER:WINUSB,VERSION:1234556\0A\00"
@.str.2 = [31 x i8] c"RETURN:0,Successful Operation\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [44 x i8] c"BOOTLOADER,DRIVER:STT30USB,VERSION:34556123\00"
@str.3 = [41 x i8] c"BOOTLOADER,DRIVER:WINUSB,VERSION:1234556\00"
@str.4 = [30 x i8] c"RETURN:0,Successful Operation\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct Tuple2_Bool_Int {
  int dummy;
};

/* Variables and functions */
struct Tuple2_Bool_Int *Tuple2_1(int /*<<< orphan*/, int /*<<< orphan*/);
struct Tuple2_Bool_Int *init_k() {
  return Tuple2_1(0, 0);
}


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

x86 assembly (clang, -O2):
<init_k>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <Tuple2_1@plt>

LLVM IR (-O0):
%struct.Tuple2_Bool_Int = type { i32 }
define %struct.Tuple2_Bool_Int* @init_k() {
%1 = call %struct.Tuple2_Bool_Int* @Tuple2_1(i32 0, i32 0)
ret %struct.Tuple2_Bool_Int* %1
}

LLVM IR (-O2):
%struct.Tuple2_Bool_Int = type { i32 }
define %struct.Tuple2_Bool_Int* @init_k() {
%1 = tail call %struct.Tuple2_Bool_Int* @Tuple2_1(i32 0, i32 0)
ret %struct.Tuple2_Bool_Int* %1
}
/* Variables and functions */
int func();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (func() == 2) {
    printf("Iz success.\n");
  } else {
    printf("Iz fail.\n");
    return 1;
  }
  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   1040 <func@plt>
cmp    $0x2,%eax
jne    1157 <main+0x37>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    116f <main+0x4f>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1176 <main+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <func@plt>
xor    %ebx,%ebx
cmp    $0x2,%eax
setne  %bl
lea    0xed2(%rip),%rax
lea    0xec2(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Iz success.\0A\00"
@.str.1 = [10 x i8] c"Iz fail.\0A\00"
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 (...) @func()
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %13
12: ; preds = %8
store i32 0, i32* %3
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@str = [9 x i8] c"Iz fail.\00"
@str.2 = [12 x i8] c"Iz success.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func()
%4 = icmp eq i32 %3, 2
%5 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0)
%6 = xor i1 %4, true
%7 = zext i1 %6 to i32
%8 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 %7
}
int fun1321() { return 1321; }


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

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

LLVM IR (-O0):
define i32 @fun1321() {
ret i32 1321
}

LLVM IR (-O2):
define i32 @fun1321() {
ret i32 1321
}
/* Variables and functions */
long floor(long);
long leap_days(long year) {
  long ldays;
  year -= 1;
  ldays = floor(year / 4) - floor(year / 100) + floor(year / 400);
  return (ldays);
}


x86 assembly (clang, -O0):
<leap_days>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x4,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
call   1030 <floor@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
call   1030 <floor@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x190,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
call   1030 <floor@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leap_days>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    -0x1(%rdi),%rbx
add    $0x2,%rdi
test   %rbx,%rbx
cmovns %rbx,%rdi
sar    $0x2,%rdi
call   1030 <floor@plt>
mov    %rax,%r15
movabs $0xa3d70a3d70a3d70b,%rcx
0a d7 a3
mov    %rbx,%rax
imul   %rcx
lea    (%rdx,%r14,1),%rbx
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rdi
sar    $0x6,%rdi
mov    %rbx,%r14
shr    $0x3f,%r14
add    %r14,%rdi
call   1030 <floor@plt>
sub    %rax,%r15
sar    $0x8,%rbx
add    %r14,%rbx
mov    %rbx,%rdi
call   1030 <floor@plt>
add    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @leap_days(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sub nsw i64 %4, 1
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = sdiv i64 %6, 4
%8 = call i64 @floor(i64 %7)
%9 = load i64, i64* %2
%10 = sdiv i64 %9, 100
%11 = call i64 @floor(i64 %10)
%12 = sub nsw i64 %8, %11
%13 = load i64, i64* %2
%14 = sdiv i64 %13, 400
%15 = call i64 @floor(i64 %14)
%16 = add nsw i64 %12, %15
store i64 %16, i64* %3
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @leap_days(i64 %0) {
%2 = add nsw i64 %0, -1
%3 = sdiv i64 %2, 4
%4 = tail call i64 @floor(i64 %3)
%5 = sdiv i64 %2, 100
%6 = tail call i64 @floor(i64 %5)
%7 = sub i64 %4, %6
%8 = sdiv i64 %2, 400
%9 = tail call i64 @floor(i64 %8)
%10 = add nsw i64 %7, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ MainProc();
void Run() { MainProc(); }


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

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

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

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