xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void handleKeyUp(int key, int shiftIsDown, int controlIsDown,
                 int altOptionIsDown, int superCommandIsDown) {
  printf("key up %d, shift %d, control %d, altOpt %d, supComm %d\n", key,
         shiftIsDown, controlIsDown, altOptionIsDown, superCommandIsDown);
}


x86 assembly (clang, -O0):
<handleKeyUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleKeyUp>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"key up %d, shift %d, control %d, altOpt %d, supComm %d\0A\00"
define void @handleKeyUp(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"key up %d, shift %d, control %d, altOpt %d, supComm %d\0A\00"
define void @handleKeyUp(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
scalar_t__ _mm_extract_epi32(int /*<<< orphan*/, int);
long long int foo32(__m128i x) { return (int)_mm_extract_epi32(x, 2); }


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

x86 assembly (clang, -O2):
<foo32>:
push   %rax
mov    $0x2,%esi
call   1030 <_mm_extract_epi32@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @foo32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @_mm_extract_epi32(i32 %3, i32 2)
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @foo32(i32 %0) {
%2 = tail call i64 @_mm_extract_epi32(i32 %0, i32 2)
%3 = shl i64 %2, 32
%4 = ashr exact i64 %3, 32
ret i64 %4
}
/* Variables and functions */
scalar_t__ sqrt(float);
float VecLength3iv(int v0, int v1, int v2) {
  return ((float)sqrt((float)v0 * (float)v0 + (float)v1 * (float)v1 +
                      (float)v2 * (float)v2));
}


x86 assembly (clang, -O0):
<VecLength3iv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm1
cvtsi2ssl -0x4(%rbp),%xmm2
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm3
mulss  %xmm3,%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
cvtsi2ssl -0xc(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecLength3iv>:
push   %rax
cvtsi2ss %edi,%xmm1
cvtsi2ss %esi,%xmm2
mulss  %xmm2,%xmm2
cvtsi2ss %edx,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @VecLength3iv(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to float
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to float
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to float
%13 = load i32, i32* %5
%14 = sitofp i32 %13 to float
%15 = fmul float %12, %14
%16 = call float @llvm.fmuladd.f32(float %8, float %10, float %15)
%17 = load i32, i32* %6
%18 = sitofp i32 %17 to float
%19 = load i32, i32* %6
%20 = sitofp i32 %19 to float
%21 = call float @llvm.fmuladd.f32(float %18, float %20, float %16)
%22 = call i64 @sqrt(float %21)
%23 = sitofp i64 %22 to float
ret float %23
}

LLVM IR (-O2):
define float @VecLength3iv(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to float
%5 = sitofp i32 %1 to float
%6 = fmul float %5, %5
%7 = tail call float @llvm.fmuladd.f32(float %4, float %4, float %6)
%8 = sitofp i32 %2 to float
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %7)
%10 = tail call i64 @sqrt(float %9)
%11 = sitofp i64 %10 to float
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Minimalistic STUN client v%s\n", "0.4");
  fprintf(stderr,
          "Usage: %s [-t timeout ms] [-c count] [-l local ip] [-d] "
          "[stun_server[:port]]\n",
          "ministun");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
lea    0xeeb(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
lea    0xf21(%rip),%rdx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
lea    0xef6(%rip),%rdx
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeec(%rip),%rsi
lea    0xf33(%rip),%rdx
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Minimalistic STUN client v%s\0A\00"
@.str.1 = [4 x i8] c"0.4\00"
@.str.2 = [78 x i8] c"Usage: %s [-t timeout ms] [-c count] [-l local ip] [-d] [stun_server[:port]]\0A\00"
@.str.3 = [9 x i8] c"ministun\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Minimalistic STUN client v%s\0A\00"
@.str.1 = [4 x i8] c"0.4\00"
@.str.2 = [78 x i8] c"Usage: %s [-t timeout ms] [-c count] [-l local ip] [-d] [stun_server[:port]]\0A\00"
@.str.3 = [9 x i8] c"ministun\00"
define void @usage(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mem_warn(char *, int, int);
int willus_mem_realloc_robust(double **, int, int, char *);
int willus_mem_realloc_robust_warn(void **ptr, int newsize, int oldsize,
                                   char *name, int exitcode) {
  int status;
  status = willus_mem_realloc_robust((double **)ptr, newsize, oldsize, name);
  if (!status)
    mem_warn(name, newsize, exitcode);
  return (status);
}


x86 assembly (clang, -O0):
<willus_mem_realloc_robust_warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <willus_mem_realloc_robust@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1169 <willus_mem_realloc_robust_warn+0x49>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <mem_warn@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<willus_mem_realloc_robust_warn>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %esi,%ebp
call   1040 <willus_mem_realloc_robust@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1147 <willus_mem_realloc_robust_warn+0x27>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <mem_warn@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @willus_mem_realloc_robust_warn(i8** %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i8** %0, i8*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = load i8**, i8*** %6
%13 = bitcast i8** %12 to double**
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = load i8*, i8** %9
%17 = call i32 @willus_mem_realloc_robust(double** %13, i32 %14, i32 %15, i8* %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = icmp ne i32 %18, 0
br i1 %19, label %25, label %20
20: ; preds = %5
%21 = load i8*, i8** %9
%22 = load i32, i32* %7
%23 = load i32, i32* %10
%24 = call i32 @mem_warn(i8* %21, i32 %22, i32 %23)
br label %25
25: ; preds = %20, %5
%26 = load i32, i32* %11
ret i32 %26
}

LLVM IR (-O2):
define i32 @willus_mem_realloc_robust_warn(i8** %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = bitcast i8** %0 to double**
%7 = tail call i32 @willus_mem_realloc_robust(double** %6, i32 %1, i32 %2, i8* %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @mem_warn(i8* %3, i32 %1, i32 %4)
br label %11
11: ; preds = %9, %5
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int hashtable_eqfn_uint64(void *k1, void *k2) {
  uint64_t i1 = *((uint64_t *)k1);
  uint64_t i2 = *((uint64_t *)k2);
  return (i1 == i2);
}


x86 assembly (clang, -O0):
<hashtable_eqfn_uint64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashtable_eqfn_uint64>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @hashtable_eqfn_uint64(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp eq i64 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @hashtable_eqfn_uint64(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int ECHILD;
int sys_waitpid(int, int /*<<< orphan*/ *);
int sys_waitanychild(void) {
  int err;
  for (;;) {
    err = sys_waitpid(-1, NULL);
    if (err) {
      if (err == -ECHILD)
        break;
      return err;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<sys_waitanychild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <sys_waitpid@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1159 <sys_waitanychild+0x49>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
mov    0x2ea1(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
jne    114e <sys_waitanychild+0x3e>
jmp    115e <sys_waitanychild+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <sys_waitanychild+0x55>
jmp    1118 <sys_waitanychild+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_waitanychild>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <sys_waitpid@plt>
test   %eax,%eax
je     1120 <sys_waitanychild+0x10>
mov    0x2ea9(%rip),%rdx
xor    %ecx,%ecx
mov    (%rdx),%edx
add    %eax,%edx
cmovne %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ECHILD = global i32 0
define i32 @sys_waitanychild() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %15, %0
%4 = call i32 @sys_waitpid(i32 -1, i32* null)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = load i32, i32* %2
%9 = load i32, i32* @ECHILD
%10 = sub nsw i32 0, %9
%11 = icmp eq i32 %8, %10
br i1 %11, label %12, label %13
12: ; preds = %7
br label %16
13: ; preds = %7
%14 = load i32, i32* %2
store i32 %14, i32* %1
br label %17
15: ; preds = %3
br label %3
16: ; preds = %12
store i32 0, i32* %1
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@ECHILD = global i32 0
define i32 @sys_waitanychild() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @sys_waitpid(i32 -1, i32* null)
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = load i32, i32* @ECHILD
%6 = sub nsw i32 0, %5
%7 = icmp eq i32 %2, %6
%8 = select i1 %7, i32 0, i32 %2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int myFunc(int a, int b) {
  printf("The sum is %d\n", a + b);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"The sum is %d\0A\00"
define i32 @myFunc(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 = add nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"The sum is %d\0A\00"
define i32 @myFunc(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void *check_mem(char *data, int *data_size, int data2_size) {
  int data_length = strlen(data);
  int data_avail = *data_size - data_length;
  int mem_avail = data_avail - data2_size;
  if (mem_avail > 0) {
    return data;
  } else {
    *data_size = *data_size * 2;
    return realloc(data, *data_size);
  }
}


x86 assembly (clang, -O0):
<check_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jle    116b <check_mem+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118e <check_mem+0x6e>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq (%rax),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_mem>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq (%r14),%rsi
add    %ebp,%eax
mov    %esi,%ecx
sub    %eax,%ecx
test   %ecx,%ecx
jle    1146 <check_mem+0x26>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret
add    %rsi,%rsi
mov    %esi,(%r14)
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <realloc@plt>

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

LLVM IR (-O2):
define i8* @check_mem(i8* %0, i32* nocapture %1, i32 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = trunc i64 %4 to i32
%6 = load i32, i32* %1
%7 = add i32 %5, %2
%8 = sub i32 %6, %7
%9 = icmp sgt i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = shl nsw i32 %6, 1
store i32 %11, i32* %1
%12 = sext i32 %11 to i64
%13 = tail call i8* @realloc(i8* %0, i64 %12)
br label %14
14: ; preds = %3, %10
%15 = phi i8* [ %13, %10 ], [ %0, %3 ]
ret i8* %15
}
int foo(int y, int z) { return 0; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int LZ4_compress_limitedOutput_withState(void *, char const *, char *, int,
                                         int);
int LZ4F_localLZ4_compress_limitedOutput_withState(void *ctx, const char *src,
                                                   char *dst, int srcSize,
                                                   int dstSize, int level) {
  (void)level;
  return LZ4_compress_limitedOutput_withState(ctx, src, dst, srcSize, dstSize);
}


x86 assembly (clang, -O0):
<LZ4F_localLZ4_compress_limitedOutput_withState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1030 <LZ4_compress_limitedOutput_withState@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4F_localLZ4_compress_limitedOutput_withState>:
jmp    1030 <LZ4_compress_limitedOutput_withState@plt>

LLVM IR (-O0):
define i32 @LZ4F_localLZ4_compress_limitedOutput_withState(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %12
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = call i32 @LZ4_compress_limitedOutput_withState(i8* %14, i8* %15, i8* %16, i32 %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @LZ4F_localLZ4_compress_limitedOutput_withState(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @LZ4_compress_limitedOutput_withState(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(int *, int, int, int /*<<< orphan*/ *);
int htonl(int);
char svd_writeBinFloat(FILE *file, float r) {
  int y = htonl(*((int *)&r));
  if (fwrite(&y, sizeof(int), 1, file) != 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<svd_writeBinFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
cmp    $0x1,%eax
je     1165 <svd_writeBinFloat+0x45>
movb   $0x1,-0x1(%rbp)
jmp    1169 <svd_writeBinFloat+0x49>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svd_writeBinFloat>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movd   %xmm0,%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
cmp    $0x1,%eax
setne  %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @svd_writeBinFloat(i32* %0, float %1) {
%3 = alloca i8
%4 = alloca i32*
%5 = alloca float
%6 = alloca i32
store i32* %0, i32** %4
store float %1, float* %5
%7 = bitcast float* %5 to i32*
%8 = load i32, i32* %7
%9 = call i32 @htonl(i32 %8)
store i32 %9, i32* %6
%10 = load i32*, i32** %4
%11 = call i32 @fwrite(i32* %6, i32 4, i32 1, i32* %10)
%12 = icmp ne i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %2
store i8 1, i8* %3
br label %15
14: ; preds = %2
store i8 0, i8* %3
br label %15
15: ; preds = %14, %13
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @svd_writeBinFloat(i32* nocapture %0, float %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = bitcast float %1 to i32
%6 = tail call i32 @htonl(i32 %5)
store i32 %6, i32* %3
%7 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
%8 = icmp ne i32 %7, 1
%9 = zext i1 %8 to i8
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Column A\tColumn B\tColumn C");
  printf("\nMy Computer\'s Beep doesn\'t work: \a!\n");
  printf("\"Letz\bs fix that typo and then show the backslash ");
  printf("character \\\" she said\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    0xee9(%rip),%rdi
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"Column A\09Column B\09Column C\00"
@.str.1 = [38 x i8] c"\0AMy Computer's Beep doesn't work: \07!\0A\00"
@.str.2 = [51 x i8] c"\22Letz\08s fix that typo and then show the backslash \00"
@.str.3 = [23 x i8] c"character \\\22 she said\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Column A\09Column B\09Column C\00"
@.str.2 = [51 x i8] c"\22Letz\08s fix that typo and then show the backslash \00"
@str = [37 x i8] c"\0AMy Computer's Beep doesn't work: \07!\00"
@str.4 = [22 x i8] c"character \\\22 she said\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
int /*<<< orphan*/ scanf(char *, long long *);
int main() {
  long long int n;
  scanf("%lld", &n);
  long long int ans = 0;
  if (n % 2 == 0)
    ans = n / 2;
  else {
    ans = (n / 2) - n;
  }
  printf("%lld\n", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1176 <main+0x56>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
jmp    118c <main+0x6c>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rax
mov    %eax,%ecx
and    $0x1,%ecx
neg    %rcx
mov    %rax,%rsi
shr    $0x3f,%rsi
add    %rax,%rsi
sar    %rsi
and    %rax,%rcx
sub    %rcx,%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
store i64 0, i64* %3
%5 = load i64, i64* %2
%6 = srem i64 %5, 2
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i64, i64* %2
%10 = sdiv i64 %9, 2
store i64 %10, i64* %3
br label %16
11: ; preds = %0
%12 = load i64, i64* %2
%13 = sdiv i64 %12, 2
%14 = load i64, i64* %2
%15 = sub nsw i64 %13, %14
store i64 %15, i64* %3
br label %16
16: ; preds = %11, %8
%17 = load i64, i64* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = and i64 %4, 1
%6 = icmp eq i64 %5, 0
%7 = sdiv i64 %4, 2
%8 = select i1 %6, i64 0, i64 %4
%9 = sub nsw i64 %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %9)
ret i32 0
}
/* Variables and functions */
bool isNumber(char ch) {
  if (ch >= '0' && ch <= '9')
    return true;
  return false;
}


x86 assembly (clang, -O0):
<isNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <isNumber+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <isNumber+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <isNumber+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumber>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isNumber(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
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @isNumber(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int write_UInt16Number(unsigned int d, char *p) {
  if (d > 65535)
    return 1;
  ((unsigned char *)p)[0] = (unsigned char)(d >> 8);
  ((unsigned char *)p)[1] = (unsigned char)(d);
  return 0;
}


x86 assembly (clang, -O0):
<write_UInt16Number>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xffff,-0x8(%rbp)
jbe    1124 <write_UInt16Number+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1145 <write_UInt16Number+0x45>
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_UInt16Number>:
mov    $0x1,%eax
cmp    $0xffff,%edi
ja     1116 <write_UInt16Number+0x16>
rol    $0x8,%di
mov    %di,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @write_UInt16Number(i32 %0, i8* nocapture writeonly %1) {
%3 = icmp ugt i32 %0, 65535
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = lshr i32 %0, 8
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
%7 = trunc i32 %0 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %7, i8* %8
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ tinfl_decompress_mem_to_heap(void const *, size_t, size_t *,
                                        int /*<<< orphan*/);
char *inflate_block(char *buf, size_t buf_size) {
  size_t out_size = (32 * 1024);
  return (char *)tinfl_decompress_mem_to_heap((const void *)buf, buf_size,
                                              (size_t *)&out_size, 0);
}


x86 assembly (clang, -O0):
<inflate_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x8000,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <tinfl_decompress_mem_to_heap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inflate_block>:
push   %rax
movq   $0x8000,(%rsp)
mov    %rsp,%rdx
xor    %ecx,%ecx
call   1030 <tinfl_decompress_mem_to_heap@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @inflate_block(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 32768, i64* %5
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i64 @tinfl_decompress_mem_to_heap(i8* %6, i64 %7, i64* %5, i32 0)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @inflate_block(i8* %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 32768, i64* %3
%5 = call i64 @tinfl_decompress_mem_to_heap(i8* %0, i64 %1, i64* %3, i32 0)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
unsigned long append_0(unsigned long);
unsigned long append_1(unsigned long prefix) {
  static unsigned short prefix_bit[16] = {
      0x8000, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, 0x0100,
      0x0080, 0x0040, 0x0020, 0x0010, 0x0008, 0x0004, 0x0002, 0x0001};
  unsigned char len = (prefix >> 16) & 0xf;
  return (append_0(prefix) + prefix_bit[len]);
}


x86 assembly (clang, -O0):
<append_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0xf,%rax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <append_0@plt>
movzbl -0x9(%rbp),%ecx
mov    %ecx,%edx
lea    0x2eef(%rip),%rcx
movzwl (%rcx,%rdx,2),%ecx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_1>:
push   %rbx
mov    %rdi,%rbx
call   1030 <append_0@plt>
shr    $0xf,%rbx
and    $0x1e,%ebx
lea    0xed9(%rip),%rcx
movzwl (%rbx,%rcx,1),%ecx
add    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@append_1.prefix_bit = internal global [16 x i16] [i16 -32768, i16 16384, i16 8192, i16 4096, i16 2048, i16 1024, i16 512, i16 256, i16 128, i16 64, i16 32, i16 16, i16 8, i16 4, i16 2, i16 1]
define i64 @append_1(i64 %0) {
%2 = alloca i64
%3 = alloca i8
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 16
%6 = and i64 %5, 15
%7 = trunc i64 %6 to i8
store i8 %7, i8* %3
%8 = load i64, i64* %2
%9 = call i64 @append_0(i64 %8)
%10 = load i8, i8* %3
%11 = zext i8 %10 to i64
%12 = getelementptr inbounds [16 x i16], [16 x i16]* @append_1.prefix_bit, i64 0, i64 %11
%13 = load i16, i16* %12
%14 = zext i16 %13 to i64
%15 = add i64 %9, %14
ret i64 %15
}

LLVM IR (-O2):
@append_1.prefix_bit = internal unnamed_addr constant [16 x i16] [i16 -32768, i16 16384, i16 8192, i16 4096, i16 2048, i16 1024, i16 512, i16 256, i16 128, i16 64, i16 32, i16 16, i16 8, i16 4, i16 2, i16 1]
define i64 @append_1(i64 %0) {
%2 = lshr i64 %0, 16
%3 = and i64 %2, 15
%4 = tail call i64 @append_0(i64 %0)
%5 = getelementptr inbounds [16 x i16], [16 x i16]* @append_1.prefix_bit, i64 0, i64 %3
%6 = load i16, i16* %5
%7 = zext i16 %6 to i64
%8 = add i64 %4, %7
ret i64 %8
}
/* Variables and functions */
int INT_MAX;
int rangeBitwiseAnd1(int m, int n) {
  int r = INT_MAX;
  while ((m & r) != (n & r))
    r <<= 1;
  return n & r;
}


x86 assembly (clang, -O0):
<rangeBitwiseAnd1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
cmp    %ecx,%eax
je     1138 <rangeBitwiseAnd1+0x38>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <rangeBitwiseAnd1+0x16>
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rangeBitwiseAnd1>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%ecx
nopl   0x0(%rax)
mov    %ecx,%eax
and    %edi,%eax
mov    %ecx,%edx
and    %esi,%edx
add    %ecx,%ecx
cmp    %edx,%eax
jne    1110 <rangeBitwiseAnd1+0x10>
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @rangeBitwiseAnd1(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* @INT_MAX
store i32 %6, i32* %5
br label %7
7: ; preds = %15, %2
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = and i32 %8, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = and i32 %11, %12
%14 = icmp ne i32 %10, %13
br i1 %14, label %15, label %18
15: ; preds = %7
%16 = load i32, i32* %5
%17 = shl i32 %16, 1
store i32 %17, i32* %5
br label %7
18: ; preds = %7
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = and i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @rangeBitwiseAnd1(i32 %0, i32 %1) {
%3 = load i32, i32* @INT_MAX
br label %4
4: ; preds = %4, %2
%5 = phi i32 [ %3, %2 ], [ %9, %4 ]
%6 = and i32 %5, %0
%7 = and i32 %5, %1
%8 = icmp eq i32 %6, %7
%9 = shl i32 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
ret i32 %6
}
void _graphfreemem(void *ptr, unsigned int size) {}


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

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

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

LLVM IR (-O2):
define void @_graphfreemem(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_85_ch_110_ch_105_ch_111_ch_110_ch_79_ch_102(
    char const *);
int fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_85_ch_110_ch_105_ch_111_ch_110_ch_79_ch_102(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_85_ch_110_ch_105_ch_111_ch_110_ch_79_ch_102(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_85_ch_110_ch_105_ch_111_ch_110_ch_79_ch_102>:
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_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_85_ch_110_ch_105_ch_111_ch_110_ch_79_ch_102@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_85_ch_110_ch_105_ch_111_ch_110_ch_79_ch_102+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_85_ch_110_ch_105_ch_111_ch_110_ch_79_ch_102+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_85_ch_110_ch_105_ch_111_ch_110_ch_79_ch_102>:
jmp    1030 <fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_85_ch_110_ch_105_ch_111_ch_110_ch_79_ch_102@plt>

LLVM IR (-O0):
define i32 @fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_85_ch_110_ch_105_ch_111_ch_110_ch_79_ch_102(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_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_85_ch_110_ch_105_ch_111_ch_110_ch_79_ch_102(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_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_85_ch_110_ch_105_ch_111_ch_110_ch_79_ch_102(i8* %0) {
%2 = tail call i32 @fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_85_ch_110_ch_105_ch_111_ch_110_ch_79_ch_102(i8* %0)
ret i32 %2
}
void h2(void) {}


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

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

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

LLVM IR (-O2):
define void @h2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SensirionSht11LogicP__0__InterruptDATA__fired();
void Msp430InterruptC__2__Interrupt__fired(void) {
  SensirionSht11LogicP__0__InterruptDATA__fired();
}


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

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

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

LLVM IR (-O2):
define void @Msp430InterruptC__2__Interrupt__fired() {
%1 = tail call i32 (...) @SensirionSht11LogicP__0__InterruptDATA__fired()
ret void
}
unsigned short __inw(unsigned short port) {
  unsigned short _v;
  __asm__ __volatile__("in"
                       "w"
                       " %"
                       "w"
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "d"(port));
  return _v;
}


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

x86 assembly (clang, -O2):
<__inw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define zeroext i16 @__inw(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw ${1:w},$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @__inw(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w},$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ li_stw();
int main(void) {
  li_stw();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @li_stw()
ret i32 0
}
/* Variables and functions */
double strtod(char const *, int /*<<< orphan*/ *);
double str2double(__const char *str) { return strtod(str, NULL); }


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

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

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

LLVM IR (-O2):
define double @str2double(i8* nocapture %0) {
%2 = tail call double @strtod(i8* nocapture %0, i32* null)
ret double %2
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ rand();
uint64_t bpf_rand_mask(uint64_t mask) {
  return (((uint64_t)(uint32_t)rand()) | ((uint64_t)(uint32_t)rand() << 32)) &
         mask;
}


x86 assembly (clang, -O0):
<bpf_rand_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%eax
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
and    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_rand_mask>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <rand@plt>

LLVM IR (-O0):
define i32 @bpf_rand_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @rand()
%4 = trunc i64 %3 to i32
%5 = call i64 (...) @rand()
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 32
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = and i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @bpf_rand_mask(i32 %0) {
%2 = tail call i64 (...) @rand()
%3 = tail call i64 (...) @rand()
ret i32 poison
}
void caller_2_1_2_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_2_1_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  int a, b, c;
  float f;
  a = 10;
  b = 20;
  c = a + b;
  printf("value of c: %d \n", c);
  f = 70.0 / 3.0;
  printf("value of f: %f \n", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm0
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movss  0xeb1(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xeb5(%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
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"value of c: %d \0A\00"
@.str.1 = [17 x i8] c"value of f: %f \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 3.000000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float 0x4037555560000000)
ret i32 0
}
/* Variables and functions */
int PRCMHIBRegRead(int);
unsigned long PRCMHibernateWakeupCauseGet() {
  return ((PRCMHIBRegRead(0x4402F800 + 0x00000468) >> 1) & 0xF);
}


x86 assembly (clang, -O0):
<PRCMHibernateWakeupCauseGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4402fc68,%edi
call   1030 <PRCMHIBRegRead@plt>
sar    $0x1,%eax
and    $0xf,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMHibernateWakeupCauseGet>:
push   %rax
mov    $0x4402fc68,%edi
call   1030 <PRCMHIBRegRead@plt>
shr    %eax
and    $0xf,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @PRCMHibernateWakeupCauseGet() {
%1 = call i32 @PRCMHIBRegRead(i32 1141046376)
%2 = ashr i32 %1, 1
%3 = and i32 %2, 15
%4 = sext i32 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @PRCMHibernateWakeupCauseGet() {
%1 = tail call i32 @PRCMHIBRegRead(i32 1141046376)
%2 = lshr i32 %1, 1
%3 = and i32 %2, 15
%4 = zext i32 %3 to i64
ret i64 %4
}
void exchange(unsigned char *x, unsigned char *y) {
  unsigned char tmp = *x;
  *x = *y;
  *y = tmp;
}


x86 assembly (clang, -O0):
<exchange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exchange>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @exchange(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}