xunge/DecIR huggingface dataset:
int security_sem_semctl(struct sem_array *sma, int semid, int cmd) { return 0; }


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

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

LLVM IR (-O0):
%struct.sem_array = type opaque
define i32 @security_sem_semctl(%struct.sem_array* %0, i32 %1, i32 %2) {
%4 = alloca %struct.sem_array*
%5 = alloca i32
%6 = alloca i32
store %struct.sem_array* %0, %struct.sem_array** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.sem_array = type opaque
define i32 @security_sem_semctl(%struct.sem_array* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_3(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int /*<<< orphan*/, int, int);
uint32_t Interp4(uint32_t c1, uint32_t c2, uint32_t c3) {
  return Interpolate_3(c1, 2, c2, 7, c3, 7, 4);
}


x86 assembly (clang, -O0):
<Interp4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
mov    $0x2,%esi
mov    $0x7,%r9d
mov    %r9d,%ecx
movl   $0x4,(%rsp)
call   1030 <Interpolate_3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp4>:
push   %rax
mov    %edx,%r8d
mov    %esi,%edx
movl   $0x4,(%rsp)
mov    $0x2,%esi
mov    $0x7,%ecx
mov    $0x7,%r9d
call   1030 <Interpolate_3@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Interp4(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @Interpolate_3(i32 %7, i32 2, i32 %8, i32 7, i32 %9, i32 7, i32 4)
ret i32 %10
}

LLVM IR (-O2):
define i32 @Interp4(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Interpolate_3(i32 %0, i32 2, i32 %1, i32 7, i32 %2, i32 7, i32 4)
ret i32 %4
}
int start_resp_from_server(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @start_resp_from_server() {
ret i32 1
}
char nibble(char *s, int i) {
  return (i % 2 == 0) ? s[i / 2] >> 4 : s[i / 2] & 0xf;
}


x86 assembly (clang, -O0):
<nibble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114a <nibble+0x4a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
sar    $0x4,%eax
mov    %eax,-0x10(%rbp)
jmp    1170 <nibble+0x70>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xf,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble>:
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
cltq
mov    (%rdi,%rax,1),%al
mov    %eax,%ecx
sar    $0x4,%cl
and    $0xf,%al
test   $0x1,%sil
movzbl %cl,%ecx
movzbl %al,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @nibble(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = sdiv i32 %10, 2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = ashr i32 %15, 4
br label %26
17: ; preds = %2
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = sdiv i32 %19, 2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %18, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = and i32 %24, 15
br label %26
26: ; preds = %17, %8
%27 = phi i32 [ %16, %8 ], [ %25, %17 ]
%28 = trunc i32 %27 to i8
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @nibble(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
%5 = sdiv i32 %1, 2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = ashr i8 %8, 4
%10 = and i8 %8, 15
%11 = select i1 %4, i8 %9, i8 %10
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned long long ulldiv(unsigned long long, unsigned long long);
void ucheck(unsigned long long num, unsigned long long expected) {
  unsigned long long res = ulldiv(num, 0ULL);
  if (res != expected)
    abort();
}


x86 assembly (clang, -O0):
<ucheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <ulldiv@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1156 <ucheck+0x36>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucheck>:
push   %rbx
mov    %rsi,%rbx
xor    %esi,%esi
call   1040 <ulldiv@plt>
cmp    %rbx,%rax
jne    1132 <ucheck+0x12>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @ucheck(i64 %0, i64 %1) {
%3 = tail call i64 @ulldiv(i64 %0, i64 0)
%4 = icmp eq i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret void
}
int winsock_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @winsock_init() {
ret i32 0
}
void yy_3_LinkOptionResize(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_3_LinkOptionResize(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 @yy_3_LinkOptionResize(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ comdlg32_init();
int /*<<< orphan*/ gdi32_init();
int /*<<< orphan*/ kernal32_init();
int /*<<< orphan*/ mswin32aux_init();
int /*<<< orphan*/ user32_init();
int /*<<< orphan*/ winspool32_init();
void pi_init(void) {
  kernal32_init();
  user32_init();
  gdi32_init();
  winspool32_init();
  comdlg32_init();
  mswin32aux_init();
}


x86 assembly (clang, -O0):
<pi_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <kernal32_init@plt>
mov    $0x0,%al
call   1080 <user32_init@plt>
mov    $0x0,%al
call   1050 <gdi32_init@plt>
mov    $0x0,%al
call   1030 <winspool32_init@plt>
mov    $0x0,%al
call   1060 <comdlg32_init@plt>
mov    $0x0,%al
call   1040 <mswin32aux_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pi_init>:
push   %rax
xor    %eax,%eax
call   1070 <kernal32_init@plt>
xor    %eax,%eax
call   1080 <user32_init@plt>
xor    %eax,%eax
call   1050 <gdi32_init@plt>
xor    %eax,%eax
call   1030 <winspool32_init@plt>
xor    %eax,%eax
call   1060 <comdlg32_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <mswin32aux_init@plt>

LLVM IR (-O0):
define void @pi_init() {
%1 = call i32 (...) @kernal32_init()
%2 = call i32 (...) @user32_init()
%3 = call i32 (...) @gdi32_init()
%4 = call i32 (...) @winspool32_init()
%5 = call i32 (...) @comdlg32_init()
%6 = call i32 (...) @mswin32aux_init()
ret void
}

LLVM IR (-O2):
define void @pi_init() {
%1 = tail call i32 (...) @kernal32_init()
%2 = tail call i32 (...) @user32_init()
%3 = tail call i32 (...) @gdi32_init()
%4 = tail call i32 (...) @winspool32_init()
%5 = tail call i32 (...) @comdlg32_init()
%6 = tail call i32 (...) @mswin32aux_init()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void uninitar_vfprintf(void) {
  FILE *stream;
  char *format;
  va_list arg;
  (void)vfprintf(stream, format, arg);
}


x86 assembly (clang, -O0):
<uninitar_vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vfprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitar_vfprintf>:
jmp    1030 <vfprintf@plt>

LLVM IR (-O0):
define void @uninitar_vfprintf() {
%1 = alloca i32*
%2 = alloca i8*
%3 = alloca i32
%4 = load i32*, i32** %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = call i32 @vfprintf(i32* %4, i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @uninitar_vfprintf() {
%1 = tail call i32 @vfprintf(i32* undef, i8* undef, i32 undef)
ret void
}
int wait(int *status) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @wait(i32* nocapture readnone %0) {
ret i32 -1
}
int test(unsigned int a, int b, int c) {
  if ((a - 43) <= 3 || (a - 75) <= 3)
    return b;
  else
    return c;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2b,%eax
cmp    $0x3,%eax
jbe    112b <test+0x2b>
mov    -0x8(%rbp),%eax
sub    $0x4b,%eax
cmp    $0x3,%eax
ja     1136 <test+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113c <test+0x3c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %edx,%eax
lea    -0x2b(%rdi),%ecx
add    $0xffffffb5,%edi
cmp    $0x4,%edi
cmovb  %esi,%eax
cmp    $0x4,%ecx
cmovb  %esi,%eax
ret

LLVM IR (-O0):
define i32 @test(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = sub i32 %8, 43
%10 = icmp ule i32 %9, 3
br i1 %10, label %15, label %11
11: ; preds = %3
%12 = load i32, i32* %5
%13 = sub i32 %12, 75
%14 = icmp ule i32 %13, 3
br i1 %14, label %15, label %17
15: ; preds = %11, %3
%16 = load i32, i32* %6
store i32 %16, i32* %4
br label %19
17: ; preds = %11
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %19
19: ; preds = %17, %15
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, -43
%5 = icmp ult i32 %4, 4
%6 = add i32 %0, -75
%7 = icmp ult i32 %6, 4
%8 = or i1 %5, %7
%9 = select i1 %8, i32 %1, i32 %2
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ max31855_cleanup();
void sensor_thermocouple_cleanup(void) { max31855_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @sensor_thermocouple_cleanup() {
%1 = tail call i32 (...) @max31855_cleanup()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER;

/* Variables and functions */
int /*<<< orphan*/ const *EVP_aes_192_cfb128();
const EVP_CIPHER *EVP_aes_192_cfb(void) { return EVP_aes_192_cfb128(); }


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

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

LLVM IR (-O0):
define i32* @EVP_aes_192_cfb() {
%1 = call i32* (...) @EVP_aes_192_cfb128()
ret i32* %1
}

LLVM IR (-O2):
define i32* @EVP_aes_192_cfb() {
%1 = tail call i32* (...) @EVP_aes_192_cfb128()
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ dump_error(char *);
scalar_t__ malloc(unsigned int);
double *dvector(int nl, int nh) {
  double *v;
  v = (double *)malloc((unsigned)(nh - nl + 1) * sizeof(double));
  if (!v)
    dump_error("allocation failure in dvector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <dvector+0x3f>
lea    0xea6(%rip),%rdi
call   1030 <dump_error@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x8(,%rsi,8),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <dvector+0x27>
lea    0xebe(%rip),%rdi
call   1030 <dump_error@plt>
movslq %ebp,%rax
shl    $0x3,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to double*
store double* %14, double** %5
%15 = load double*, double** %5
%16 = icmp ne double* %15, null
br i1 %16, label %19, label %17
17: ; preds = %2
%18 = call i32 @dump_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
%20 = load double*, double** %5
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = sub i64 0, %22
%24 = getelementptr inbounds double, double* %20, i64 %23
ret double* %24
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = shl i32 %3, 3
%5 = add i32 %4, 8
%6 = tail call i64 @malloc(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @dump_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to double*
%12 = sext i32 %0 to i64
%13 = sub nsw i64 0, %12
%14 = getelementptr inbounds double, double* %11, i64 %13
ret double* %14
}
int git_object_is_loose(char *sha1) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @git_object_is_loose(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  int *p = malloc(32);
  free(p);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 32)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @free(i32* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 32)
%2 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
size_t ZBUFF_limitCopy(void *dst, size_t maxDstSize, const void *src,
                       size_t srcSize) {
  size_t length = ((maxDstSize) < (srcSize) ? (maxDstSize) : (srcSize));
  memcpy(dst, src, length);
  return length;
}


x86 assembly (clang, -O0):
<ZBUFF_limitCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1143 <ZBUFF_limitCopy+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    114b <ZBUFF_limitCopy+0x3b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZBUFF_limitCopy>:
push   %rbx
mov    %rcx,%rbx
cmp    %rcx,%rsi
cmovb  %rsi,%rbx
mov    %rdx,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @ZBUFF_limitCopy(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i64, i64* %6
%11 = load i64, i64* %8
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i64, i64* %6
br label %17
15: ; preds = %4
%16 = load i64, i64* %8
br label %17
17: ; preds = %15, %13
%18 = phi i64 [ %14, %13 ], [ %16, %15 ]
store i64 %18, i64* %9
%19 = load i8*, i8** %5
%20 = load i8*, i8** %7
%21 = load i64, i64* %9
%22 = call i32 @memcpy(i8* %19, i8* %20, i64 %21)
%23 = load i64, i64* %9
ret i64 %23
}

LLVM IR (-O2):
define i64 @ZBUFF_limitCopy(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = icmp ult i64 %1, %3
%6 = select i1 %5, i64 %1, i64 %3
%7 = tail call i32 @memcpy(i8* %0, i8* %2, i64 %6)
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
long __infer_nondet_long_int();
long int wcstol(const wchar_t *nptr, wchar_t **endptr, int base) {
  return __infer_nondet_long_int();
}


x86 assembly (clang, -O0):
<wcstol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_long_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @wcstol(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 = call i64 (...) @__infer_nondet_long_int()
ret i64 %7
}

LLVM IR (-O2):
define i64 @wcstol(i32* nocapture readnone %0, i32** nocapture readnone %1, i32 %2) {
%4 = tail call i64 (...) @__infer_nondet_long_int()
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void b_float_print(int idx, int *cells, int size) {
  printf("Index Pointer: %d Value at Index Pointer: %d\n", idx, cells[idx]);
}


x86 assembly (clang, -O0):
<b_float_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_float_print>:
movslq %edi,%rax
mov    (%rsi,%rax,4),%edx
lea    0xee3(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Index Pointer: %d Value at Index Pointer: %d\0A\00"
define void @b_float_print(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 = load i32*, i32** %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Index Pointer: %d Value at Index Pointer: %d\0A\00"
define void @b_float_print(i32 %0, i32* nocapture %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %6)
ret void
}
void genbltzal() {}


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

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

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

LLVM IR (-O2):
define void @genbltzal() {
ret void
}
void av_hash_get_name() {}


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

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

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

LLVM IR (-O2):
define void @av_hash_get_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putendl(char *);
int /*<<< orphan*/ ft_putstr(char const *);
void ft_putendl_info(char const *s) {
  ft_putstr("\x1B[36m");
  ft_putstr(s);
  ft_putendl("\x1B[0m");
}


x86 assembly (clang, -O0):
<ft_putendl_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ft_putstr@plt>
lea    0xebe(%rip),%rdi
call   1030 <ft_putendl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl_info>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    %rbx,%rdi
call   1040 <ft_putstr@plt>
lea    0xec7(%rip),%rdi
pop    %rbx
jmp    1030 <ft_putendl@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[36m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putendl_info(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @ft_putstr(i8* %4)
%6 = call i32 @ft_putendl(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[36m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putendl_info(i8* %0) {
%2 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ft_putstr(i8* %0)
%4 = tail call i32 @ft_putendl(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ no_east_neighbors(int);
void no_east_neighbors_test(void **state) {
  assert_int_equal(0x0000000000001000ul,
                   no_east_neighbors(0x0000000000001C00ul));
}


x86 assembly (clang, -O0):
<no_east_neighbors_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1c00,%edi
call   1040 <no_east_neighbors@plt>
mov    %eax,%esi
mov    $0x1000,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_east_neighbors_test>:
push   %rax
mov    $0x1c00,%edi
call   1040 <no_east_neighbors@plt>
mov    $0x1000,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @no_east_neighbors_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @no_east_neighbors(i32 7168)
%4 = call i32 @assert_int_equal(i32 4096, i32 %3)
ret void
}

LLVM IR (-O2):
define void @no_east_neighbors_test(i8** nocapture readnone %0) {
%2 = tail call i32 @no_east_neighbors(i32 7168)
%3 = tail call i32 @assert_int_equal(i32 4096, i32 %2)
ret void
}
int nextLevelXP(int newLevel) {
  int i = newLevel;
  int sum = 0;
  while (i > 0) {
    sum += i;
    --i;
  }
  return (sum * 100);
}


x86 assembly (clang, -O0):
<nextLevelXP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1135 <nextLevelXP+0x35>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <nextLevelXP+0x14>
imul   $0x64,-0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextLevelXP>:
test   %edi,%edi
jle    111c <nextLevelXP+0x1c>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
imul   $0x64,%eax,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @nextLevelXP(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %15
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
%14 = mul i32 %13, 100
br label %15
15: ; preds = %3, %1
%16 = phi i32 [ 0, %1 ], [ %14, %3 ]
ret i32 %16
}
void led_off() { (*(volatile unsigned long *)0x7F008808) = 0xF0; }


x86 assembly (clang, -O0):
<led_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008808,%eax
movq   $0xf0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_off>:
movq   $0xf0,0x7f008808
ret

LLVM IR (-O0):
define void @led_off() {
store volatile i64 240, i64* inttoptr (i64 2130741256 to i64*)
ret void
}

LLVM IR (-O2):
define void @led_off() {
store volatile i64 240, i64* inttoptr (i64 2130741256 to i64*)
ret void
}
int inet_init(void) {
  int retval = 0;
  return retval;
}


x86 assembly (clang, -O0):
<inet_init>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @inet_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void foo(void) {
  int i;
  char *p;
  p = (char *)&i;
  *p = -10;
  if (*(unsigned char *)p != 0x100 - 10)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0xf6,(%rax)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xf6,%eax
je     1140 <foo+0x30>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca i8*
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
store i8 -10, i8* %4
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp ne i32 %7, 246
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int serverLoop(unsigned int);
int server_loop(unsigned int d_ms) { return serverLoop(d_ms); }


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

x86 assembly (clang, -O2):
<server_loop>:
jmp    1030 <serverLoop@plt>

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

LLVM IR (-O2):
define i32 @server_loop(i32 %0) {
%2 = tail call i32 @serverLoop(i32 %0)
ret i32 %2
}
void swap(int array[], int pos1, int pos2) {
  int tmp = array[pos1];
  array[pos1] = array[pos2];
  array[pos2] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int test_imm_4Duint16_mem(unsigned short *val) {
  return ((*val) & (0x4D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Duint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 77
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int fs_read(int fildes, void *buf, size_t nbyte) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @fs_read(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 -1
}
int fun1397() { return 1397; }


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

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

LLVM IR (-O0):
define i32 @fun1397() {
ret i32 1397
}

LLVM IR (-O2):
define i32 @fun1397() {
ret i32 1397
}
/* Variables and functions */
scalar_t__ isprime(int);
int /*<<< orphan*/ printf(char *, ...);
main() {
  int n;
  for (n = 2; n < 100; ++n) {
    if (isprime(n)) {
      printf("%d ", n);
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1176 <main+0x56>
mov    -0x8(%rbp),%edi
call   1040 <isprime@plt>
cmp    $0x0,%rax
je     1163 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1168 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xec0(%rip),%r14
jmp    1158 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x64,%ebx
je     1172 <main+0x42>
mov    %ebx,%edi
call   1050 <isprime@plt>
test   %rax,%rax
je     1150 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1150 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 2, %0 ], [ %8, %7 ]
%3 = tail call i64 @isprime(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 100
br i1 %9, label %10, label %1
10: ; preds = %7
%11 = tail call i32 @putchar(i32 10)
ret i32 0
}
int baz(char *a, char *b) { return __builtin_memcmp(a, b, 30000); }


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

x86 assembly (clang, -O2):
<baz>:
mov    $0x7530,%edx
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
define i32 @baz(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @memcmp(i8* %5, i8* %6, i64 30000)
ret i32 %7
}

LLVM IR (-O2):
define i32 @baz(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @memcmp(i8* dereferenceable(30000) %0, i8* dereferenceable(30000) %1, i64 30000)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void inputRequest() { printf("\nPlease enter a nonnegative integer: "); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"\0APlease enter a nonnegative integer: \00"
define void @inputRequest() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"\0APlease enter a nonnegative integer: \00"
define void @inputRequest() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}
void pgdat_page_cgroup_init(struct pglist_data *pgdat) {}


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

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

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

LLVM IR (-O2):
%struct.pglist_data = type opaque
define void @pgdat_page_cgroup_init(%struct.pglist_data* nocapture %0) {
ret void
}
/* Variables and functions */
void *jhc_malloc_basic(size_t);
void *__attribute__((malloc)) jhc_malloc(size_t n) {
  do {
  } while (0);
  return jhc_malloc_basic(n);
}


x86 assembly (clang, -O0):
<jhc_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1121 <jhc_malloc+0x11>
mov    -0x8(%rbp),%rdi
call   1030 <jhc_malloc_basic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jhc_malloc>:
jmp    1030 <jhc_malloc_basic@plt>

LLVM IR (-O0):
define noalias i8* @jhc_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load i64, i64* %2
%6 = call i8* @jhc_malloc_basic(i64 %5)
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @jhc_malloc(i64 %0) {
%2 = tail call i8* @jhc_malloc_basic(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void pr_array(char *a[], int len) {
  int k;
  for (k = 0; k < len; k++)
    printf("%s, ", a[k]);
  printf("\n");
}


x86 assembly (clang, -O0):
<pr_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <pr_array+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <pr_array+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <pr_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <pr_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s, \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @pr_array(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s, \00"
define void @pr_array(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t tlv_get_length(const uint8_t *p_tlv) {
  return (p_tlv[2] << 8) | p_tlv[3];
}


x86 assembly (clang, -O0):
<tlv_get_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlv_get_length>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @tlv_get_length(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @tlv_get_length(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
int getLineNumber(int *entry) { return *(entry + 2); }


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

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

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

LLVM IR (-O2):
define i32 @getLineNumber(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
char *strpcpy(char *dst, const char *src) {
  while ((*dst++ = *src++) != '\0')
    ;
  return (dst - 1);
}


x86 assembly (clang, -O0):
<strpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     113f <strpcpy+0x3f>
jmp    110c <strpcpy+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpcpy>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strpcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strpcpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char str[0x20];
  scanf("%s", str);
  printf(str);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_genrand(unsigned long);
void MySrand(unsigned long seed) { init_genrand(seed); }


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

x86 assembly (clang, -O2):
<MySrand>:
jmp    1030 <init_genrand@plt>

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

LLVM IR (-O2):
define void @MySrand(i64 %0) {
%2 = tail call i32 @init_genrand(i64 %0)
ret void
}
/* Type definitions */
struct config {
  int dummy;
};

/* Variables and functions */
int txdb_zap(struct config *);
int wallet_zap_txdb(struct config *config) { return txdb_zap(config); }


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

x86 assembly (clang, -O2):
<wallet_zap_txdb>:
jmp    1030 <txdb_zap@plt>

LLVM IR (-O0):
%struct.config = type { i32 }
define i32 @wallet_zap_txdb(%struct.config* %0) {
%2 = alloca %struct.config*
store %struct.config* %0, %struct.config** %2
%3 = load %struct.config*, %struct.config** %2
%4 = call i32 @txdb_zap(%struct.config* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.config = type { i32 }
define i32 @wallet_zap_txdb(%struct.config* %0) {
%2 = tail call i32 @txdb_zap(%struct.config* %0)
ret i32 %2
}