xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int /*<<< orphan*/ updatestats(int, int);
void printsize(int size, int csize) {
  char s[17];
  updatestats(size, csize);
  snprintf(s, 17, "%7d(%d)", size, csize);
  printf("%-16s ", s);
}


x86 assembly (clang, -O0):
<printsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <updatestats@plt>
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    $0x11,%esi
lea    0xea0(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x20(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printsize>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
call   1050 <updatestats@plt>
lea    0xeb8(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x11,%esi
mov    %ebp,%ecx
mov    %ebx,%r8d
call   1040 <snprintf@plt>
lea    0xea4(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%7d(%d)\00"
@.str.1 = [7 x i8] c"%-16s \00"
define void @printsize(i32 %0, i32 %1) {
%3 = alloca [17 x i8]
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @updatestats(i32 %0, i32 %1)
%6 = call i32 @snprintf(i8* %4, i32 17, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
void *list_copy_int(void *_data) {
  int *new_data = malloc(sizeof(int));
  memcpy(new_data, _data, sizeof(int));
  return new_data;
}


x86 assembly (clang, -O0):
<list_copy_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_copy_int>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    (%rbx),%ecx
mov    %ecx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @list_copy_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i8* @malloc(i64 4)
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = bitcast i32* %6 to i8*
%8 = load i8*, i8** %2
%9 = load i32*, i32** %3
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @list_copy_int(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %3
store i32 %5, i32* %4
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ detab(char *, char *, int);
scalar_t__ getln(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  char line1[1000];
  char line2[1000];
  while (getln(line1, 1000) > 0) {
    detab(line1, line2, 1000);
    printf("%s", line2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getln@plt>
cmp    $0x0,%rax
jle    118d <main+0x5d>
lea    -0x3f0(%rbp),%rdi
lea    -0x7e0(%rbp),%rsi
mov    $0x3e8,%edx
call   1030 <detab@plt>
lea    -0x7e0(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1050 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x7e0,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getln@plt>
test   %rax,%rax
jle    118d <main+0x5d>
mov    %rsp,%r14
lea    0x3f0(%rsp),%rbx
lea    0xea0(%rip),%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x3e8,%edx
call   1030 <detab@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %r14,%rdi
mov    $0x3e8,%esi
call   1040 <getln@plt>
test   %rax,%rax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i64 @getln(i8* %3, i32 1000)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = call i32 @detab(i8* %3, i8* %4, i32 1000)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = call i64 @getln(i8* %3, i32 1000)
%11 = icmp sgt i64 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_peer_get_user_unit(int fd,
                                                                 char **unit) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_peer_get_user_unit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_peer_get_user_unit>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_peer_get_user_unit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_peer_get_user_unit(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
void ffi_test_0(void) {}


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

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

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

LLVM IR (-O2):
define void @ffi_test_0() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ readl(void *);
uint32_t read_pxpat1c(unsigned port) {
  return readl((void *)0xb0010000 + (port * 0x100) + (0x38));
}


x86 assembly (clang, -O0):
<read_pxpat1c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%edi
add    %rax,%rdi
add    $0x38,%rdi
call   1030 <readl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pxpat1c>:
shl    $0x8,%edi
mov    $0xb0010038,%eax
add    %rax,%rdi
jmp    1030 <readl@plt>

LLVM IR (-O0):
define i32 @read_pxpat1c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 256
%5 = zext i32 %4 to i64
%6 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %5
%7 = getelementptr i8, i8* %6, i64 56
%8 = call i32 @readl(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @read_pxpat1c(i32 %0) {
%2 = shl i32 %0, 8
%3 = zext i32 %2 to i64
%4 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %3
%5 = getelementptr i8, i8* %4, i64 56
%6 = tail call i32 @readl(i8* %5)
ret i32 %6
}
int output_file_configure(int sample_rate, int channels, void *module_data) {
  (void)sample_rate;
  (void)channels;
  (void)module_data;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @output_file_configure(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @output_file_configure(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
void template_normal_function2() {}


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

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

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

LLVM IR (-O2):
define void @template_normal_function2() {
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int stringcmp(void *a, void *b) { return strcmp((char *)a, (char *)b); }


x86 assembly (clang, -O0):
<stringcmp>:
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 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringcmp>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @stringcmp(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 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @stringcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func_3(int (*a)[3][5]) { printf("%d\n", a[1][2][3]); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @func_3([3 x [5 x i32]]* nocapture %0) {
%2 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %0, i64 1, i64 2, i64 3
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int func();
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (func() == 1) {
    printf("Iz success.\n");
  } else {
    printf("Iz fail.\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <func@plt>
cmp    $0x1,%eax
jne    1150 <main+0x30>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <main+0x48>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    116f <main+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo329() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prs_error(char *);
void OptionError() {
  prs_error("Incorrect parameter redefinition on command line\n");
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"Incorrect parameter redefinition on command line\0A\00"
define void @OptionError() {
%1 = call i32 @prs_error(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"Incorrect parameter redefinition on command line\0A\00"
define void @OptionError() {
%1 = tail call i32 @prs_error(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}
void iodelay() { asm volatile("nop\nnop\nnop\nnop\nnop"); }


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

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

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

LLVM IR (-O2):
define void @iodelay() {
tail call void asm sideeffect "nop\0Anop\0Anop\0Anop\0Anop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EPRINT(char *);
int /*<<< orphan*/ O_RDWR;
int errno;
int open(char *, int /*<<< orphan*/);
int devspec_init(int *fd_spec) {
  *fd_spec = open("/dev/"
                  "spec0",
                  O_RDWR);
  if (*fd_spec < 0) {
    EPRINT("cannot open spec device");
    return errno;
  }
  return 0;
}


x86 assembly (clang, -O0):
<devspec_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xec4(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jge    1173 <devspec_init+0x53>
lea    0xeae(%rip),%rdi
call   1030 <EPRINT@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117a <devspec_init+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devspec_init>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%ecx
mov    %eax,(%rbx)
xor    %eax,%eax
test   %ecx,%ecx
js     1145 <devspec_init+0x25>
pop    %rbx
ret
lea    0xebf(%rip),%rdi
call   1030 <EPRINT@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/spec0\00"
@O_RDWR = global i32 0
@.str.1 = [24 x i8] c"cannot open spec device\00"
@errno = global i32 0
define i32 @devspec_init(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32, i32* @O_RDWR
%5 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %3
store i32 %5, i32* %6
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = call i32 @EPRINT(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @errno
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/spec0\00"
@O_RDWR = global i32 0
@.str.1 = [24 x i8] c"cannot open spec device\00"
@errno = global i32 0
define i32 @devspec_init(i32* nocapture writeonly %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %0
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @EPRINT(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @errno
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
void handle(int newsock, fd_set *set) {}


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

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

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

LLVM IR (-O2):
define void @handle(i32 %0, i32* nocapture %1) {
ret void
}
int toupper(int c) {
  unsigned char cb = c;
  if ((cb >= 'a') && (cb <= 'z'))
    cb ^= 0x20;
  return cb;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1131 <toupper+0x31>
movzbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1131 <toupper+0x31>
movzbl -0x5(%rbp),%eax
xor    $0x20,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
movzbl %dil,%eax
add    $0xffffff9f,%eax
mov    %edi,%ecx
xor    $0x20,%ecx
cmp    $0x1a,%eax
cmovae %edi,%ecx
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = icmp sge i32 %7, 97
br i1 %8, label %9, label %18
9: ; preds = %1
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = icmp sle i32 %11, 122
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = xor i32 %15, 32
%17 = trunc i32 %16 to i8
store i8 %17, i8* %3
br label %18
18: ; preds = %13, %9, %1
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = and i32 %0, 255
%3 = add nsw i32 %2, -97
%4 = icmp ult i32 %3, 26
%5 = xor i32 %0, 32
%6 = select i1 %4, i32 %5, i32 %0
%7 = and i32 %6, 255
ret i32 %7
}
int memcmp(const void *__m1, const void *__m2, unsigned int __n) {
  _Bool rv;
  asm volatile("cld ; repe ; cmpsb ; setne %0"
               : "=abd"(rv), "+D"(__m1), "+S"(__m2), "+c"(__n));
  return rv;
}


x86 assembly (clang, -O0):
<memcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
cld
repz cmpsb %es:(%rdi),%ds:(%rsi)
setne  %al
mov    %al,-0x15(%rbp)
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcmp>:
mov    %edx,%ecx
cld
repz cmpsb %es:(%rdi),%ds:(%rsi)
setne  %al
and    $0x1,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @memcmp(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call { i8, i8*, i8*, i32 } asm sideeffect "cld ; repe ; cmpsb ; setne $0", "={ax}{bx}{dx},={di},={si},={cx},1,2,3,~{dirflag},~{fpsr},~{flags}"(i8* %8, i8* %9, i32 %10)
%12 = extractvalue { i8, i8*, i8*, i32 } %11, 0
%13 = extractvalue { i8, i8*, i8*, i32 } %11, 1
%14 = extractvalue { i8, i8*, i8*, i32 } %11, 2
%15 = extractvalue { i8, i8*, i8*, i32 } %11, 3
store i8 %12, i8* %7
store i8* %13, i8** %4
store i8* %14, i8** %5
store i32 %15, i32* %6
%16 = load i8, i8* %7
%17 = trunc i8 %16 to i1
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @memcmp(i8* %0, i8* %1, i32 %2) {
%4 = tail call { i8, i8*, i8*, i32 } asm sideeffect "cld ; repe ; cmpsb ; setne $0", "={ax}{bx}{dx},={di},={si},={cx},1,2,3,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1, i32 %2)
%5 = extractvalue { i8, i8*, i8*, i32 } %4, 0
%6 = and i8 %5, 1
%7 = zext i8 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int const EOF;
int getc(int /*<<< orphan*/ *);
size_t serd_file_read_byte(void *const buf, const size_t size,
                           const size_t nmemb, void *const stream) {
  (void)size;
  (void)nmemb;
  const int c = getc((FILE *)stream);
  if (c == EOF) {
    *((uint8_t *)buf) = 0;
    return 0;
  }
  *((uint8_t *)buf) = (uint8_t)c;
  return 1;
}


x86 assembly (clang, -O0):
<serd_file_read_byte>:
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    -0x28(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%eax
jne    115e <serd_file_read_byte+0x4e>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1171 <serd_file_read_byte+0x61>
movslq -0x2c(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serd_file_read_byte>:
push   %rbx
mov    %rdi,%rbx
mov    %rcx,%rdi
call   1030 <getc@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
cltq
mov    %rax,(%rbx)
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = constant i32 0
define i64 @serd_file_read_byte(i8* nocapture writeonly %0, i64 %1, i64 %2, i8* nocapture %3) {
%5 = bitcast i8* %3 to i32*
%6 = tail call i32 @getc(i32* %5)
%7 = icmp ne i32 %6, 0
%8 = sext i32 %6 to i64
%9 = zext i1 %7 to i64
%10 = bitcast i8* %0 to i64*
store i64 %8, i64* %10
ret i64 %9
}
/* Variables and functions */
size_t int_len(size_t);
size_t arg_len(size_t bulklen) {
  return 1 + int_len(bulklen) + 2 + bulklen + 2;
}


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

x86 assembly (clang, -O2):
<arg_len>:
push   %rbx
mov    %rdi,%rbx
call   1030 <int_len@plt>
add    %rbx,%rax
add    $0x5,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @arg_len(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @int_len(i64 %3)
%5 = add i64 1, %4
%6 = add i64 %5, 2
%7 = load i64, i64* %2
%8 = add i64 %6, %7
%9 = add i64 %8, 2
ret i64 %9
}

LLVM IR (-O2):
define i64 @arg_len(i64 %0) {
%2 = tail call i64 @int_len(i64 %0)
%3 = add i64 %0, 5
%4 = add i64 %3, %2
ret i64 %4
}
int right_child(int current) { return current * 2 + 1; }


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

x86 assembly (clang, -O2):
<right_child>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @right_child(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gpio_dir_mask(unsigned char);
void gpio_dir(int dir_so, int dir_si, int dir_sd, int dir_sc) {
  unsigned char mask;
  mask = ((dir_so & 1) << 7) | ((dir_si & 1) << 6) | ((dir_sd & 1) << 5) |
         ((dir_sc & 1) << 4);
  gpio_dir_mask(mask);
}


x86 assembly (clang, -O0):
<gpio_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x7,%eax
mov    -0x8(%rbp),%ecx
and    $0x1,%ecx
shl    $0x6,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0x1,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
and    $0x1,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%edi
call   1030 <gpio_dir_mask@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_dir>:
shl    $0x7,%edi
shl    $0x6,%esi
and    $0x40,%esi
or     %edi,%esi
shl    $0x5,%edx
and    $0x20,%edx
or     %esi,%edx
shl    $0x4,%ecx
and    $0x10,%ecx
or     %edx,%ecx
movzbl %cl,%edi
jmp    1030 <gpio_dir_mask@plt>

LLVM IR (-O0):
define void @gpio_dir(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = and i32 %10, 1
%12 = shl i32 %11, 7
%13 = load i32, i32* %6
%14 = and i32 %13, 1
%15 = shl i32 %14, 6
%16 = or i32 %12, %15
%17 = load i32, i32* %7
%18 = and i32 %17, 1
%19 = shl i32 %18, 5
%20 = or i32 %16, %19
%21 = load i32, i32* %8
%22 = and i32 %21, 1
%23 = shl i32 %22, 4
%24 = or i32 %20, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %9
%26 = load i8, i8* %9
%27 = call i32 @gpio_dir_mask(i8 zeroext %26)
ret void
}

LLVM IR (-O2):
define void @gpio_dir(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 7
%6 = shl i32 %1, 6
%7 = and i32 %6, 64
%8 = or i32 %7, %5
%9 = shl i32 %2, 5
%10 = and i32 %9, 32
%11 = or i32 %8, %10
%12 = shl i32 %3, 4
%13 = and i32 %12, 16
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
%16 = tail call i32 @gpio_dir_mask(i8 zeroext %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ return_work_path(long long);
int /*<<< orphan*/ unlink(char *);
void free_tmp_file(char *path, long long size) {
  unlink(path);
  return_work_path(size);
  free(path);
}


x86 assembly (clang, -O0):
<free_tmp_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <unlink@plt>
mov    -0x10(%rbp),%rdi
call   1050 <return_work_path@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_tmp_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <unlink@plt>
mov    %r14,%rdi
call   1050 <return_work_path@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_tmp_file(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = call i32 @unlink(i8* %5)
%7 = load i64, i64* %4
%8 = call i32 @return_work_path(i64 %7)
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @free_tmp_file(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @unlink(i8* %0)
%4 = tail call i32 @return_work_path(i64 %1)
%5 = tail call i32 @free(i8* %0)
ret void
}
int baz(void) {
  int a;
  return _Generic(0, long long : a, int : 0);
}


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

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

LLVM IR (-O0):
define i32 @baz() {
%1 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @baz() {
ret i32 0
}
int ft_free(void **str, int ret) {
  debug_stdout("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/gmange/42sh/refs/heads/"
               "master/src/unix/ft_exit.c",
               54, __func__, "INIT\n");
  if (*str)
    ft_memdel(str);
  return (ret);
}


x86 assembly (clang, -O0):
<ft_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x36,%esi
lea    0xf49(%rip),%rdx
lea    0xf4a(%rip),%rcx
mov    $0x0,%al
call   1040 <debug_stdout@plt>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1169 <ft_free+0x49>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <ft_memdel@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_free>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
lea    0xf55(%rip),%rdx
lea    0xf56(%rip),%rcx
mov    $0x36,%esi
xor    %eax,%eax
call   1040 <debug_stdout@plt>
cmpq   $0x0,(%rbx)
je     1159 <ft_free+0x39>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <ft_memdel@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gmange/42sh/refs/heads/master/src/unix/ft_exit.c\00"
@__func__.ft_free = [8 x i8] c"ft_free\00"
@.str.1 = [6 x i8] c"INIT\0A\00"
define i32 @ft_free(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @debug_stdout to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 54, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.ft_free, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8**, i8*** %3
%11 = call i32 (i8**, ...) bitcast (i32 (...)* @ft_memdel to i32 (i8**, ...)*)(i8** %10)
br label %12
12: ; preds = %9, %2
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gmange/42sh/refs/heads/master/src/unix/ft_exit.c\00"
@__func__.ft_free = [8 x i8] c"ft_free\00"
@.str.1 = [6 x i8] c"INIT\0A\00"
define i32 @ft_free(i8** %0, i32 returned %1) {
%3 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @debug_stdout to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 54, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.ft_free, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (i8**, ...) bitcast (i32 (...)* @ft_memdel to i32 (i8**, ...)*)(i8** %0)
br label %8
8: ; preds = %6, %2
ret i32 %1
}
int XDoesSaveUnders() {}


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

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

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

LLVM IR (-O2):
define i32 @XDoesSaveUnders() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_fail(char *, char *);
void test_create_destroy(void *fixture) {
  do {
    if (!(fixture)) {
      test_fail("assertion failed: '%s'", "fixture");
    }
  } while (0);
}


x86 assembly (clang, -O0):
<test_create_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113a <test_create_destroy+0x2a>
lea    0xed2(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1030 <test_fail@plt>
jmp    113f <test_create_destroy+0x2f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_create_destroy>:
test   %rdi,%rdi
je     1116 <test_create_destroy+0x6>
ret
lea    0xee3(%rip),%rdi
lea    0xef3(%rip),%rsi
jmp    1030 <test_fail@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"assertion failed: '%s'\00"
@.str.1 = [8 x i8] c"fixture\00"
define void @test_create_destroy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = call i32 @test_fail(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
br label %9
9: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"assertion failed: '%s'\00"
@.str.1 = [8 x i8] c"fixture\00"
define void @test_create_destroy(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @test_fail(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
ret void
}
int main() {
  if (0) {
    return 4;
  }
  return 5;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Variables and functions */
int is_first_in_group_UnderlyingInstrument(size_t __tag) {
  return (__tag == (311)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_first_in_group_UnderlyingInstrument>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x137,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_first_in_group_UnderlyingInstrument>:
xor    %eax,%eax
cmp    $0x137,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_first_in_group_UnderlyingInstrument(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 311
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_first_in_group_UnderlyingInstrument(i64 %0) {
%2 = icmp eq i64 %0, 311
%3 = zext i1 %2 to i32
ret i32 %3
}
void X509_subject_name_hash(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_subject_name_hash() {
ret void
}
/* Variables and functions */
void puts(char *s) {
  while (*s) {
    *((char *)0xffffffff) = *s++;
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <puts+0x32>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    $0xffffffff,%eax
mov    %cl,(%rax)
jmp    1108 <puts+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
mov    (%rdi),%al
test   %al,%al
je     111d <puts+0x1d>
add    $0x1,%rdi
mov    $0xffffffff,%ecx
nop
mov    %al,(%rcx)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <puts+0x10>
ret

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %8, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %5, i8* inttoptr (i64 4294967295 to i8*)
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret void
}
/* Variables and functions */
char toupper(char);
char *convUp(char *v, int dim) {
  int i = 0;
  for (i = 0; i < dim; i++)
    v[i] = toupper(v[i]);
  return v;
}


x86 assembly (clang, -O0):
<convUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1165 <convUp+0x55>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <convUp+0x1d>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convUp>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
test   %esi,%esi
jle    1147 <convUp+0x37>
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <convUp+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @convUp(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
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %24
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 signext i8 @toupper(i8 signext %15)
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 %16, i8* %20
br label %21
21: ; preds = %10
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @convUp(i8* returned %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 signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void hangSleep(int msec) { usleep(msec * 1000); }


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

x86 assembly (clang, -O2):
<hangSleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @hangSleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @hangSleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ezmbs_free_frame(void *_ptr) { free(_ptr); }


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

x86 assembly (clang, -O2):
<ezmbs_free_frame>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ezmbs_free_frame(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *const, char const *const);
void print_string(const char *const name, const char *const val) {
  printf("   %-46s : constant string  := \"%s\";\n", name, val);
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c" %-46s : constant string := \22%s\22;\0A\00"
define void @print_string(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 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c" %-46s : constant string := \22%s\22;\0A\00"
define void @print_string(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void f1() {
  int x;
  int *p;
  x = 1;
  p = 0;
  if (x != 1)
    *p = 1;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1127 <f1+0x27>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32
%2 = alloca i32*
store i32 1, i32* %1
store i32* null, i32** %2
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32*, i32** %2
store i32 1, i32* %6
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @f1() {
ret void
}
void hdp_data_clear(unsigned char *data, const int length) {
  int i;
  for (i = 0; i < length; i++) {
    *(data + i) = 0;
  }
}


x86 assembly (clang, -O0):
<hdp_data_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <hdp_data_clear+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <hdp_data_clear+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdp_data_clear>:
test   %esi,%esi
jle    1122 <hdp_data_clear+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @hdp_data_clear(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 = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
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
store i8 0, i8* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @hdp_data_clear(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int DT_UNKNOWN;
int IFTODT(int /*<<< orphan*/);
int stat(char *, struct stat *);
int get_file_type(char *file) {
  struct stat sb;
  if (stat(file, &sb) == -1) {
    return DT_UNKNOWN;
  }
  return IFTODT(sb.st_mode);
}


x86 assembly (clang, -O0):
<get_file_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    1153 <get_file_type+0x33>
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <get_file_type+0x3e>
mov    -0x18(%rbp),%edi
call   1040 <IFTODT@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_type>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1137 <get_file_type+0x17>
mov    (%rsp),%edi
pop    %rax
jmp    1040 <IFTODT@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@DT_UNKNOWN = global i32 0
define i32 @get_file_type(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* @DT_UNKNOWN
store i32 %9, i32* %2
br label %14
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @IFTODT(i32 %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@DT_UNKNOWN = global i32 0
define i32 @get_file_type(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @DT_UNKNOWN
br label %12
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
%11 = tail call i32 @IFTODT(i32 %10)
br label %12
12: ; preds = %8, %6
%13 = phi i32 [ %7, %6 ], [ %11, %8 ]
ret i32 %13
}