xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char str[256];
  scanf("%[^\n]\n", str);
  printf("%s %s", str, str);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]\0A\00"
@.str.1 = [6 x i8] c"%s %s\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void uninitvar_strcpy(void) {
  char *str1;
  char *str2;
  (void)strcpy(str1, str2);
}


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

x86 assembly (clang, -O2):
<uninitvar_strcpy>:
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @uninitvar_strcpy() {
%1 = tail call i32 @strcpy(i8* undef, i8* undef)
ret void
}
const char *filtername(void *arg) { return "testfilter"; }


x86 assembly (clang, -O0):
<filtername>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filtername>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"testfilter\00"
define i8* @filtername(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [11 x i8] c"testfilter\00"
define i8* @filtername(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *argv0, char *text) {
  printf("%s\n", text);
  printf("\n\nUsage:\n\n%s:type param1 param2 param3\n\ntype:\n0 = demo "
         "calculation for multiple shapes (count of shapes from each type, "
         "length, radius and side length are more ore less random ;) ))\n1 = "
         "square (param1 = side length)\n2 = circle (param1 = radius)\n3 = "
         "triangle (param1 = side length 1, param2 = side length 2, param3 = "
         "side length 3)\n\n",
         argv0);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [333 x i8] c"\0A\0AUsage:\0A\0A%s:type param1 param2 param3\0A\0Atype:\0A0 = demo calculation for multiple shapes (count of shapes from each type, length, radius and side length are more ore less random ;) ))\0A1 = square (param1 = side length)\0A2 = circle (param1 = radius)\0A3 = triangle (param1 = side length 1, param2 = side length 2, param3 = side length 3)\0A\0A\00"
define void @usage(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([333 x i8], [333 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [333 x i8] c"\0A\0AUsage:\0A\0A%s:type param1 param2 param3\0A\0Atype:\0A0 = demo calculation for multiple shapes (count of shapes from each type, length, radius and side length are more ore less random ;) ))\0A1 = square (param1 = side length)\0A2 = circle (param1 = radius)\0A3 = triangle (param1 = side length 1, param2 = side length 2, param3 = side length 3)\0A\0A\00"
define void @usage(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([333 x i8], [333 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int sscanf(char *, char *, char *, char *, char *);
int decoupe(char *message, char *cb, char *type, char *valeur) {
  int nb = sscanf(message, "|%[^|]|%[^|]|%[^|]|\n", cb, type, valeur);
  if (nb == 3)
    return 1;
  else {
    errno = EINVAL;
    return 0;
  }
}


x86 assembly (clang, -O0):
<decoupe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    0xec1(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jne    115d <decoupe+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1176 <decoupe+0x66>
mov    0x2e74(%rip),%rax
mov    (%rax),%ecx
mov    0x2e73(%rip),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decoupe>:
push   %rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xedf(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x3,%ecx
je     1146 <decoupe+0x36>
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
mov    0x2e9e(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"|%[^|]|%[^|]|%[^|]|\0A\00"
@EINVAL = global i32 0
@errno = global i32 0
define i32 @decoupe(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i8* %14)
store i32 %15, i32* %10
%16 = load i32, i32* %10
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %19
18: ; preds = %4
store i32 1, i32* %5
br label %21
19: ; preds = %4
%20 = load i32, i32* @EINVAL
store i32 %20, i32* @errno
store i32 0, i32* %5
br label %21
21: ; preds = %19, %18
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
@.str = [21 x i8] c"|%[^|]|%[^|]|%[^|]|\0A\00"
@EINVAL = global i32 0
@errno = global i32 0
define i32 @decoupe(i8* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
%6 = icmp eq i32 %5, 3
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = load i32, i32* @EINVAL
store i32 %8, i32* @errno
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %10
}
int rtl838x_dma_tx_base(int i) { return (0x9f40) + (i << 2); }


x86 assembly (clang, -O0):
<rtl838x_dma_tx_base>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    $0x9f40,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl838x_dma_tx_base>:
lea    0x9f40(,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @rtl838x_dma_tx_base(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 2
%5 = add nsw i32 40768, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rtl838x_dma_tx_base(i32 %0) {
%2 = shl i32 %0, 2
%3 = add nsw i32 %2, 40768
ret i32 %3
}
/* Variables and functions */
int remote_vsend(int, char *, char *);
int remote_sig_gui_notify(char *text) {
  return remote_vsend(2, "gui msg ", text);
}


x86 assembly (clang, -O0):
<remote_sig_gui_notify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x2,%edi
lea    0xed4(%rip),%rsi
call   1030 <remote_vsend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remote_sig_gui_notify>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <remote_vsend@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"gui msg \00"
define i32 @remote_sig_gui_notify(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @remote_vsend(i32 2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"gui msg \00"
define i32 @remote_sig_gui_notify(i8* %0) {
%2 = tail call i32 @remote_vsend(i32 2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Variables and functions */
int platform_linux_kbhit();
extern int platform_kbhit(void) { return platform_linux_kbhit(); }


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

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

LLVM IR (-O0):
define i32 @platform_kbhit() {
%1 = call i32 (...) @platform_linux_kbhit()
ret i32 %1
}

LLVM IR (-O2):
define i32 @platform_kbhit() {
%1 = tail call i32 (...) @platform_linux_kbhit()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ say_stop(char *, int);
void talk(void) {
  say_stop("Hey, looks like there's an opening behind this rock.", 1);
}


x86 assembly (clang, -O0):
<talk>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say_stop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<talk>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say_stop@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Hey, looks like there's an opening behind this rock.\00"
define void @talk() {
%1 = call i32 @say_stop(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Hey, looks like there's an opening behind this rock.\00"
define void @talk() {
%1 = tail call i32 @say_stop(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t return_uint32_0() { return 1073741823; }


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

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

LLVM IR (-O0):
define i32 @return_uint32_0() {
ret i32 1073741823
}

LLVM IR (-O2):
define i32 @return_uint32_0() {
ret i32 1073741823
}
/* Variables and functions */
int /*<<< orphan*/ text_abs(float, float, char *);
scalar_t__ threedproj(double, double, double, float *, float *);
void text3d(double x, double y, double z, char *s) {
  float xp, yp;
  if (threedproj(x, y, z, &xp, &yp))
    text_abs(xp, yp, s);
}


x86 assembly (clang, -O0):
<text3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    -0x24(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <threedproj@plt>
cmp    $0x0,%rax
je     1174 <text3d+0x54>
movss  -0x24(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
mov    -0x20(%rbp),%rdi
call   1040 <text_abs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<text3d>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <threedproj@plt>
test   %rax,%rax
je     1150 <text3d+0x30>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
mov    %rbx,%rdi
call   1040 <text_abs@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @text3d(double %0, double %1, double %2, i8* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i8*
%9 = alloca float
%10 = alloca float
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store i8* %3, i8** %8
%11 = load double, double* %5
%12 = load double, double* %6
%13 = load double, double* %7
%14 = call i64 @threedproj(double %11, double %12, double %13, float* %9, float* %10)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %4
%17 = load float, float* %9
%18 = load float, float* %10
%19 = load i8*, i8** %8
%20 = call i32 @text_abs(float %17, float %18, i8* %19)
br label %21
21: ; preds = %16, %4
ret void
}

LLVM IR (-O2):
define void @text3d(double %0, double %1, double %2, i8* %3) {
%5 = alloca float
%6 = alloca float
%7 = bitcast float* %5 to i8*
%8 = bitcast float* %6 to i8*
%9 = call i64 @threedproj(double %0, double %1, double %2, float* %5, float* %6)
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %4
%12 = load float, float* %5
%13 = load float, float* %6
%14 = call i32 @text_abs(float %12, float %13, i8* %3)
br label %15
15: ; preds = %11, %4
ret void
}
/* Variables and functions */
int m91(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ strtoul(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  if (argv[1])
    printf("%u\n", m91(strtoul(argv[1], NULL, 10)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1180 <main+0x50>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %eax,%edi
call   1040 <m91@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     115b <main+0x2b>
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %eax,%edi
call   1040 <m91@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @strtoul(i8* nocapture %4, i32* null, i32 10)
%8 = tail call i32 @m91(i32 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int op_close(int);
int /*<<< orphan*/ wsocks_ctx_map_remove_by_fd(int);
int close(int fd) {
  int retval;
  do {
  } while (0);
  retval = op_close(fd);
  if (retval < 0) {
    return retval;
  }
  wsocks_ctx_map_remove_by_fd(fd);
  return retval;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
jmp    1130 <close+0x10>
mov    -0x8(%rbp),%edi
call   1030 <op_close@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1150 <close+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <close+0x3e>
mov    -0x8(%rbp),%edi
call   1040 <wsocks_ctx_map_remove_by_fd@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <op_close@plt>
mov    %eax,%ebp
test   %eax,%eax
js     1137 <close+0x17>
mov    %ebx,%edi
call   1040 <wsocks_ctx_map_remove_by_fd@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 @op_close(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @wsocks_ctx_map_remove_by_fd(i32 %0)
br label %6
6: ; preds = %1, %4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int /*<<< orphan*/ access(char *, int /*<<< orphan*/);
char *getfullpath();
char *createpath() {
  char *fullpath = NULL;
  do {
    fullpath = getfullpath();
  } while (!access(fullpath, F_OK));
  return fullpath;
}


x86 assembly (clang, -O0):
<createpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getfullpath@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1130 <createpath+0x10>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createpath>:
push   %r14
push   %rbx
push   %rax
mov    0x2ead(%rip),%r14
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getfullpath@plt>
mov    %rax,%rbx
mov    (%r14),%esi
mov    %rax,%rdi
call   1040 <access@plt>
test   %eax,%eax
je     1130 <createpath+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i8* @createpath() {
%1 = alloca i8*
store i8* null, i8** %1
br label %2
2: ; preds = %4, %0
%3 = call i8* (...) @getfullpath()
store i8* %3, i8** %1
br label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = load i32, i32* @F_OK
%7 = call i32 @access(i8* %5, i32 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %2, label %10
10: ; preds = %4
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@F_OK = global i32 0
define i8* @createpath() {
br label %1
1: ; preds = %1, %0
%2 = tail call i8* (...) @getfullpath()
%3 = load i32, i32* @F_OK
%4 = tail call i32 @access(i8* %2, i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %1, label %6
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ bug(char);
int main(int argc, char **argv) { bug(**argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = tail call i32 @bug(i8 signext %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *safe_realloc(void *orig_ptr, size_t size) {
  void *ptr;
  if ((ptr = realloc(orig_ptr, size)) == NULL) {
    perror("Out of memory");
    exit(EXIT_FAILURE);
  }
  orig_ptr = ptr;
  return orig_ptr;
}


x86 assembly (clang, -O0):
<safe_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1175 <safe_realloc+0x45>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %rax
call   1030 <realloc@plt>
test   %rax,%rax
je     113d <safe_realloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @safe_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ destroy_fa_table();
void destroy_tokenizer() { destroy_fa_table(); }


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

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

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

LLVM IR (-O2):
define void @destroy_tokenizer() {
%1 = tail call i32 (...) @destroy_fa_table()
ret void
}
int fsl_udc_clk_finalize(struct platform_device *pdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @fsl_udc_clk_finalize(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AI_SaveNavigation();
void Cmd_SaveNodes_f(void) { AI_SaveNavigation(); }


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

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

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

LLVM IR (-O2):
define void @Cmd_SaveNodes_f() {
%1 = tail call i32 (...) @AI_SaveNavigation()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void calculator() {
  double number1 = 0.0;
  double number2 = 0.0;
  char operation = 0;
  puts("\nEnter the calculation:\n");
}


x86 assembly (clang, -O0):
<calculator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"\0AEnter the calculation:\0A\00"
define void @calculator() {
%1 = alloca double
%2 = alloca double
%3 = alloca i8
store double 0.000000e+00, double* %1
store double 0.000000e+00, double* %2
store i8 0, i8* %3
%4 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0AEnter the calculation:\0A\00"
define void @calculator() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_timer_interrupt();
void init_interrupt_controller(void) { init_timer_interrupt(); }


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

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

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

LLVM IR (-O2):
define void @init_interrupt_controller() {
%1 = tail call i32 (...) @init_timer_interrupt()
ret void
}
int test_imm_97int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x97 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_97int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x97,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_97int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 151
%7 = icmp ne i64 %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_97int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 648540061696
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void ernie(char *arg) { printf("Ernie says %s\n", arg); }


x86 assembly (clang, -O0):
<ernie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ernie>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Ernie says %s\0A\00"
define void @ernie(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Ernie says %s\0A\00"
define void @ernie(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ CAMELLIA_KEY;

/* Variables and functions */
int const CAMELLIA_ENCRYPT;
int /*<<< orphan*/ Camellia_decrypt(unsigned char const *, unsigned char *,
                                    int /*<<< orphan*/ const *);
int /*<<< orphan*/ Camellia_encrypt(unsigned char const *, unsigned char *,
                                    int /*<<< orphan*/ const *);
void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out,
                          const CAMELLIA_KEY *key, const int enc) {
  if (CAMELLIA_ENCRYPT == enc)
    Camellia_encrypt(in, out, key);
  else
    Camellia_decrypt(in, out, key);
}


x86 assembly (clang, -O0):
<Camellia_ecb_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
cmp    -0x1c(%rbp),%eax
jne    115f <Camellia_ecb_encrypt+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <Camellia_encrypt@plt>
jmp    1170 <Camellia_ecb_encrypt+0x50>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <Camellia_decrypt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Camellia_ecb_encrypt>:
test   %ecx,%ecx
je     1129 <Camellia_ecb_encrypt+0x9>
jmp    1030 <Camellia_decrypt@plt>
jmp    1040 <Camellia_encrypt@plt>

LLVM IR (-O0):
@CAMELLIA_ENCRYPT = constant i32 0
define void @Camellia_ecb_encrypt(i8* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* @CAMELLIA_ENCRYPT
%10 = load i32, i32* %8
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i32*, i32** %7
%16 = call i32 @Camellia_encrypt(i8* %13, i8* %14, i32* %15)
br label %22
17: ; preds = %4
%18 = load i8*, i8** %5
%19 = load i8*, i8** %6
%20 = load i32*, i32** %7
%21 = call i32 @Camellia_decrypt(i8* %18, i8* %19, i32* %20)
br label %22
22: ; preds = %17, %12
ret void
}

LLVM IR (-O2):
@CAMELLIA_ENCRYPT = constant i32 0
define void @Camellia_ecb_encrypt(i8* %0, i8* %1, i32* %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @Camellia_encrypt(i8* %0, i8* %1, i32* %2)
br label %10
8: ; preds = %4
%9 = tail call i32 @Camellia_decrypt(i8* %0, i8* %1, i32* %2)
br label %10
10: ; preds = %8, %6
ret void
}
void sleep_handler(int sig) { return; }


x86 assembly (clang, -O0):
<sleep_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sleep_handler(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int volatile uint16_t;

/* Variables and functions */
uint8_t direct_check16(volatile uint16_t *addr, uint16_t dat) {
  return ((*addr & dat) ? 1 : 0);
}


x86 assembly (clang, -O0):
<direct_check16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<direct_check16>:
mov    %esi,-0x4(%rsp)
mov    (%rdi),%ecx
xor    %eax,%eax
and    -0x4(%rsp),%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @direct_check16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store volatile i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load volatile i32, i32* %5
%7 = load volatile i32, i32* %4
%8 = and i32 %6, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @direct_check16(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %0
%5 = load volatile i32, i32* %3
%6 = and i32 %5, %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 0xffffffffff660b45UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[local1] += state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - 0xffffffffda4ab609UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xffffffffff660b45,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1158 <RandomFunc+0x58>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rcx
mov    -0x20(%rbp),%rax
add    -0x18(%rbp,%rax,8),%rcx
mov    %rcx,-0x18(%rbp,%rax,8)
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
jmp    1125 <RandomFunc+0x25>
mov    -0x18(%rbp),%rcx
sub    $0xffffffffda4ab609,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%rax
add    %rax,%rax
add    $0x24816081,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, -10089659
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
store i64 0, i64* %6
br label %12
12: ; preds = %15, %2
%13 = load i64, i64* %6
%14 = icmp ult i64 %13, 1
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = load i64, i64* %6
%17 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %16
%18 = load i64, i64* %17
%19 = load i64, i64* %6
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %19
%21 = load i64, i64* %20
%22 = add i64 %21, %18
store i64 %22, i64* %20
%23 = load i64, i64* %6
%24 = add i64 %23, 2
store i64 %24, i64* %6
br label %12
25: ; preds = %12
%26 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%27 = load i64, i64* %26
%28 = sub i64 %27, -632637943
%29 = load i64*, i64** %4
%30 = getelementptr inbounds i64, i64* %29, i64 0
store i64 %28, i64* %30
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 1
%5 = add i64 %4, 612458625
store i64 %5, i64* %1
ret void
}
/* Variables and functions */
int stringStartsWith(char const *, char *);
bool parameterIsStruct(const char *parameterType) {
  return stringStartsWith(parameterType, "struct ");
}


x86 assembly (clang, -O0):
<parameterIsStruct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <stringStartsWith@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parameterIsStruct>:
lea    0xee9(%rip),%rsi
jmp    1030 <stringStartsWith@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"struct \00"
define i32 @parameterIsStruct(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @stringStartsWith(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"struct \00"
define i32 @parameterIsStruct(i8* %0) {
%2 = tail call i32 @stringStartsWith(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char const *, char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void setenv_fd(const char *env, int fd) {
  char buf[32];
  snprintf(buf, sizeof buf, "%d", fd);
  setenv(env, buf, 1);
}


x86 assembly (clang, -O0):
<setenv_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x20,%esi
lea    0xebe(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setenv_fd>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xecd(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x20,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @setenv_fd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [32 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @snprintf(i8* %6, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%11 = call i32 @setenv(i8* %9, i8* %10, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @setenv_fd(i8* %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @setenv(i8* %0, i8* %4, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, double);
char *energy_level_get_energy_value_key(double energy_level) {
  static char energy_value_key[128];
  sprintf(energy_value_key, "%.5lf", energy_level);
  return energy_value_key;
}


x86 assembly (clang, -O0):
<energy_level_get_energy_value_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0x2f17(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f04(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<energy_level_get_energy_value_key>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@energy_level_get_energy_value_key.energy_value_key = internal global [128 x i8] zeroinitializer
@.str = [6 x i8] c"%.5lf\00"
define i8* @energy_level_get_energy_value_key(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @energy_level_get_energy_value_key.energy_value_key, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %3)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @energy_level_get_energy_value_key.energy_value_key, i64 0, i64 0)
}

LLVM IR (-O2):
@energy_level_get_energy_value_key.energy_value_key = internal global [128 x i8] zeroinitializer
@.str = [6 x i8] c"%.5lf\00"
define i8* @energy_level_get_energy_value_key(double %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @energy_level_get_energy_value_key.energy_value_key, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %0)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @energy_level_get_energy_value_key.energy_value_key, i64 0, i64 0)
}
void CRYPTO_get_locked_mem_functions(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_get_locked_mem_functions() {
ret void
}
void gdk_drawable_get_visible_region() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drawable_get_visible_region() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void test_bar(void) { assert(0); }


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

x86 assembly (clang, -O2):
<test_bar>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test_bar() {
%1 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @test_bar() {
%1 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ runRMS(int, int, int, int);
int main() {
  runRMS(10, 25, 15, 60);
  runRMS(20, 50, 35, 100);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x19,%esi
mov    $0xf,%edx
mov    $0x3c,%ecx
call   1030 <runRMS@plt>
mov    $0x14,%edi
mov    $0x32,%esi
mov    $0x23,%edx
mov    $0x64,%ecx
call   1030 <runRMS@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x19,%esi
mov    $0xf,%edx
mov    $0x3c,%ecx
call   1030 <runRMS@plt>
mov    $0x14,%edi
mov    $0x32,%esi
mov    $0x23,%edx
mov    $0x64,%ecx
call   1030 <runRMS@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @runRMS(i32 10, i32 25, i32 15, i32 60)
%3 = call i32 @runRMS(i32 20, i32 50, i32 35, i32 100)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @runRMS(i32 10, i32 25, i32 15, i32 60)
%2 = tail call i32 @runRMS(i32 20, i32 50, i32 35, i32 100)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Type definitions */
struct list_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add(struct list_t *, void *);
void list_enqueue(struct list_t *list, void *elem) { list_add(list, elem); }


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

x86 assembly (clang, -O2):
<list_enqueue>:
jmp    1030 <list_add@plt>

LLVM IR (-O0):
%struct.list_t = type { i32 }
define void @list_enqueue(%struct.list_t* %0, i8* %1) {
%3 = alloca %struct.list_t*
%4 = alloca i8*
store %struct.list_t* %0, %struct.list_t** %3
store i8* %1, i8** %4
%5 = load %struct.list_t*, %struct.list_t** %3
%6 = load i8*, i8** %4
%7 = call i32 @list_add(%struct.list_t* %5, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.list_t = type { i32 }
define void @list_enqueue(%struct.list_t* %0, i8* %1) {
%3 = tail call i32 @list_add(%struct.list_t* %0, i8* %1)
ret void
}
int test_imm_8Cuint8_reg(unsigned char val) {
  return ((val) & (-0x8C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Cuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff74,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Cuint8_reg>:
test   $0x74,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Cuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 116
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long long int fn10(long long int x, unsigned long long y) { return x << y; }


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

x86 assembly (clang, -O2):
<fn10>:
mov    %rsi,%rcx
mov    %rdi,%rax
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @fn10(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = shl i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @fn10(i64 %0, i64 %1) {
%3 = shl i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
double leafperimeter(int libcropcode) {
  if (libcropcode == 0) {
    printf("unknown crop\n");
    return (-28768);
  }
  if (libcropcode == 1) {
    printf("CIA Corn 2008-2010 (unpublished)\n");
    return (174);
  }
}


x86 assembly (clang, -O0):
<leafperimeter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1143 <leafperimeter+0x33>
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
movsd  0xecf(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1166 <leafperimeter+0x56>
cmpl   $0x1,-0xc(%rbp)
jne    1166 <leafperimeter+0x56>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leafperimeter>:
push   %rax
test   %edi,%edi
je     1130 <leafperimeter+0x20>
cmp    $0x1,%edi
jne    114e <leafperimeter+0x3e>
movsd  0xee6(%rip),%xmm0
movsd  %xmm0,(%rsp)
lea    0xee2(%rip),%rdi
jmp    1144 <leafperimeter+0x34>
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,(%rsp)
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"unknown crop\0A\00"
@.str.1 = [34 x i8] c"CIA Corn 2008-2010 (unpublished)\0A\00"
define double @leafperimeter(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store double -2.876800e+04, double* %2
br label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
store double 1.740000e+02, double* %2
br label %13
13: ; preds = %6, %11, %8
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
@str = [33 x i8] c"CIA Corn 2008-2010 (unpublished)\00"
@str.2 = [13 x i8] c"unknown crop\00"
define double @leafperimeter(i32 %0) {
switch i32 %0, label %7 [
i32 0, label %3
i32 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i8* [ getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0), %1 ]
%5 = phi double [ 1.740000e+02, %2 ], [ -2.876800e+04, %1 ]
%6 = tail call i32 @puts(i8* dereferenceable(1) %4)
br label %7
7: ; preds = %3, %1
%8 = phi double [ undef, %1 ], [ %5, %3 ]
ret double %8
}
int aes_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @aes_init() {
ret i32 0
}