xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void errorcallback(int code, const char *message) {
  printf("GLFW Error Occurred: %s", message);
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"GLFW Error Occurred: %s\00"
define void @errorcallback(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"GLFW Error Occurred: %s\00"
define void @errorcallback(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void ShowGpuPic(void) {}


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

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

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

LLVM IR (-O2):
define void @ShowGpuPic() {
ret void
}
int fahrenheitToCelsius(int fahrenheit) {
  return (int)((5.0 / 9.0) * (fahrenheit - 32));
}


x86 assembly (clang, -O0):
<fahrenheitToCelsius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm1
movsd  0xee7(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrenheitToCelsius>:
add    $0xffffffe0,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @fahrenheitToCelsius(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 32
%5 = sitofp i32 %4 to double
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptosi double %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @fahrenheitToCelsius(i32 %0) {
%2 = add nsw i32 %0, -32
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XCirculateRequestEvent;

/* Variables and functions */
void *get_XCirculateRequestEvent_display(void *_p) {
  return (void *)((XCirculateRequestEvent *)_p)->display;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XCirculateRequestEvent_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XCirculateRequestEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t Ch(uint32_t x, uint32_t y, uint32_t z) { return (z ^ (x & (y ^ z))); }


x86 assembly (clang, -O0):
<Ch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
xor    -0xc(%rbp),%edx
and    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ch>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Ch(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = xor i32 %9, %10
%12 = and i32 %8, %11
%13 = xor i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @Ch(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, %1
%5 = and i32 %4, %0
%6 = xor i32 %5, %2
ret i32 %6
}
/* Variables and functions */
scalar_t__ cJSON_malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *cJSON_strdup(const char *str) {
  size_t len;
  char *copy;
  len = strlen(str) + 1;
  if ((copy = (char *)cJSON_malloc(len)) == NULL)
    return 0;
  memcpy(copy, str, len);
  return copy;
}


x86 assembly (clang, -O0):
<cJSON_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <cJSON_malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1172 <cJSON_strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    118b <cJSON_strdup+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1040 <cJSON_malloc@plt>
test   %rax,%rax
je     1163 <cJSON_strdup+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
jmp    1165 <cJSON_strdup+0x35>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @cJSON_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = call i64 @cJSON_malloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %5
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %15
14: ; preds = %1
store i8* null, i8** %2
br label %21
15: ; preds = %1
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = load i64, i64* %4
%19 = call i32 @memcpy(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %5
store i8* %20, i8** %2
br label %21
21: ; preds = %15, %14
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @cJSON_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @cJSON_malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
br label %10
10: ; preds = %1, %8
%11 = phi i8* [ %6, %8 ], [ null, %1 ]
ret i8* %11
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t is_null(void *x) {
  if (x == NULL) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <is_null+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1126 <is_null+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_null>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_null(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
int andysh_help(char **args) {}


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

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

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

LLVM IR (-O2):
define i32 @andysh_help(i8** nocapture readnone %0) {
ret i32 undef
}
void g_value_set_uchar() {}


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

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

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

LLVM IR (-O2):
define void @g_value_set_uchar() {
ret void
}
/* Variables and functions */
int sscanf(char *, char *, char *);
size_t strlen(char *);
size_t log_request(unsigned char *data, size_t length, char *buf,
                   size_t buflen) {
  if (sscanf((char *)data, "%64s", buf) == 1)
    return strlen(buf);
  return 0;
}


x86 assembly (clang, -O0):
<log_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xeb9(%rip),%rsi
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    1167 <log_request+0x47>
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x8(%rbp)
jmp    116f <log_request+0x4f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_request>:
push   %rbx
mov    %rdx,%rbx
lea    0xed5(%rip),%rsi
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    113e <log_request+0x1e>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%64s\00"
define i64 @log_request(i8* nocapture %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i64 @strlen(i8* dereferenceable(1) %2)
br label %9
9: ; preds = %4, %7
%10 = phi i64 [ %8, %7 ], [ 0, %4 ]
ret i64 %10
}
int int_ops_nor(int l, int r) { return ~(l | r); }


x86 assembly (clang, -O0):
<int_ops_nor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_ops_nor>:
mov    %edi,%eax
or     %esi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @int_ops_nor(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 = or i32 %5, %6
%8 = xor i32 %7, -1
ret i32 %8
}

LLVM IR (-O2):
define i32 @int_ops_nor(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = xor i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int core1_safe(char const *);
int U_EMRPOLYLINE_safe(const char *record) { return (core1_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRPOLYLINE_safe>:
jmp    1030 <core1_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRPOLYLINE_safe(i8* %0) {
%2 = tail call i32 @core1_safe(i8* %0)
ret i32 %2
}
/* Variables and functions */
int strcmp(void *, void *);
int default_cmp(void *a, void *b) { return strcmp(a, b); }


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

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

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

LLVM IR (-O2):
define i32 @default_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void openvpn_thread_init(void) {}


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

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

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

LLVM IR (-O2):
define void @openvpn_thread_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char *);
char *removeDups(char *);
int main() {
  char str[] = "nningaaaclateeeer";
  printf("%s", removeDups(str));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%ax
mov    %ax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1050 <removeDups@plt>
mov    %rax,%rsi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xec5(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x72,0x10(%rsp)
mov    %rsp,%rdi
call   1050 <removeDups@plt>
lea    0xebd(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.str = [18 x i8] c"nningaaaclateeeer\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [18 x i8]
%2 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 0
%3 = call i8* @removeDups(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @getchar()
ret i32 0
}
int cs_rprune(int i, int j, double aij, void *other) {
  (void)j;
  (void)aij;
  int *rr = (int *)other;
  return (i >= rr[1] && i < rr[2]);
}


x86 assembly (clang, -O0):
<cs_rprune>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x20(%rbp),%rdx
xor    %eax,%eax
cmp    0x4(%rdx),%ecx
mov    %al,-0x21(%rbp)
jl     1140 <cs_rprune+0x40>
mov    -0x4(%rbp),%eax
mov    -0x20(%rbp),%rcx
cmp    0x8(%rcx),%eax
setl   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs_rprune>:
xor    %eax,%eax
cmp    %edi,0x4(%rdx)
jg     110f <cs_rprune+0xf>
xor    %eax,%eax
cmp    %edi,0x8(%rdx)
setg   %al
ret

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

LLVM IR (-O2):
define i32 @cs_rprune(i32 %0, i32 %1, double %2, i8* nocapture %3) {
%5 = getelementptr inbounds i8, i8* %3, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = icmp sgt i32 %7, %0
br i1 %8, label %15, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %3, i64 8
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = icmp sgt i32 %12, %0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %9, %4
%16 = phi i32 [ 0, %4 ], [ %14, %9 ]
ret i32 %16
}
int fun899() { return 899; }


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

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

LLVM IR (-O0):
define i32 @fun899() {
ret i32 899
}

LLVM IR (-O2):
define i32 @fun899() {
ret i32 899
}
void sort(void *structure, void *comparator, unsigned int elem_size,
          unsigned int elem_count, unsigned int max_size,
          unsigned int structure_size) {}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sort(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @sort(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret void
}
/* Variables and functions */
char MCP4461_GetValue(int, int);
char getHeadStepper1Current(void) { return MCP4461_GetValue(0x58, 0x03); }


x86 assembly (clang, -O0):
<getHeadStepper1Current>:
push   %rbp
mov    %rsp,%rbp
mov    $0x58,%edi
mov    $0x3,%esi
call   1030 <MCP4461_GetValue@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHeadStepper1Current>:
mov    $0x58,%edi
mov    $0x3,%esi
jmp    1030 <MCP4461_GetValue@plt>

LLVM IR (-O0):
define signext i8 @getHeadStepper1Current() {
%1 = call signext i8 @MCP4461_GetValue(i32 88, i32 3)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @getHeadStepper1Current() {
%1 = tail call signext i8 @MCP4461_GetValue(i32 88, i32 3)
ret i8 %1
}
void _times(void) {}


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

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

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

LLVM IR (-O2):
define void @_times() {
ret void
}
/* Variables and functions */
char getchar();
void clear_input(void) {
  char ch;
  while ((ch = getchar()) != '\n')
    continue;
}


x86 assembly (clang, -O0):
<clear_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1133 <clear_input+0x23>
jmp    1118 <clear_input+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_input>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clear_input+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @clear_input() {
%1 = alloca i8
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @clear_input() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mcu_atmel_atmega328p_Atmega328p_reset__E();
void test5_BlinkMilli_pollen__reset__E() {
  mcu_atmel_atmega328p_Atmega328p_reset__E();
}


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

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

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

LLVM IR (-O2):
define void @test5_BlinkMilli_pollen__reset__E() {
%1 = tail call i32 (...) @mcu_atmel_atmega328p_Atmega328p_reset__E()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ intrflush(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ nonl();
int /*<<< orphan*/ stdscr;
void init_ncurses() {
  initscr();
  cbreak();
  noecho();
  curs_set(0);
  nonl();
  intrflush(stdscr, FALSE);
  keypad(stdscr, TRUE);
}


x86 assembly (clang, -O0):
<init_ncurses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1080 <noecho@plt>
xor    %edi,%edi
call   1090 <curs_set@plt>
mov    $0x0,%al
call   1070 <nonl@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
mov    0x2e29(%rip),%rax
mov    (%rax),%esi
call   1060 <intrflush@plt>
mov    0x2e33(%rip),%rax
mov    (%rax),%edi
mov    0x2e22(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_ncurses>:
push   %rbx
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1080 <noecho@plt>
xor    %edi,%edi
call   1090 <curs_set@plt>
xor    %eax,%eax
call   1070 <nonl@plt>
mov    0x2e4d(%rip),%rbx
mov    (%rbx),%edi
mov    0x2e2c(%rip),%rax
mov    (%rax),%esi
call   1060 <intrflush@plt>
mov    (%rbx),%edi
mov    0x2e2c(%rip),%rax
mov    (%rax),%esi
pop    %rbx
jmp    1040 <keypad@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@FALSE = global i32 0
@TRUE = global i32 0
define void @init_ncurses() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @cbreak()
%3 = call i32 (...) @noecho()
%4 = call i32 @curs_set(i32 0)
%5 = call i32 (...) @nonl()
%6 = load i32, i32* @stdscr
%7 = load i32, i32* @FALSE
%8 = call i32 @intrflush(i32 %6, i32 %7)
%9 = load i32, i32* @stdscr
%10 = load i32, i32* @TRUE
%11 = call i32 @keypad(i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@FALSE = global i32 0
@TRUE = global i32 0
define void @init_ncurses() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @noecho()
%4 = tail call i32 @curs_set(i32 0)
%5 = tail call i32 (...) @nonl()
%6 = load i32, i32* @stdscr
%7 = load i32, i32* @FALSE
%8 = tail call i32 @intrflush(i32 %6, i32 %7)
%9 = load i32, i32* @stdscr
%10 = load i32, i32* @TRUE
%11 = tail call i32 @keypad(i32 %9, i32 %10)
ret void
}
/* Variables and functions */
double log(double);
double emissivity_generic(double ndvi) {
  double result;
  if (ndvi < 0.16)
    result = 1.0;
  else if (ndvi > 0.74)
    result = 0.9;
  else
    result = 1.009 + 0.047 * log(ndvi);
  return result;
}


x86 assembly (clang, -O0):
<emissivity_generic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1142 <emissivity_generic+0x32>
movsd  0xef0(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1197 <emissivity_generic+0x87>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    116b <emissivity_generic+0x5b>
movsd  0xebf(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1192 <emissivity_generic+0x82>
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  0xe93(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1197 <emissivity_generic+0x87>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emissivity_generic>:
push   %rax
movsd  0xeef(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1129 <emissivity_generic+0x19>
movsd  0xed9(%rip),%xmm0
pop    %rax
ret
ucomisd 0xee7(%rip),%xmm0
jbe    113d <emissivity_generic+0x2d>
movsd  0xed5(%rip),%xmm0
pop    %rax
ret
call   1030 <log@plt>
mulsd  0xed6(%rip),%xmm0
addsd  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @emissivity_generic(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp olt double %4, 1.600000e-01
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %3
br label %16
7: ; preds = %1
%8 = load double, double* %2
%9 = fcmp ogt double %8, 0x3FE7AE147AE147AE
br i1 %9, label %10, label %11
10: ; preds = %7
store double 9.000000e-01, double* %3
br label %15
11: ; preds = %7
%12 = load double, double* %2
%13 = call double @log(double %12)
%14 = call double @llvm.fmuladd.f64(double 4.700000e-02, double %13, double 1.009000e+00)
store double %14, double* %3
br label %15
15: ; preds = %11, %10
br label %16
16: ; preds = %15, %6
%17 = load double, double* %3
ret double %17
}

LLVM IR (-O2):
define double @emissivity_generic(double %0) {
%2 = fcmp olt double %0, 1.600000e-01
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = fcmp ogt double %0, 0x3FE7AE147AE147AE
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call double @log(double %0)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 4.700000e-02, double 1.009000e+00)
br label %8
8: ; preds = %3, %1, %5
%9 = phi double [ %7, %5 ], [ 1.000000e+00, %1 ], [ 9.000000e-01, %3 ]
ret double %9
}
/* Variables and functions */
void *realloc(void *, size_t);
void *libc_realloc(void *ptr, size_t size) { return realloc(ptr, size); }


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

x86 assembly (clang, -O2):
<libc_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @libc_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
void profile_free_list(char **list) {
  char **cp;
  if (list == 0)
    return;
  for (cp = list; *cp; cp++)
    free(*cp);
  free(list);
}


x86 assembly (clang, -O0):
<profile_free_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <profile_free_list+0x1c>
jmp    1168 <profile_free_list+0x58>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115f <profile_free_list+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <profile_free_list+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<profile_free_list>:
test   %rdi,%rdi
je     1150 <profile_free_list+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <profile_free_list+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <profile_free_list+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @profile_free_list(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
tail call void @free(i8* %7)
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %6
12: ; preds = %6, %3
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
br label %14
14: ; preds = %1, %12
ret void
}
int do_351() { return 351; }


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

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

LLVM IR (-O0):
define i32 @do_351() {
ret i32 351
}

LLVM IR (-O2):
define i32 @do_351() {
ret i32 351
}
/* Variables and functions */
int /*<<< orphan*/ isPrimo();
main() {
  isPrimo();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @isPrimo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SetBGColor79(unsigned long);
void setbgcolor(unsigned long c) { SetBGColor79(c); }


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

x86 assembly (clang, -O2):
<setbgcolor>:
jmp    1030 <SetBGColor79@plt>

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

LLVM IR (-O2):
define void @setbgcolor(i64 %0) {
%2 = tail call i32 @SetBGColor79(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DriveReg0_RestoreConfig();
void DriveReg0_Wakeup(void) { DriveReg0_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @DriveReg0_Wakeup() {
%1 = tail call i32 (...) @DriveReg0_RestoreConfig()
ret void
}
int test09(int a) { return a < 0 ? 0x7FFFFFFF : 0x80000000; }


x86 assembly (clang, -O0):
<test09>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x80000000,%eax
mov    $0x7fffffff,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test09>:
sar    $0x1f,%edi
lea    -0x80000000(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @test09(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 2147483647, i32 -2147483648
ret i32 %3
}
unsigned long rho_ruby_create_array() { return 0; }


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

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

LLVM IR (-O0):
define i64 @rho_ruby_create_array() {
ret i64 0
}

LLVM IR (-O2):
define i64 @rho_ruby_create_array() {
ret i64 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ si_addr;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, long);
void handler(int sig, siginfo_t *si, void *unused) {
  printf("Got SIGSEGV at address: 0x%lx\n", (long)si->si_addr);
  exit(255);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
@.str = [31 x i8] c"Got SIGSEGV at address: 0x%lx\0A\00"
define void @handler(i32 %0, %struct.TYPE_3__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_3__*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %5
store i8* %2, i8** %6
%7 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i32 @exit(i32 255)
unreachable
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
@.str = [31 x i8] c"Got SIGSEGV at address: 0x%lx\0A\00"
define void @handler(i32 %0, %struct.TYPE_3__* nocapture %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = tail call i32 @exit(i32 255)
unreachable
}
void SteamAPI_ISteamGameServer_SetRegion(void *self, const char *pszRegion) {
  xlogf("%s(self = %p, pszRegion = %s)\n", __func__, self, pszRegion);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamGameServer_SetRegion>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xefb(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"%s(self = %p, pszRegion = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetRegion = [36 x i8] c"SteamAPI_ISteamGameServer_SetRegion\00"
define void @SteamAPI_ISteamGameServer_SetRegion(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @__func__.SteamAPI_ISteamGameServer_SetRegion, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s(self = %p, pszRegion = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetRegion = [36 x i8] c"SteamAPI_ISteamGameServer_SetRegion\00"
define void @SteamAPI_ISteamGameServer_SetRegion(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @__func__.SteamAPI_ISteamGameServer_SetRegion, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ echo_test();
void main() {
  echo_test();
  return;
}


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @echo_test()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ signal(int, void (*)(int));
void signal_register(int sig, void (*sighandler)(int)) {
  signal(sig, sighandler);
}


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

x86 assembly (clang, -O2):
<signal_register>:
jmp    1030 <signal@plt>

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

LLVM IR (-O2):
define void @signal_register(i32 %0, void (i32)* %1) {
%3 = tail call i32 @signal(i32 %0, void (i32)* %1)
ret void
}
int DRV_BOOTFLAG_CFG(unsigned int ulBootFlag) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_BOOTFLAG_CFG(i32 %0) {
ret i32 0
}
/* Variables and functions */
int e_debug_map(unsigned int, void **, unsigned int *);
int /*<<< orphan*/ e_debug_unmap(char *);
int e_debug_read(unsigned addr, unsigned *data) {
  int ret;
  unsigned offset;
  char *ptr;
  ret = e_debug_map(addr, (void **)&ptr, &offset);
  *data = *((unsigned *)(ptr + offset));
  e_debug_unmap(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<e_debug_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <e_debug_map@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,1),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rdi
call   1030 <e_debug_unmap@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_debug_read>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1040 <e_debug_map@plt>
mov    0x8(%rsp),%rdi
mov    0x4(%rsp),%eax
mov    (%rdi,%rax,1),%eax
mov    %eax,(%rbx)
call   1030 <e_debug_unmap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @e_debug_read(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %3
store i32* %1, i32** %4
%8 = load i32, i32* %3
%9 = call i32 @e_debug_map(i32 %8, i8** %7, i32* %6)
store i32 %9, i32* %5
%10 = load i8*, i8** %7
%11 = load i32, i32* %6
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i8*, i8** %7
%18 = call i32 @e_debug_unmap(i8* %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @e_debug_read(i32 %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = bitcast i32* %3 to i8*
%6 = bitcast i8** %4 to i8*
%7 = call i32 @e_debug_map(i32 %0, i8** %4, i32* %3)
%8 = load i8*, i8** %4
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %1
%14 = call i32 @e_debug_unmap(i8* %8)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void h265hvcc_array_set_num_nalus(uint8_t *p, uint16_t val) {
  p[1] = val >> 8;
  p[2] = val & 0xff;
}


x86 assembly (clang, -O0):
<h265hvcc_array_set_num_nalus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_array_set_num_nalus>:
movzbl %sil,%eax
sar    $0x8,%esi
mov    %esi,0x4(%rdi)
mov    %eax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_array_set_num_nalus(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = and i32 %9, 255
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 2
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @h265hvcc_array_set_num_nalus(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %5, i32* %6
ret void
}
char primer_caracter(char *cadena) { return cadena[0]; }


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

x86 assembly (clang, -O2):
<primer_caracter>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define signext i8 @primer_caracter(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
int fork(void) {
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @fork() {
%1 = load i32, i32* @ENOTSUP
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @fork() {
%1 = load i32, i32* @ENOTSUP
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
int android_fork_execvp_ext(int, char **, int *, int, int, int);
int android_fork_execvp(int argc, char *argv[], int *status,
                        bool ignore_int_quit, bool logwrap) {
  return android_fork_execvp_ext(argc, argv, status, ignore_int_quit,
                                 (logwrap ? 1 : 0), false);
}


x86 assembly (clang, -O0):
<android_fork_execvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r9d
xor    %r8d,%r8d
mov    $0x1,%eax
cmp    $0x0,%r9d
cmovne %eax,%r8d
xor    %r9d,%r9d
call   1030 <android_fork_execvp_ext@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<android_fork_execvp>:
xor    %eax,%eax
test   %r8d,%r8d
setne  %al
mov    %eax,%r8d
xor    %r9d,%r9d
jmp    1030 <android_fork_execvp_ext@plt>

LLVM IR (-O0):
define i32 @android_fork_execvp(i32 %0, i8** %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i32*, i32** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
%19 = call i32 @android_fork_execvp_ext(i32 %11, i8** %12, i32* %13, i32 %14, i32 %18, i32 0)
ret i32 %19
}

LLVM IR (-O2):
define i32 @android_fork_execvp(i32 %0, i8** %1, i32* %2, i32 %3, i32 %4) {
%6 = icmp ne i32 %4, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @android_fork_execvp_ext(i32 %0, i8** %1, i32* %2, i32 %3, i32 %7, i32 0)
ret i32 %8
}
int LEFT(int i) { return 2 * i; }


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

x86 assembly (clang, -O2):
<LEFT>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @LEFT(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int accept_connect(int);
int /*<<< orphan*/ http_handler(int);
void connect_handler(int socket_fd) {
  int net_fd = accept_connect(socket_fd);
  http_handler(net_fd);
  return;
}


x86 assembly (clang, -O0):
<connect_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <accept_connect@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <http_handler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connect_handler>:
push   %rax
call   1030 <accept_connect@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <http_handler@plt>

LLVM IR (-O0):
define void @connect_handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @accept_connect(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @http_handler(i32 %6)
ret void
}

LLVM IR (-O2):
define void @connect_handler(i32 %0) {
%2 = tail call i32 @accept_connect(i32 %0)
%3 = tail call i32 @http_handler(i32 %2)
ret void
}
/* Variables and functions */
int core10_swap(char *, int);
int U_EMRPOLYPOLYLINE16_swap(char *record, int torev) {
  return (core10_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYPOLYLINE16_swap>:
jmp    1030 <core10_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRPOLYPOLYLINE16_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core10_swap(i8* %0, i32 %1)
ret i32 %3
}
void Function_Event_Polling_Use_Timer(void *data) {
  extern void Polling_Mirror_SND(unsigned long data);
  Polling_Mirror_SND(data);
}


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

x86 assembly (clang, -O2):
<Function_Event_Polling_Use_Timer>:
jmp    1030 <Polling_Mirror_SND@plt>

LLVM IR (-O0):
define void @Function_Event_Polling_Use_Timer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
ret void
}

LLVM IR (-O2):
define void @Function_Event_Polling_Use_Timer(i8* %0) {
%2 = ptrtoint i8* %0 to i64
tail call void @Polling_Mirror_SND(i64 %2)
ret void
}