xunge/DecIR huggingface dataset:
int fooGnu(int n) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @fooGnu(i32 %0) {
ret i32 1
}
void update_terminal_settings(void) {}


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

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

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

LLVM IR (-O2):
define void @update_terminal_settings() {
ret void
}
void ff_hevc_put_hevc_bi_pel_pixels16_10_avx2() {}


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

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

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

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

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ shutdown(int, char *, int);
int get(FILE *stream) {
  int value;
  rewind(stream);
  if (fscanf(stream, "%d", &value) != 1)
    shutdown(4, "Error reading /proc entry", 119 - 1);
  return value;
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rewind@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb0(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     1178 <get+0x48>
mov    $0x4,%edi
lea    0xe95(%rip),%rsi
mov    $0x76,%edx
call   1030 <shutdown@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <rewind@plt>
lea    0xebc(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     116c <get+0x3c>
lea    0xea6(%rip),%rsi
mov    $0x4,%edi
mov    $0x76,%edx
call   1030 <shutdown@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [26 x i8] c"Error reading /proc entry\00"
define i32 @get(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @rewind(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @fscanf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @shutdown(i32 4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 118)
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [26 x i8] c"Error reading /proc entry\00"
define i32 @get(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @rewind(i32* %0)
%5 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = icmp eq i32 %5, 1
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @shutdown(i32 4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 118)
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
ret i32 %10
}
double fmax(double a, double b) { return b > a ? b : a; }


x86 assembly (clang, -O0):
<fmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112d <fmax+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <fmax+0x37>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %4
br label %12
10: ; preds = %2
%11 = load double, double* %3
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @fmax(double %0, double %1) {
%3 = fcmp ogt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}
void g_strfreev() {}


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

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

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

LLVM IR (-O2):
define void @g_strfreev() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ n0();
void call_f0() { n0(); }


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

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

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

LLVM IR (-O2):
define void @call_f0() {
%1 = tail call i32 (...) @n0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *get_actual_malloc_address(void *);
void vpx_free(void *memblk) {
  if (memblk) {
    void *addr = get_actual_malloc_address(memblk);
    free(addr);
  }
}


x86 assembly (clang, -O0):
<vpx_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114d <vpx_free+0x2d>
mov    -0x8(%rbp),%rdi
call   1040 <get_actual_malloc_address@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vpx_free>:
test   %rdi,%rdi
je     1134 <vpx_free+0x14>
push   %rax
call   1040 <get_actual_malloc_address@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @vpx_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* @get_actual_malloc_address(i8* %0)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
int output(int n, double a) { printf("case %d:y=%g.\n", n, a); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"case %d:y=%g.\0A\00"
define i32 @output(i32 %0, double %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, double %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void iface1_ver1_destructor(void *context) {
  printf("B - version 1 destructor context %p\n", context);
}


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

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

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

LLVM IR (-O2):
@.str = [37 x i8] c"B - version 1 destructor context %p\0A\00"
define void @iface1_ver1_destructor(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct nodo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int i;
  struct nodo *ptr = NULL;
  srand(time(NULL));
  return 0;
}


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

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

LLVM IR (-O0):
%struct.nodo = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.nodo*
store i32 0, i32* %1
store %struct.nodo* null, %struct.nodo** %3
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
ret i32 0
}

LLVM IR (-O2):
%struct.nodo = type { i32 }
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *msg) {
  fprintf(stderr, "ERROR MESSAGE : %s\n", msg);
  return;
}


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

x86 assembly (clang, -O2):
<error>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"ERROR MESSAGE : %s\0A\00"
define void @error(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 ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"ERROR MESSAGE : %s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "setgw - set the default route\n"
                  "get   - display the contents of routing tables\n"
                  "help  - display this message\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [107 x i8] c"setgw - set the default route\0Aget - display the contents of routing tables\0Ahelp - display this message\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [107 x i8] c"setgw - set the default route\0Aget - display the contents of routing tables\0Ahelp - display this message\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int putchar(int);
int libbf_putchar_with_data(int data, void *user_data) {
  int ret;
  ret = putchar(data);
  return ret;
}


x86 assembly (clang, -O0):
<libbf_putchar_with_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libbf_putchar_with_data>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define i32 @libbf_putchar_with_data(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @putchar(i32 %0)
ret i32 %3
}
int my_func(void) { return 27; }


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

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

LLVM IR (-O0):
define i32 @my_func() {
ret i32 27
}

LLVM IR (-O2):
define i32 @my_func() {
ret i32 27
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;

/* Variables and functions */
scalar_t__ getsockname(int const, struct sockaddr *, int *);
char *inet_ntoa(int /*<<< orphan*/);
char *getsvrip(const int client_sock) {
  struct sockaddr_in addr;
  socklen_t len = sizeof(struct sockaddr_in);
  if (getsockname(client_sock, (struct sockaddr *)&addr, &len) == 0)
    return inet_ntoa(addr.sin_addr);
  else
    return NULL;
}


x86 assembly (clang, -O0):
<getsvrip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <getsockname@plt>
cmp    $0x0,%rax
jne    115d <getsvrip+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x8(%rbp)
jmp    1165 <getsvrip+0x45>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsvrip>:
push   %rax
movl   $0x4,0x4(%rsp)
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1040 <getsockname@plt>
test   %rax,%rax
je     113f <getsvrip+0x1f>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <inet_ntoa@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i8* @getsvrip(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %5
%6 = load i32, i32* %3
%7 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%8 = call i64 @getsockname(i32 %6, %struct.sockaddr* %7, i32* %5)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i8* @inet_ntoa(i32 %12)
store i8* %13, i8** %2
br label %15
14: ; preds = %1
store i8* null, i8** %2
br label %15
15: ; preds = %14, %10
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i8* @getsvrip(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%7 = call i64 @getsockname(i32 %0, %struct.sockaddr* %6, i32* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
%11 = load i32, i32* %10
%12 = call i8* @inet_ntoa(i32 %11)
br label %13
13: ; preds = %1, %9
%14 = phi i8* [ %12, %9 ], [ null, %1 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun_fini() {
  printf("fun_fini"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"fun_fini\0A\00"
define void @fun_fini() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"fun_fini\00"
define void @fun_fini() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __free_cf(void *);
void CGShadingRelease(void *item) { __free_cf(item); }


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

x86 assembly (clang, -O2):
<CGShadingRelease>:
jmp    1030 <__free_cf@plt>

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

LLVM IR (-O2):
define void @CGShadingRelease(i8* %0) {
%2 = tail call i32 @__free_cf(i8* %0)
ret void
}
void WriteShort2(unsigned char *p, unsigned short v) {
  p[0] = (unsigned char)(v & 0xFF);
  v >>= 8;
  p[1] = (unsigned char)v;
}


x86 assembly (clang, -O0):
<WriteShort2>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%ax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteShort2>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @WriteShort2(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = trunc i32 %13 to i16
store i16 %14, i16* %4
%15 = load i16, i16* %4
%16 = trunc i16 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
ret void
}

LLVM IR (-O2):
define void @WriteShort2(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
store i8 %3, i8* %0
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
int *return_self(int *p) { return p; }


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

x86 assembly (clang, -O2):
<return_self>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32* @return_self(i32* readnone returned %0) {
ret i32* %0
}
void qp_cpu_pause() { __asm__("pause"); }


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

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

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

LLVM IR (-O2):
define void @qp_cpu_pause() {
tail call void asm sideeffect "pause", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int find_triplet_product(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int product = find_triplet_product(1000);
  printf("Product: %d\n", product);
  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)
mov    $0x3e8,%edi
call   1040 <find_triplet_product@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Product: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @find_triplet_product(i32 1000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int one() {
  fprintf(stderr, "%d\n", 1);
  return 1;
}


x86 assembly (clang, -O0):
<one>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x1,%edx
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<one>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0x1,%edx
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @one() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @one() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 1
}
/* Variables and functions */
int render_char_ex(unsigned char *, int, int, int, int);
int render_char(unsigned char *font, int x, int y, int c) {
  return render_char_ex(font, x, y, c, 256);
}


x86 assembly (clang, -O0):
<render_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    $0x100,%r8d
call   1030 <render_char_ex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_char>:
mov    $0x100,%r8d
jmp    1030 <render_char_ex@plt>

LLVM IR (-O0):
define i32 @render_char(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @render_char_ex(i8* %9, i32 %10, i32 %11, i32 %12, i32 256)
ret i32 %13
}

LLVM IR (-O2):
define i32 @render_char(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @render_char_ex(i8* %0, i32 %1, i32 %2, i32 %3, i32 256)
ret i32 %5
}
int GetDtreeVersion() {
  int nVer = ((int)0x0004) | ((int)0x0001 << 16);
  return nVer;
}


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

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

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

LLVM IR (-O2):
define i32 @GetDtreeVersion() {
ret i32 65540
}
/* Variables and functions */
scalar_t__ sim_manager_view_init();
int /*<<< orphan*/ sim_manager_view_is_init();
int /*<<< orphan*/ sim_manager_view_show();
void phoneui_backend_sim_manager_show() {
  if (!sim_manager_view_is_init()) {
    if (sim_manager_view_init()) {
      return;
    }
  }
  sim_manager_view_show();
}


x86 assembly (clang, -O0):
<phoneui_backend_sim_manager_show>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sim_manager_view_is_init@plt>
cmp    $0x0,%eax
jne    115f <phoneui_backend_sim_manager_show+0x2f>
mov    $0x0,%al
call   1050 <sim_manager_view_init@plt>
cmp    $0x0,%rax
je     115a <phoneui_backend_sim_manager_show+0x2a>
jmp    1166 <phoneui_backend_sim_manager_show+0x36>
jmp    115f <phoneui_backend_sim_manager_show+0x2f>
mov    $0x0,%al
call   1040 <sim_manager_view_show@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<phoneui_backend_sim_manager_show>:
push   %rax
xor    %eax,%eax
call   1030 <sim_manager_view_is_init@plt>
test   %eax,%eax
je     1144 <phoneui_backend_sim_manager_show+0x14>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sim_manager_view_show@plt>
xor    %eax,%eax
call   1050 <sim_manager_view_init@plt>
test   %rax,%rax
je     113c <phoneui_backend_sim_manager_show+0xc>
pop    %rax
ret

LLVM IR (-O0):
define void @phoneui_backend_sim_manager_show() {
%1 = call i32 (...) @sim_manager_view_is_init()
%2 = icmp ne i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = call i64 (...) @sim_manager_view_init()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %10
7: ; preds = %3
br label %8
8: ; preds = %7, %0
%9 = call i32 (...) @sim_manager_view_show()
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
define void @phoneui_backend_sim_manager_show() {
%1 = tail call i32 (...) @sim_manager_view_is_init()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i64 (...) @sim_manager_view_init()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3, %0
%7 = tail call i32 (...) @sim_manager_view_show()
br label %8
8: ; preds = %3, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dtop2(double, double, double *, double *);
int dtoc3(double dx, double dy, double dz, double *cr, double *ct, double *cz) {
  dtop2(dx, dy, cr, ct);
  *cz = dz;
  return 0;
}


x86 assembly (clang, -O0):
<dtoc3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <dtop2@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtoc3>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movsd  %xmm2,0x8(%rsp)
call   1030 <dtop2@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @dtoc3(double %0, double %1, double %2, double* %3, double* %4, double* nocapture writeonly %5) {
%7 = tail call i32 @dtop2(double %0, double %1, double* %3, double* %4)
store double %2, double* %5
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ XAnyEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XAnyEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XAnyEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XAnyEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XAnyEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XAnyEvent>:
test   %rdi,%rdi
je     112a <free_XAnyEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

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

LLVM IR (-O2):
define void @free_XAnyEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
void wcnss_register_thermal_mitigation(void *dev, void *tmnotify) {}


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

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

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

LLVM IR (-O2):
define void @wcnss_register_thermal_mitigation(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("No FIPS RSA support\n");
  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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [20 x i8] c"No FIPS RSA support\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ is_user_module_valid();
int /*<<< orphan*/ module_user_init();
void system_part1_post_init() {
  if (is_user_module_valid()) {
    module_user_init();
  }
}


x86 assembly (clang, -O0):
<system_part1_post_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <is_user_module_valid@plt>
cmp    $0x0,%rax
je     113c <system_part1_post_init+0x1c>
mov    $0x0,%al
call   1040 <module_user_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_part1_post_init>:
push   %rax
xor    %eax,%eax
call   1030 <is_user_module_valid@plt>
test   %rax,%rax
je     1135 <system_part1_post_init+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <module_user_init@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @system_part1_post_init() {
%1 = call i64 (...) @is_user_module_valid()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @module_user_init()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @system_part1_post_init() {
%1 = tail call i64 (...) @is_user_module_valid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @module_user_init()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rcerror(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void cant(char *s) {
  char buf[100];
  strcpy(buf, "can't happen: ");
  strcat(buf, s);
  rcerror(buf);
}


x86 assembly (clang, -O0):
<cant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x70(%rbp),%rdi
call   1040 <rcerror@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cant>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
mov    %r14,%rdi
call   1040 <rcerror@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"can't happen: \00"
define void @cant(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @strcat(i8* %6, i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call i32 @rcerror(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"can't happen: \00"
define void @cant(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @strcat(i8* %3, i8* %0)
%6 = call i32 @rcerror(i8* %3)
ret void
}
int test_imm_44int16_reg(short val) {
  return ((val) & (-0x44 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_44int16_reg>:
test   $0xffbc,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_44int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -68
%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_44int16_reg(i16 signext %0) {
%2 = and i16 %0, -68
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ tree_semantic_check_end_scope();
int /*<<< orphan*/ tree_translate_end();
void tree_semantic_check_end() {
  tree_translate_end();
  tree_semantic_check_end_scope();
}


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

x86 assembly (clang, -O2):
<tree_semantic_check_end>:
push   %rax
xor    %eax,%eax
call   1040 <tree_translate_end@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <tree_semantic_check_end_scope@plt>

LLVM IR (-O0):
define void @tree_semantic_check_end() {
%1 = call i32 (...) @tree_translate_end()
%2 = call i32 (...) @tree_semantic_check_end_scope()
ret void
}

LLVM IR (-O2):
define void @tree_semantic_check_end() {
%1 = tail call i32 (...) @tree_translate_end()
%2 = tail call i32 (...) @tree_semantic_check_end_scope()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (3 < 4) {
    printf("This works.\n");
  }
  printf("%d\n", 3 < 4);
}


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

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

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [12 x i8] c"This works.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushcomplex32array_(char *x, unsigned int *n) { pushNarray(x, (*n * 32)); }


x86 assembly (clang, -O0):
<pushcomplex32array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x5,%esi
call   1030 <pushNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushcomplex32array_>:
mov    (%rsi),%esi
shl    $0x5,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushcomplex32array_(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 = load i32, i32* %6
%8 = mul i32 %7, 32
%9 = call i32 @pushNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushcomplex32array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 5
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}
int leitura(int *v) {
  for (int i = 0; i <= 29; i++) {
    v[i] = i + 1;
  }
}


x86 assembly (clang, -O0):
<leitura>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1d,-0x14(%rbp)
jg     1138 <leitura+0x38>
mov    -0x14(%rbp),%edx
add    $0x1,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <leitura+0xf>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leitura>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movaps 0xf04(%rip),%xmm0
movups %xmm0,0x20(%rdi)
movaps 0xf09(%rip),%xmm0
movups %xmm0,0x30(%rdi)
movaps 0xf0e(%rip),%xmm0
movups %xmm0,0x40(%rdi)
movaps 0xf13(%rip),%xmm0
movups %xmm0,0x50(%rdi)
movaps 0xf18(%rip),%xmm0
movups %xmm0,0x60(%rdi)
movabs $0x1e0000001d,%rax
mov    %rax,0x70(%rdi)
ret

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

LLVM IR (-O2):
define i32 @leitura(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 5, i32 6, i32 7, i32 8>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 9, i32 10, i32 11, i32 12>, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %0, i64 12
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 13, i32 14, i32 15, i32 16>, <4 x i32>* %8
%9 = getelementptr inbounds i32, i32* %0, i64 16
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 17, i32 18, i32 19, i32 20>, <4 x i32>* %10
%11 = getelementptr inbounds i32, i32* %0, i64 20
%12 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> <i32 21, i32 22, i32 23, i32 24>, <4 x i32>* %12
%13 = getelementptr inbounds i32, i32* %0, i64 24
%14 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> <i32 25, i32 26, i32 27, i32 28>, <4 x i32>* %14
%15 = getelementptr inbounds i32, i32* %0, i64 28
store i32 29, i32* %15
%16 = getelementptr inbounds i32, i32* %0, i64 29
store i32 30, i32* %16
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
void output(const char *s) {
  if (*s) {
    printf("%c", *s);
    output(s + 1);
  }
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <output+0x39>
mov    -0x8(%rbp),%rax
lea    0xebc(%rip),%rdi
movsbl (%rax),%esi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <output+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <output+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @output(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
void func(int i) {
  int x = 0;
  if (i == 0) {
    x = 1;
  } else {
    x = 2;
  }
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1124 <func+0x24>
movl   $0x1,-0x8(%rbp)
jmp    112b <func+0x2b>
movl   $0x2,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @func(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int main(void) {
  raise(SIGSEGV);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGSEGV = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SIGSEGV
%3 = call i32 @raise(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@SIGSEGV = global i32 0
define i32 @main() {
%1 = load i32, i32* @SIGSEGV
%2 = tail call i32 @raise(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ initShell();
int main() {
  initShell();
  return 0xDEADBEEF;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initShell()
ret i32 -559038737
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t minipack_unpack_fixmap(void *ptr, size_t *sz) {
  *sz = 1;
  return *((uint8_t *)ptr) & 0x0F;
}


x86 assembly (clang, -O0):
<minipack_unpack_fixmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x1,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_fixmap>:
movq   $0x1,(%rsi)
mov    (%rdi),%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @minipack_unpack_fixmap(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
store i64 1, i64* %5
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = and i32 %8, 15
ret i32 %9
}

LLVM IR (-O2):
define i32 @minipack_unpack_fixmap(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 1, i64* %1
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = and i32 %4, 15
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ login();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ welcome();
int main() {
  printf("Toddler's Secure Login System 1.0 beta.\n");
  welcome();
  login();
  printf("Now I can safely trust you that you have credential :)\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <welcome@plt>
mov    $0x0,%al
call   1040 <login@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <welcome@plt>
xor    %eax,%eax
call   1040 <login@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Toddler's Secure Login System 1.0 beta.\0A\00"
@.str.1 = [56 x i8] c"Now I can safely trust you that you have credential :)\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @welcome()
%4 = call i32 (...) @login()
%5 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [40 x i8] c"Toddler's Secure Login System 1.0 beta.\00"
@str.2 = [55 x i8] c"Now I can safely trust you that you have credential :)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @welcome()
%3 = tail call i32 (...) @login()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}