xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printInt(int v) { printf("%d\n", v); }


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

x86 assembly (clang, -O2):
<printInt>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @printInt(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRE9_get(void) { return U_WMRCORENONE_get("U_WMRE9"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRE9\00"
define i32 @U_WMRE9_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRE9\00"
define i32 @U_WMRE9_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 1;
  printf("Hello World!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
float *malloc(int);
float *reservar(int puntos) {
  float *array = malloc(puntos * sizeof(float));
  int i;
  for (i = 0; i < puntos; i++) {
    array[i] = 0.0;
  }
  return array;
}


x86 assembly (clang, -O0):
<reservar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115f <reservar+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <reservar+0x25>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reservar>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1149 <reservar+0x29>
mov    %ebx,%edx
shl    $0x2,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float* @reservar(i32 %0) {
%2 = alloca i32
%3 = alloca float*
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 4
%8 = trunc i64 %7 to i32
%9 = call float* @malloc(i32 %8)
store float* %9, float** %3
store i32 0, i32* %4
br label %10
10: ; preds = %19, %1
%11 = load i32, i32* %4
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load float*, float** %3
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* %15, i64 %17
store float 0.000000e+00, float* %18
br label %19
19: ; preds = %14
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %10
22: ; preds = %10
%23 = load float*, float** %3
ret float* %23
}

LLVM IR (-O2):
define noalias float* @reservar(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call float* @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = bitcast float* %3 to i8*
%7 = zext i32 %0 to i64
%8 = shl nuw nsw i64 %7, 2
br label %9
9: ; preds = %5, %1
ret float* %3
}
/* Variables and functions */
int /*<<< orphan*/ core9_swap(char *, int);
void U_EMRARC_swap(char *record, int torev) { core9_swap(record, torev); }


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

x86 assembly (clang, -O2):
<U_EMRARC_swap>:
jmp    1030 <core9_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRARC_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core9_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr, "Usage: %s [-c config_file] [-d] [-p pid_file] [-q]\n", name);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: %s [-c config_file] [-d] [-p pid_file] [-q]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: %s [-c config_file] [-d] [-p pid_file] [-q]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int f(int x) { return x + 42; }


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

x86 assembly (clang, -O2):
<f>:
lea    0x2a(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 42
ret i32 %2
}
void gtk_font_selection_dialog_set_font_name() {}


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

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

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

LLVM IR (-O2):
define void @gtk_font_selection_dialog_set_font_name() {
ret void
}
void modif_rear2pcre_delim() {}


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

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

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

LLVM IR (-O2):
define void @modif_rear2pcre_delim() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ return_wrapper(int);
void exit_wrapper(int exitval) { exit(return_wrapper(exitval)); }


x86 assembly (clang, -O0):
<exit_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <return_wrapper@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_wrapper>:
push   %rax
call   1030 <return_wrapper@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @exit_wrapper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @return_wrapper(i32 %3)
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @exit_wrapper(i32 %0) {
%2 = tail call i32 @return_wrapper(i32 %0)
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ imprimir_valores(int ***, int, int);
int main() {
  int arreglo[][17] = {
      {4, 6, 18, 10, 12, 45, 67, 54, 32, 45, 32, 34, 32, 45, 54, 65, 78},
      {16, 17, 18, 19, 110, 45, 76, 23, 56, 45, 65, 76, 45, 32, 34, 43, 45}};
  imprimir_valores(&arreglo, 2, 17);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x88,%edx
call   1040 <memcpy@plt>
lea    -0x90(%rbp),%rdi
mov    $0x2,%esi
mov    $0x11,%edx
call   1030 <imprimir_valores@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x88,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x11,%edx
call   1030 <imprimir_valores@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arreglo = [2 x [17 x i32]] [[17 x i32] [i32 4, i32 6, i32 18, i32 10, i32 12, i32 45, i32 67, i32 54, i32 32, i32 45, i32 32, i32 34, i32 32, i32 45, i32 54, i32 65, i32 78], [17 x i32] [i32 16, i32 17, i32 18, i32 19, i32 110, i32 45, i32 76, i32 23, i32 56, i32 45, i32 65, i32 76, i32 45, i32 32, i32 34, i32 43, i32 45]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [17 x i32]]
store i32 0, i32* %1
%3 = bitcast [2 x [17 x i32]]* %2 to i8*
%4 = bitcast [2 x [17 x i32]]* %2 to i32***
%5 = call i32 @imprimir_valores(i32*** %4, i32 2, i32 17)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arreglo = [2 x [17 x i32]] [[17 x i32] [i32 4, i32 6, i32 18, i32 10, i32 12, i32 45, i32 67, i32 54, i32 32, i32 45, i32 32, i32 34, i32 32, i32 45, i32 54, i32 65, i32 78], [17 x i32] [i32 16, i32 17, i32 18, i32 19, i32 110, i32 45, i32 76, i32 23, i32 56, i32 45, i32 65, i32 76, i32 45, i32 32, i32 34, i32 43, i32 45]]
define i32 @main() {
%1 = alloca [2 x [17 x i32]]
%2 = bitcast [2 x [17 x i32]]* %1 to i8*
%3 = bitcast [2 x [17 x i32]]* %1 to i32***
%4 = call i32 @imprimir_valores(i32*** %3, i32 2, i32 17)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *getfile(char *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
void closefile(char *name) {
  FILE *f = getfile(name);
  if (f == stdin || f == stdout)
    return;
  if ((-1) == -1)
    fclose(f);
}


x86 assembly (clang, -O0):
<closefile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getfile@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ea4(%rip),%rcx
cmp    (%rcx),%rax
je     1161 <closefile+0x41>
mov    -0x10(%rbp),%rax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%rax
jne    1166 <closefile+0x46>
jmp    116f <closefile+0x4f>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closefile>:
push   %rax
call   1040 <getfile@plt>
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
je     1147 <closefile+0x27>
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%rax
je     1147 <closefile+0x27>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>
pop    %rax
ret

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32* null
define void @closefile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @getfile(i8* %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32*, i32** @stdin
%8 = icmp eq i32* %6, %7
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = load i32*, i32** @stdout
%12 = icmp eq i32* %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9, %1
br label %17
14: ; preds = %9
%15 = load i32*, i32** %3
%16 = call i32 @fclose(i32* %15)
br label %17
17: ; preds = %14, %13
ret void
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32* null
define void @closefile(i8* %0) {
%2 = tail call i32* @getfile(i8* %0)
%3 = load i32*, i32** @stdin
%4 = icmp eq i32* %2, %3
%5 = load i32*, i32** @stdout
%6 = icmp eq i32* %2, %5
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @fclose(i32* %2)
br label %10
10: ; preds = %1, %8
ret void
}
void RTHeapOffsetGetFreeSize(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHeapOffsetGetFreeSize() {
ret void
}
int rec_size(const struct iam_rec *rec) { return *(const char *)rec; }


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

x86 assembly (clang, -O2):
<rec_size>:
movsbl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.iam_rec = type opaque
define i32 @rec_size(%struct.iam_rec* %0) {
%2 = alloca %struct.iam_rec*
store %struct.iam_rec* %0, %struct.iam_rec** %2
%3 = load %struct.iam_rec*, %struct.iam_rec** %2
%4 = bitcast %struct.iam_rec* %3 to i8*
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.iam_rec = type opaque
define i32 @rec_size(%struct.iam_rec* nocapture %0) {
%2 = bitcast %struct.iam_rec* %0 to i8*
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
void __no_val_copy_1_alter(void *cc, void *k, void *v, bool n) {
  static int64_t i = 0;
  *(int64_t *)v = i++;
}


x86 assembly (clang, -O0):
<__no_val_copy_1_alter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2f0e(%rip),%rcx
mov    %rcx,%rax
add    $0x1,%rax
mov    %rax,0x2f00(%rip)
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__no_val_copy_1_alter>:
mov    0x2f21(%rip),%rax
lea    0x1(%rax),%rcx
mov    %rcx,0x2f16(%rip)
mov    %rax,(%rdx)
ret

LLVM IR (-O0):
@__no_val_copy_1_alter.i = internal global i64 0
define void @__no_val_copy_1_alter(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i64, i64* @__no_val_copy_1_alter.i
%10 = add nsw i64 %9, 1
store i64 %10, i64* @__no_val_copy_1_alter.i
%11 = load i8*, i8** %7
%12 = bitcast i8* %11 to i64*
store i64 %9, i64* %12
ret void
}

LLVM IR (-O2):
@__no_val_copy_1_alter.i = internal unnamed_addr global i64 0
define void @__no_val_copy_1_alter(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture writeonly %2, i32 %3) {
%5 = load i64, i64* @__no_val_copy_1_alter.i
%6 = add nsw i64 %5, 1
store i64 %6, i64* @__no_val_copy_1_alter.i
%7 = bitcast i8* %2 to i64*
store i64 %5, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ all_positive(int **, int);
void main() {
  int array[11] = {2, -1};
  all_positive(&array, 11);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x2c,%edx
call   1030 <memset@plt>
movl   $0x2,-0x30(%rbp)
movl   $0xffffffff,-0x2c(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1040 <all_positive@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movups %xmm0,0x1c(%rsp)
movaps %xmm0,0x10(%rsp)
movabs $0xffffffff00000002,%rax
ff ff ff
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0xb,%esi
call   1030 <all_positive@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = bitcast i8* %2 to <{ i32, i32, [9 x i32] }>*
%4 = getelementptr inbounds <{ i32, i32, [9 x i32] }>, <{ i32, i32, [9 x i32] }>* %3, i32 0, i32 0
store i32 2, i32* %4
%5 = getelementptr inbounds <{ i32, i32, [9 x i32] }>, <{ i32, i32, [9 x i32] }>* %3, i32 0, i32 1
store i32 -1, i32* %5
%6 = bitcast [11 x i32]* %1 to i32**
%7 = call i32 @all_positive(i32** %6, i32 11)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
store i32 2, i32* %3
%4 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 1
store i32 -1, i32* %4
%5 = bitcast [11 x i32]* %1 to i32**
%6 = call i32 @all_positive(i32** %5, i32 11)
ret void
}
/* Variables and functions */
int blue_main(int, char **);
int main(int argc, char **argv) { return blue_main(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <blue_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <blue_main@plt>

LLVM IR (-O0):
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 i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @blue_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @blue_main(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ wint_t;

/* Variables and functions */
int iscntrl(scalar_t__);
int iswcntrl(wint_t wc) { return ((wc < (wint_t)0x100 ? iscntrl(wc) : 0)); }


x86 assembly (clang, -O0):
<iswcntrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x100,-0x8(%rbp)
jge    113b <iswcntrl+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <iscntrl@plt>
mov    %eax,-0xc(%rbp)
jmp    1145 <iswcntrl+0x35>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <iswcntrl+0x35>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswcntrl>:
cmp    $0xff,%rdi
jg     111e <iswcntrl+0xe>
jmp    1030 <iscntrl@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iswcntrl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 256
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = call i32 @iscntrl(i64 %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @iswcntrl(i64 %0) {
%2 = icmp slt i64 %0, 256
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @iscntrl(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ beep();
void nmstermio_beep(void) { beep(); }


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

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

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

LLVM IR (-O2):
define void @nmstermio_beep() {
%1 = tail call i32 (...) @beep()
ret void
}
/* Variables and functions */
int hash();
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int h = hash();
  printf("Start -> %d, 0x%x\n", h, h);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <hash@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <hash@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Start -> %d, 0x%x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @hash()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %3)
ret i32 0
}
int main() {
  __asm__ __volatile__("enter $65535, $31" : : :);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
enter  $0xffff,$0x1f
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "enter $$65535, $$31", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
void dispatch_atfork_child(void) {}


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

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

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

LLVM IR (-O2):
define void @dispatch_atfork_child() {
ret void
}
int fun206() { return 206; }


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

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

LLVM IR (-O0):
define i32 @fun206() {
ret i32 206
}

LLVM IR (-O2):
define i32 @fun206() {
ret i32 206
}
/* Variables and functions */
scalar_t__ ft_memcpy(char *, char const *, size_t const);
size_t ft_strlen(char const *);
char *malloc(size_t const);
char *ft_strdup(const char *s) {
  char *str;
  const size_t len = ft_strlen(s);
  str = malloc(len + 1);
  return ((str) ? (char *)ft_memcpy(str, s, len + 1) : NULL);
}


x86 assembly (clang, -O0):
<ft_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1183 <ft_strdup+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1050 <ft_memcpy@plt>
mov    %rax,-0x20(%rbp)
jmp    118e <ft_strdup+0x5e>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    118e <ft_strdup+0x5e>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <ft_strlen@plt>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1160 <ft_strdup+0x30>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <ft_memcpy@plt>
jmp    1162 <ft_strdup+0x32>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @ft_strlen(i8* %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = add i64 %7, 1
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %19
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = load i64, i64* %4
%16 = add i64 %15, 1
%17 = call i64 @ft_memcpy(i8* %13, i8* %14, i64 %16)
%18 = inttoptr i64 %17 to i8*
br label %20
19: ; preds = %1
br label %20
20: ; preds = %19, %12
%21 = phi i8* [ %18, %12 ], [ null, %19 ]
ret i8* %21
}

LLVM IR (-O2):
define i8* @ft_strdup(i8* %0) {
%2 = tail call i64 @ft_strlen(i8* %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i64 @ft_memcpy(i8* %4, i8* %0, i64 %3)
%8 = inttoptr i64 %7 to i8*
br label %9
9: ; preds = %1, %6
%10 = phi i8* [ %8, %6 ], [ null, %1 ]
ret i8* %10
}
int op_sub(int a, int b) { return a - b; }


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

x86 assembly (clang, -O2):
<op_sub>:
mov    %edi,%eax
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @op_sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
int main() {
  unsigned __int128 x = foo();
  if ((unsigned long long)x != 0xfffffffffffffffeULL ||
      (unsigned long long)(x >> 64) != 1)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   1040 <foo@plt>
movslq %eax,%rcx
mov    %rcx,%rax
sar    $0x3f,%rax
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
cmp    $0xfffffffffffffffe,%rax
jne    1164 <main+0x44>
mov    -0x18(%rbp),%rax
cmp    $0x1,%rax
je     1169 <main+0x49>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i128
store i32 0, i32* %1
%3 = call i32 (...) @foo()
%4 = sext i32 %3 to i128
store i128 %4, i128* %2
%5 = load i128, i128* %2
%6 = trunc i128 %5 to i64
%7 = icmp ne i64 %6, -2
br i1 %7, label %13, label %8
8: ; preds = %0
%9 = load i128, i128* %2
%10 = lshr i128 %9, 64
%11 = trunc i128 %10 to i64
%12 = icmp ne i64 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %8, %0
unreachable
14: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
tail call void @abort()
unreachable
}
/* Type definitions */
struct object {
  int dummy;
};
struct cons {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cons *);
void cons_dispose(struct object *object) {
  struct cons *cons = (void *)object;
  free(cons);
}


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

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

LLVM IR (-O0):
%struct.object = type { i32 }
%struct.cons = type { i32 }
define void @cons_dispose(%struct.object* %0) {
%2 = alloca %struct.object*
%3 = alloca %struct.cons*
store %struct.object* %0, %struct.object** %2
%4 = load %struct.object*, %struct.object** %2
%5 = bitcast %struct.object* %4 to i8*
%6 = bitcast i8* %5 to %struct.cons*
store %struct.cons* %6, %struct.cons** %3
%7 = load %struct.cons*, %struct.cons** %3
%8 = call i32 @free(%struct.cons* %7)
ret void
}

LLVM IR (-O2):
%struct.object = type { i32 }
%struct.cons = type { i32 }
define void @cons_dispose(%struct.object* nocapture %0) {
%2 = bitcast %struct.object* %0 to %struct.cons*
%3 = tail call i32 @free(%struct.cons* %2)
ret void
}
/* Variables and functions */
char *strchr(char const *, int);
size_t string_count_char(const char *str, int c) {
  size_t count = 0;
  const char *tmp = str;
  while ((tmp = strchr(tmp, c)) != NULL) {
    tmp++;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<string_count_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1166 <string_count_char+0x56>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112f <string_count_char+0x1f>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_count_char>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1147 <string_count_char+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
add    $0x1,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <string_count_char+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @string_count_char(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i64 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = add i64 %7, 1
%10 = tail call i8* @strchr(i8* dereferenceable(1) %8, i32 %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i64 [ 0, %2 ], [ %9, %5 ]
ret i64 %13
}
void emtpyFunction() {}


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

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

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

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

/* Variables and functions */
void write_uc_flash(uint32_t address, uint8_t *data, uint32_t nb_byte,
                    uint8_t *temp) {}


x86 assembly (clang, -O0):
<write_uc_flash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @write_uc_flash(i32 %0, i32* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
ret void
}

LLVM IR (-O2):
define void @write_uc_flash(i32 %0, i32* nocapture %1, i32 %2, i32* nocapture %3) {
ret void
}
int HelpItem2(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem2() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *fgets(char *, int, int /*<<< orphan*/ *);
char *fgets_unlocked(char *s, int size, FILE *stream) {
  ;
  return fgets(s, size, stream);
}


x86 assembly (clang, -O0):
<fgets_unlocked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets_unlocked>:
jmp    1030 <fgets@plt>

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

LLVM IR (-O2):
define i8* @fgets_unlocked(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i8* @fgets(i8* %0, i32 %1, i32* %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ ParamWrite(int, int);
void init_app_extadc() {
  ParamWrite(0x0000, 0x0000);
  ParamWrite(0x0001, 0x0000);
  ParamWrite(0x0002, 0x000A);
  ParamWrite(0x0003, 0x000A);
}


x86 assembly (clang, -O0):
<init_app_extadc>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <ParamWrite@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <ParamWrite@plt>
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <ParamWrite@plt>
mov    $0x3,%edi
mov    $0xa,%esi
call   1030 <ParamWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_app_extadc>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <ParamWrite@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <ParamWrite@plt>
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <ParamWrite@plt>
mov    $0x3,%edi
mov    $0xa,%esi
pop    %rax
jmp    1030 <ParamWrite@plt>

LLVM IR (-O0):
define void @init_app_extadc() {
%1 = call i32 @ParamWrite(i32 0, i32 0)
%2 = call i32 @ParamWrite(i32 1, i32 0)
%3 = call i32 @ParamWrite(i32 2, i32 10)
%4 = call i32 @ParamWrite(i32 3, i32 10)
ret void
}

LLVM IR (-O2):
define void @init_app_extadc() {
%1 = tail call i32 @ParamWrite(i32 0, i32 0)
%2 = tail call i32 @ParamWrite(i32 1, i32 0)
%3 = tail call i32 @ParamWrite(i32 2, i32 10)
%4 = tail call i32 @ParamWrite(i32 3, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write(int, char *, int);
void picol_oom(void) {
  write(2, "Out of memory\n", 14);
  exit(1);
}


x86 assembly (clang, -O0):
<picol_oom>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
mov    $0xe,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<picol_oom>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x2,%edi
mov    $0xe,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Out of memory\0A\00"
define void @picol_oom() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memory\0A\00"
define void @picol_oom() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
%2 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_10uint16_reg(unsigned short val) {
  return ((val) & (0x10 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_10uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x10,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_10uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 16
%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_10uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 16
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
chown() {}


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

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

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

LLVM IR (-O2):
define i32 @chown() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ my_system(char *);
int main(int argc, char *argv[]) {
  my_system("ls -l | wc -w");
  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)
lea    0xed3(%rip),%rdi
call   1030 <my_system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"ls -l | wc -w\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @my_system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"ls -l | wc -w\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @my_system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float __nv_erfcinvf(float);
float erfcinvf(float __a) { return __nv_erfcinvf(__a); }


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

x86 assembly (clang, -O2):
<erfcinvf>:
jmp    1030 <__nv_erfcinvf@plt>

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

LLVM IR (-O2):
define float @erfcinvf(float %0) {
%2 = tail call float @__nv_erfcinvf(float %0)
ret float %2
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ foo(int, int);
int main(int argc, char *argv[]) {
  int x, y;
  if (argc >= 3) {
    y = atoi(argv[2]);
  }
  if (argc >= 2) {
    x = atoi(argv[1]);
  }
  foo(x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     1150 <main+0x30>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     116a <main+0x4a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x10(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x8(%rbx),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 3
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 2
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %7
br label %15
15: ; preds = %10, %2
%16 = load i32, i32* %4
%17 = icmp sge i32 %16, 2
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %6
br label %23
23: ; preds = %18, %15
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = call i32 @foo(i32 %24, i32 %25)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 2
tail call void @llvm.assume(i1 %3)
%4 = getelementptr inbounds i8*, i8** %1, i64 2
%5 = load i8*, i8** %4
%6 = tail call i32 @atoi(i8* %5)
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @foo(i32 %9, i32 %6)
ret i32 0
}
int xmlUCSIsPrivateUse(int code) {
  return (((code >= 0xE000) && (code <= 0xF8FF)) ||
          ((code >= 0xF0000) && (code <= 0xFFFFF)) ||
          ((code >= 0x100000) && (code <= 0x10FFFF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsPrivateUse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xe000,-0x4(%rbp)
jl     1126 <xmlUCSIsPrivateUse+0x26>
mov    $0x1,%al
cmpl   $0xf8ff,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    116a <xmlUCSIsPrivateUse+0x6a>
cmpl   $0xf0000,-0x4(%rbp)
jl     1145 <xmlUCSIsPrivateUse+0x45>
mov    $0x1,%al
cmpl   $0xfffff,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    116a <xmlUCSIsPrivateUse+0x6a>
xor    %eax,%eax
cmpl   $0x100000,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1164 <xmlUCSIsPrivateUse+0x64>
cmpl   $0x10ffff,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsPrivateUse>:
lea    -0xe000(%rdi),%eax
cmp    $0x1900,%eax
setb   %al
and    $0xffff0000,%edi
cmp    $0xf0000,%edi
sete   %cl
or     %al,%cl
cmp    $0x100000,%edi
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @xmlUCSIsPrivateUse(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 57344
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 63743
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 983040
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 1048575
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 1048576
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 1114111
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @xmlUCSIsPrivateUse(i32 %0) {
%2 = add i32 %0, -57344
%3 = icmp ult i32 %2, 6400
%4 = and i32 %0, -65536
%5 = icmp eq i32 %4, 983040
%6 = or i1 %3, %5
%7 = icmp eq i32 %4, 1048576
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_buff(void *buff) {
  if (buff)
    free(buff);
}


x86 assembly (clang, -O0):
<free_buff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_buff+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @free_buff(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
char upcase_c(char c) {
  if ((c >= 'a') && (c <= 'z')) {
    return c - 0x20;
  }
  return c;
}


x86 assembly (clang, -O0):
<upcase_c>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1133 <upcase_c+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1133 <upcase_c+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <upcase_c+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<upcase_c>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @upcase_c(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
f(int s, char *p) {
  int i;
  for (i = s; i >= 0 && &p[i] < &p[40]; i++) {
    p[i] = -2;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jl     113c <f+0x3c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
add    $0x28,%rcx
cmp    %rcx,%rax
setb   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114c <f+0x4c>
jmp    1166 <f+0x66>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0xfe,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1111 <f+0x11>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x27,%edi
ja     1137 <f+0x27>
push   %rax
mov    %edi,%eax
add    %rax,%rsi
mov    $0x27,%edx
sub    %edi,%edx
add    $0x1,%rdx
mov    %rsi,%rdi
mov    $0xfe,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = load i32, i32* %4
store i32 %7, i32* %6
br label %8
8: ; preds = %26, %2
%9 = load i32, i32* %6
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 40
%18 = icmp ult i8* %15, %17
br label %19
19: ; preds = %11, %8
%20 = phi i1 [ false, %8 ], [ %18, %11 ]
br i1 %20, label %21, label %29
21: ; preds = %19
%22 = load i8*, i8** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 -2, i8* %25
br label %26
26: ; preds = %21
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %8
29: ; preds = %19
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @f(i32 %0, i8* nocapture writeonly %1) {
%3 = icmp ult i32 %0, 40
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = zext i32 %0 to i64
%6 = getelementptr i8, i8* %1, i64 %5
%7 = sub nuw nsw i32 39, %0
%8 = zext i32 %7 to i64
%9 = add nuw nsw i64 %8, 1
br label %10
10: ; preds = %4, %2
ret i32 undef
}