xunge/DecIR huggingface dataset:
void *region_end(struct ptr_region *region) {
  return (char *)region + region_size(region);
}


x86 assembly (clang, -O0):
<region_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <region_size@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<region_end>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <region_size@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ptr_region = type opaque
define i8* @region_end(%struct.ptr_region* %0) {
%2 = alloca %struct.ptr_region*
store %struct.ptr_region* %0, %struct.ptr_region** %2
%3 = load %struct.ptr_region*, %struct.ptr_region** %2
%4 = bitcast %struct.ptr_region* %3 to i8*
%5 = load %struct.ptr_region*, %struct.ptr_region** %2
%6 = call i32 (%struct.ptr_region*, ...) bitcast (i32 (...)* @region_size to i32 (%struct.ptr_region*, ...)*)(%struct.ptr_region* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
ret i8* %8
}

LLVM IR (-O2):
%struct.ptr_region = type opaque
define i8* @region_end(%struct.ptr_region* %0) {
%2 = bitcast %struct.ptr_region* %0 to i8*
%3 = tail call i32 (%struct.ptr_region*, ...) bitcast (i32 (...)* @region_size to i32 (%struct.ptr_region*, ...)*)(%struct.ptr_region* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %2, i64 %4
ret i8* %5
}
/* Variables and functions */
int ask(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int fetch_image(char *local) {
  char ans[1280];
  int i = ask("image", ans);
  if (i != 0)
    return -1;
  strncpy(local, ans, 1280);
  return 0;
}


x86 assembly (clang, -O0):
<fetch_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x520,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x510(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1040 <ask@plt>
mov    %eax,-0x514(%rbp)
cmpl   $0x0,-0x514(%rbp)
je     1161 <fetch_image+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <fetch_image+0x5d>
mov    -0x10(%rbp),%rdi
lea    -0x510(%rbp),%rsi
mov    $0x500,%edx
call   1030 <strncpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x520,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch_image>:
push   %rbx
sub    $0x500,%rsp
mov    %rdi,%rbx
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
call   1040 <ask@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
jne    1157 <fetch_image+0x37>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x500,%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
add    $0x500,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"image\00"
define i32 @fetch_image(i8* %0) {
%2 = alloca [1280 x i8]
%3 = getelementptr inbounds [1280 x i8], [1280 x i8]* %2, i64 0, i64 0
%4 = call i32 @ask(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @strncpy(i8* %0, i8* %3, i32 1280)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ 0, %6 ], [ -1, %1 ]
ret i32 %9
}
int round_div(int x, int y) {
  int quotient = x / y;
  int dblremain = (x % y) << 1;
  if ((dblremain > y) || ((dblremain == y) && (quotient & 1)))
    quotient++;
  return quotient;
}


x86 assembly (clang, -O0):
<round_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
shl    $0x1,%edx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1148 <round_div+0x48>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1151 <round_div+0x51>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1151 <round_div+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_div>:
mov    %edi,%eax
cltd
idiv   %esi
add    %edx,%edx
cmp    %esi,%edx
jg     1113 <round_div+0x13>
test   $0x1,%al
je     1116 <round_div+0x16>
cmp    %esi,%edx
jne    1116 <round_div+0x16>
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @round_div(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sdiv i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
%13 = shl i32 %12, 1
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = icmp sgt i32 %14, %15
br i1 %16, label %25, label %17
17: ; preds = %2
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %28
21: ; preds = %17
%22 = load i32, i32* %5
%23 = and i32 %22, 1
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21, %2
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %28
28: ; preds = %25, %21, %17
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
define i32 @round_div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = shl i32 %4, 1
%6 = icmp sgt i32 %5, %1
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = icmp ne i32 %5, %1
%9 = and i32 %3, 1
%10 = icmp eq i32 %9, 0
%11 = or i1 %10, %8
br i1 %11, label %14, label %12
12: ; preds = %7, %2
%13 = add nsw i32 %3, 1
br label %14
14: ; preds = %12, %7
%15 = phi i32 [ %13, %12 ], [ %3, %7 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushcharacterarray(char *x, int n) { pushNarray(x, (unsigned int)n); }


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

x86 assembly (clang, -O2):
<pushcharacterarray>:
jmp    1030 <pushNarray@plt>

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

LLVM IR (-O2):
define void @pushcharacterarray(i8* %0, i32 %1) {
%3 = tail call i32 @pushNarray(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "Usage: %s [ --cpuoffset n ] [ --nrecorders n ] "
          "[ --test_cycle_tb_mask 0xhh ] [ --v ]\n",
          prog);
  exit(-1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [86 x i8] c"Usage: %s [ --cpuoffset n ] [ --nrecorders n ] [ --test_cycle_tb_mask 0xhh ] [ --v ]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [86 x i8] c"Usage: %s [ --cpuoffset n ] [ --nrecorders n ] [ --test_cycle_tb_mask 0xhh ] [ --v ]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
int roi_get_query_list_response_size(unsigned char numb,
                                     unsigned char packet_id_list[]) {
  return 2 + numb;
}


x86 assembly (clang, -O0):
<roi_get_query_list_response_size>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @roi_get_query_list_response_size(i8 zeroext %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 = zext i8 %5 to i32
%7 = add nsw i32 2, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @roi_get_query_list_response_size(i8 zeroext %0, i8* nocapture readnone %1) {
%3 = zext i8 %0 to i32
%4 = add nuw nsw i32 %3, 2
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
double __infer_nondet_double();
double wcstod(const wchar_t *nptr, wchar_t **endptr) {
  return __infer_nondet_double();
}


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

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

LLVM IR (-O0):
define double @wcstod(i32* %0, i32** %1) {
%3 = alloca i32*
%4 = alloca i32**
store i32* %0, i32** %3
store i32** %1, i32*** %4
%5 = call double (...) @__infer_nondet_double()
ret double %5
}

LLVM IR (-O2):
define double @wcstod(i32* nocapture readnone %0, i32** nocapture readnone %1) {
%3 = tail call double (...) @__infer_nondet_double()
ret double %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ chg_length;
};
typedef TYPE_1__ XIMPreeditDrawCallbackStruct;

/* Variables and functions */
int get_XIMPreeditDrawCallbackStruct_chg_length(void *_p) {
  return (int)((XIMPreeditDrawCallbackStruct *)_p)->chg_length;
}


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

x86 assembly (clang, -O2):
<get_XIMPreeditDrawCallbackStruct_chg_length>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XIMPreeditDrawCallbackStruct_chg_length(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 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XIMPreeditDrawCallbackStruct_chg_length(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glfPrint(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void glfPrintString(char *s) { glfPrint(s, strlen(s)); }


x86 assembly (clang, -O0):
<glfPrintString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <glfPrint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glfPrintString>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <glfPrint@plt>

LLVM IR (-O0):
define void @glfPrintString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @glfPrint(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @glfPrintString(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @glfPrint(i8* %0, i32 %2)
ret void
}
int sys$setime(unsigned long long *timadr) {
  return ({
    unsigned long resultvar;
    register long int _a1 asm("rdi") = (long)(timadr);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(10), "r"(_a1)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$setime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0xa,%rax
int    $0x81
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$setime>:
mov    $0xa,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$setime"(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %2
%6 = load i64*, i64** %2
%7 = ptrtoint i64* %6 to i64
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 10, i64 %8)
store i64 %9, i64* %3
%10 = load i64, i64* %3
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @"sys$setime"(i64* %0) {
%2 = ptrtoint i64* %0 to i64
%3 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 10, i64 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int jane, tarzan, cheeta;
  cheeta = tarzan = jane = 68;
  printf("                  cheeta    tarzan    jane\n");
  printf("First round score %4d %8d %8d\n", cheeta, tarzan, jane);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x44,-0x8(%rbp)
movl   $0x44,-0xc(%rbp)
movl   $0x44,-0x10(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [44 x i8] c" cheeta tarzan jane\0A\00"
@.str.1 = [31 x i8] c"First round score %4d %8d %8d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 68, i32* %2
store i32 68, i32* %3
store i32 68, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [31 x i8] c"First round score %4d %8d %8d\0A\00"
@str = [43 x i8] c" cheeta tarzan jane\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 68, i32 68, i32 68)
ret i32 0
}
double dbl_neg_mul_sub(double a, double b, double c) { return (-(a * b)) - c; }


x86 assembly (clang, -O0):
<dbl_neg_mul_sub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
subsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_neg_mul_sub>:
xorpd  0xef8(%rip),%xmm0
mulsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dbl_neg_mul_sub(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fmul double %7, %8
%10 = fneg double %9
%11 = load double, double* %6
%12 = fsub double %10, %11
ret double %12
}

LLVM IR (-O2):
define double @dbl_neg_mul_sub(double %0, double %1, double %2) {
%4 = fneg double %0
%5 = fmul double %4, %1
%6 = fsub double %5, %2
ret double %6
}
void net2h(unsigned int *h, unsigned char *net, int n) {
  unsigned int v;
  v = (net[1] << 8) | net[0];
  if (n == 2) {
    *h = v;
    return;
  }
  v |= (unsigned int)(net[3] << 24) | (net[2] << 16);
  *h = v;
  return;
}


x86 assembly (clang, -O0):
<net2h>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x2,-0x14(%rbp)
jne    113e <net2h+0x3e>
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    1165 <net2h+0x65>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<net2h>:
movzwl (%rsi),%eax
cmp    $0x2,%edx
je     111c <net2h+0x1c>
movzbl 0x3(%rsi),%ecx
shl    $0x18,%ecx
movzbl 0x2(%rsi),%edx
shl    $0x10,%edx
or     %eax,%ecx
or     %edx,%ecx
mov    %ecx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @net2h(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = or i32 %12, %16
store i32 %17, i32* %7
%18 = load i32, i32* %6
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %23
20: ; preds = %3
%21 = load i32, i32* %7
%22 = load i32*, i32** %4
store i32 %21, i32* %22
br label %39
23: ; preds = %3
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = shl i32 %27, 24
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 2
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = shl i32 %32, 16
%34 = or i32 %28, %33
%35 = load i32, i32* %7
%36 = or i32 %35, %34
store i32 %36, i32* %7
%37 = load i32, i32* %7
%38 = load i32*, i32** %4
store i32 %37, i32* %38
br label %39
39: ; preds = %23, %20
ret void
}

LLVM IR (-O2):
define void @net2h(i32* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = load i8, i8* %1
%9 = zext i8 %8 to i32
%10 = or i32 %7, %9
%11 = icmp eq i32 %2, 2
br i1 %11, label %23, label %12
12: ; preds = %3
%13 = getelementptr inbounds i8, i8* %1, i64 3
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = shl nuw i32 %15, 24
%17 = getelementptr inbounds i8, i8* %1, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl nuw nsw i32 %19, 16
%21 = or i32 %16, %10
%22 = or i32 %21, %20
br label %23
23: ; preds = %3, %12
%24 = phi i32 [ %22, %12 ], [ %10, %3 ]
store i32 %24, i32* %0
ret void
}
void g_async_queue_lock() {}


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

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

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

LLVM IR (-O2):
define void @g_async_queue_lock() {
ret void
}
unsigned xrop3_203_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D & S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_203_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_203_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_203_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_203_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, %6
%8 = xor i32 %7, -1
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void example_hook_pre() { puts("example_hook - pre"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"example_hook - pre\00"
define void @example_hook_pre() {
%1 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"example_hook - pre\00"
define void @example_hook_pre() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glColor3i(int, int, int);
void Color3i(int r, int g, int b) { glColor3i(r, g, b); }


x86 assembly (clang, -O0):
<Color3i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <glColor3i@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Color3i>:
jmp    1030 <glColor3i@plt>

LLVM IR (-O0):
define void @Color3i(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* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @glColor3i(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @Color3i(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glColor3i(i32 %0, i32 %1, i32 %2)
ret void
}
float multiplex_2_extended_types_s10_encode(double value) {
  return (float)(value);
}


x86 assembly (clang, -O0):
<multiplex_2_extended_types_s10_encode>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplex_2_extended_types_s10_encode>:
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @multiplex_2_extended_types_s10_encode(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptrunc double %3 to float
ret float %4
}

LLVM IR (-O2):
define float @multiplex_2_extended_types_s10_encode(double %0) {
%2 = fptrunc double %0 to float
ret float %2
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void helpAndLeave(const char *progname, int status) {
  fprintf(status == EXIT_FAILURE ? stderr : stdout, "Usage: %s <file>\n",
          progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%eax
jne    1152 <helpAndLeave+0x32>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    115e <helpAndLeave+0x3e>
mov    0x2e77(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eab(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea8(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@stderr = global i32 0
@stdout = global i32 0
@.str = [18 x i8] c"Usage: %s <file>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* @EXIT_FAILURE
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* @stderr
br label %12
10: ; preds = %2
%11 = load i32, i32* @stdout
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@stderr = global i32 0
@stdout = global i32 0
@.str = [18 x i8] c"Usage: %s <file>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_FAILURE
%4 = icmp eq i32 %3, %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @stdout
%7 = select i1 %4, i32 %5, i32 %6
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int *newWorkList(int length) {
  int *newList = (int *)calloc(length, sizeof(int));
  if (newList)
    return newList;
  else {
    fprintf(stderr, "Out of memory for work list\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<newWorkList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1161 <newWorkList+0x31>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<newWorkList>:
push   %rax
mov    $0x4,%esi
call   1030 <calloc@plt>
test   %rax,%rax
je     1142 <newWorkList+0x12>
pop    %rcx
ret
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Out of memory for work list\0A\00"
define i32* @newWorkList(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32*, i32** %3
ret i32* %10
11: ; preds = %1
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Out of memory for work list\0A\00"
define i32* @newWorkList(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i32*
ret i32* %5
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *const, size_t);
int strlen(char const *const);
char *zc_malloc(size_t);
char *zc_strdup(const char *const s) {
  size_t size;
  char *p;
  size = strlen(s) + 1;
  p = zc_malloc(size);
  memcpy(p, s, size);
  return p;
}


x86 assembly (clang, -O0):
<zc_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <zc_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zc_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 <zc_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @zc_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @zc_malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @zc_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 i8* @zc_malloc(i64 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRC7_set(void) { return U_WMRCORENONE_set("U_WMRC7"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRC7\00"
define i8* @U_WMRC7_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void welcome() {
  printf("\n-------------------------------------------------\n");
  printf("\tWelcome to SBUSH \n");
  printf("-------------------------------------------------\n");
  printf("\n\n");
}


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

x86 assembly (clang, -O2):
<welcome>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"\0A-------------------------------------------------\0A\00"
@.str.1 = [20 x i8] c"\09Welcome to SBUSH \0A\00"
@.str.2 = [51 x i8] c"-------------------------------------------------\0A\00"
@.str.3 = [3 x i8] c"\0A\0A\00"
define void @welcome() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"\0A-------------------------------------------------\00"
@str.4 = [19 x i8] c"\09Welcome to SBUSH \00"
@str.5 = [50 x i8] c"-------------------------------------------------\00"
@str.6 = [2 x i8] c"\0A\00"
define void @welcome() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int syscall(int, int);
int __pthread_fchdir(int dirfd) { return syscall(349, dirfd); }


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

x86 assembly (clang, -O2):
<__pthread_fchdir>:
mov    %edi,%esi
mov    $0x15d,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @__pthread_fchdir(i32 %0) {
%2 = tail call i32 @syscall(i32 349, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ mgrSendMessageToLedController(char *);
int mgrUploadStarted(int code, void *arg1, void *arg2) {
  ;
  mgrSendMessageToLedController("/led/orange/blink");
  return 0;
}


x86 assembly (clang, -O0):
<mgrUploadStarted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"/led/orange/blink\00"
define i32 @mgrUploadStarted(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"/led/orange/blink\00"
define i32 @mgrUploadStarted(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putbuf(unsigned char *, int);
void putbuf1(unsigned char i) { putbuf(&i, 1); }


x86 assembly (clang, -O0):
<putbuf1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <putbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putbuf1>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <putbuf@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @putbuf1(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @putbuf(i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @putbuf1(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @putbuf(i8* %2, i32 1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_standard_Laurent_target_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(786, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_standard_Laurent_target_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x312,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_standard_Laurent_target_system_to_container>:
mov    $0x312,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_standard_Laurent_target_system_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 786, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_standard_Laurent_target_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 786, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int isatty(int file) { return file <= 5; }


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
xor    %eax,%eax
cmp    $0x6,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @isatty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 5
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
%2 = icmp slt i32 %0, 6
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned getval_345() { return 3252717896U; }


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

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

LLVM IR (-O0):
define i32 @getval_345() {
ret i32 -1042249400
}

LLVM IR (-O2):
define i32 @getval_345() {
ret i32 -1042249400
}
__attribute__((weak)) void __cpu_init(void) {}


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

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

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

LLVM IR (-O2):
define weak void @__cpu_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_close_console();
int /*<<< orphan*/ log_close_kmsg();
int /*<<< orphan*/ log_close_syslog();
void log_close(void) {
  log_close_syslog();
  log_close_kmsg();
  log_close_console();
}


x86 assembly (clang, -O0):
<log_close>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <log_close_syslog@plt>
mov    $0x0,%al
call   1040 <log_close_kmsg@plt>
mov    $0x0,%al
call   1030 <log_close_console@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_close>:
push   %rax
xor    %eax,%eax
call   1050 <log_close_syslog@plt>
xor    %eax,%eax
call   1040 <log_close_kmsg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <log_close_console@plt>

LLVM IR (-O0):
define void @log_close() {
%1 = call i32 (...) @log_close_syslog()
%2 = call i32 (...) @log_close_kmsg()
%3 = call i32 (...) @log_close_console()
ret void
}

LLVM IR (-O2):
define void @log_close() {
%1 = tail call i32 (...) @log_close_syslog()
%2 = tail call i32 (...) @log_close_kmsg()
%3 = tail call i32 (...) @log_close_console()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arp_request(char *, char *);
int main(int argc, char **argv) { arp_request(argv[1], argv[2]); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1030 <arp_request@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 2
%10 = load i8*, i8** %9
%11 = call i32 @arp_request(i8* %7, i8* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @arp_request(i8* %4, i8* %6)
ret i32 0
}
/* Variables and functions */
size_t sdsTypeMaxSize(char type) {
  if (type == 0)
    return (1 << 5) - 1;
  if (type == 1)
    return (1 << 8) - 1;
  if (type == 2)
    return (1 << 16) - 1;
  if (type == 3)
    return (1ll << 32) - 1;
  return -1;
}


x86 assembly (clang, -O0):
<sdsTypeMaxSize>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    1124 <sdsTypeMaxSize+0x24>
movq   $0x1f,-0x8(%rbp)
jmp    117b <sdsTypeMaxSize+0x7b>
movsbl -0x9(%rbp),%eax
cmp    $0x1,%eax
jne    113e <sdsTypeMaxSize+0x3e>
movq   $0xff,-0x8(%rbp)
jmp    117b <sdsTypeMaxSize+0x7b>
movsbl -0x9(%rbp),%eax
cmp    $0x2,%eax
jne    1158 <sdsTypeMaxSize+0x58>
movq   $0xffff,-0x8(%rbp)
jmp    117b <sdsTypeMaxSize+0x7b>
movsbl -0x9(%rbp),%eax
cmp    $0x3,%eax
jne    1173 <sdsTypeMaxSize+0x73>
mov    $0xffffffff,%eax
mov    %rax,-0x8(%rbp)
jmp    117b <sdsTypeMaxSize+0x7b>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdsTypeMaxSize>:
mov    $0xffffffffffffffff,%rax
cmp    $0x3,%dil
ja     111c <sdsTypeMaxSize+0x1c>
movsbq %dil,%rax
lea    0xee8(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
define i64 @sdsTypeMaxSize(i8 signext %0) {
%2 = alloca i64
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 31, i64* %2
br label %24
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %8
store i64 255, i64* %2
br label %24
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %18
17: ; preds = %13
store i64 65535, i64* %2
br label %24
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 3
br i1 %21, label %22, label %23
22: ; preds = %18
store i64 4294967295, i64* %2
br label %24
23: ; preds = %18
store i64 -1, i64* %2
br label %24
24: ; preds = %23, %22, %17, %12, %7
%25 = load i64, i64* %2
ret i64 %25
}

LLVM IR (-O2):
@switch.table.sdsTypeMaxSize = [4 x i64] [i64 31, i64 255, i64 65535, i64 4294967295]
define i64 @sdsTypeMaxSize(i8 signext %0) {
%2 = icmp ult i8 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i8 %0 to i64
%5 = getelementptr inbounds [4 x i64], [4 x i64]* @switch.table.sdsTypeMaxSize, i64 0, i64 %4
%6 = load i64, i64* %5
br label %7
7: ; preds = %1, %3
%8 = phi i64 [ %6, %3 ], [ -1, %1 ]
ret i64 %8
}
/* Variables and functions */
long unpacki32(unsigned char *);
extern long int deserialize_int32(unsigned char *buf) {
  return (unpacki32(buf));
}


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

x86 assembly (clang, -O2):
<deserialize_int32>:
jmp    1030 <unpacki32@plt>

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

LLVM IR (-O2):
define i64 @deserialize_int32(i8* %0) {
%2 = tail call i64 @unpacki32(i8* %0)
ret i64 %2
}
void cpuidle_unregister_driver(struct cpuidle_driver *drv) {}


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

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

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

LLVM IR (-O2):
%struct.cpuidle_driver = type opaque
define void @cpuidle_unregister_driver(%struct.cpuidle_driver* nocapture %0) {
ret void
}
/* Type definitions */
typedef char *int64_t;

/* Variables and functions */
int64_t atomic_cmpswp64(volatile void *ptr, int64_t comparand, int64_t value) {
  int64_t result;
  __asm__ __volatile__("lock\n\tcmpxchg"
                       "q"
                       " %2,%1"
                       : "=a"(result), "=m"(*(volatile int64_t *)ptr)
                       : "q"(value), "0"(comparand),
                         "m"(*(volatile int64_t *)ptr)
                       : "memory");
  return result;
}


x86 assembly (clang, -O0):
<atomic_cmpswp64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rsi
lock cmpxchg %rdx,(%rcx)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_cmpswp64>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i8* @atomic_cmpswp64(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %6
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i8**
%14 = call i8* asm sideeffect "lock\0A\09cmpxchgq $2,$1", "={ax},=*m,q,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %9, i8* %10, i8* %11, i8** elementtype(i8*) %13)
store i8* %14, i8** %7
%15 = load i8*, i8** %7
ret i8* %15
}

LLVM IR (-O2):
define i8* @atomic_cmpswp64(i8* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %0 to i8**
%5 = tail call i8* asm sideeffect "lock\0A\09cmpxchgq $2,$1", "={ax},=*m,q,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %4, i8* %2, i8* %1, i8** elementtype(i8*) %4)
ret i8* %5
}
Z(int a, int b) {}


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

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

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

LLVM IR (-O2):
define i32 @Z(i32 %0, i32 %1) {
ret i32 undef
}