xunge/DecIR huggingface dataset:
/* Variables and functions */
char *jvp_utf8_next(char const *, char const *, int *);
int jvp_utf8_verify(const char *in, const char *end) {
  int codepoint = 0;
  while ((in = jvp_utf8_next(in, end, &codepoint))) {
    if (codepoint == -1)
      return 0;
  }
  return codepoint != -1;
}


x86 assembly (clang, -O0):
<jvp_utf8_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <jvp_utf8_next@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1161 <jvp_utf8_verify+0x51>
cmpl   $0xffffffff,-0x1c(%rbp)
jne    115c <jvp_utf8_verify+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1170 <jvp_utf8_verify+0x60>
jmp    1127 <jvp_utf8_verify+0x17>
cmpl   $0xffffffff,-0x1c(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jvp_utf8_verify>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%r14
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <jvp_utf8_next@plt>
mov    0x4(%rsp),%ecx
test   %rax,%rax
je     1150 <jvp_utf8_verify+0x40>
cmp    $0xffffffff,%ecx
jne    1130 <jvp_utf8_verify+0x20>
xor    %eax,%eax
jmp    1158 <jvp_utf8_verify+0x48>
xor    %eax,%eax
cmp    $0xffffffff,%ecx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @jvp_utf8_verify(i8* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %10, %2
%6 = phi i8* [ %0, %2 ], [ %7, %10 ]
%7 = call i8* @jvp_utf8_next(i8* %6, i8* %1, i32* %3)
%8 = icmp eq i8* %7, null
%9 = load i32, i32* %3
br i1 %8, label %12, label %10
10: ; preds = %5
%11 = icmp eq i32 %9, -1
br i1 %11, label %15, label %5
12: ; preds = %5
%13 = icmp ne i32 %9, -1
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %10, %12
%16 = phi i32 [ %14, %12 ], [ 0, %10 ]
ret i32 %16
}
int cairo_code_draw_flatDial_get_height() { return 30; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_flatDial_get_height() {
ret i32 30
}

LLVM IR (-O2):
define i32 @cairo_code_draw_flatDial_get_height() {
ret i32 30
}
/* Variables and functions */
int /*<<< orphan*/ unexpected_error(char *, char *, int);
void free_cholesky_mpi() {
  unexpected_error("Unimplemented free_cholesky_mpi",
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/slitvinov/BD_BOX/refs/"
                   "heads/master/src/diff_alg/cholesky_mpi.c",
                   106);
}


x86 assembly (clang, -O0):
<free_cholesky_mpi>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xefe(%rip),%rsi
mov    $0x6a,%edx
call   1030 <unexpected_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_cholesky_mpi>:
lea    0xee9(%rip),%rdi
lea    0xf02(%rip),%rsi
mov    $0x6a,%edx
jmp    1030 <unexpected_error@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Unimplemented free_cholesky_mpi\00"
@.str.1 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/slitvinov/BD_BOX/refs/heads/master/src/diff_alg/cholesky_mpi.c\00"
define void @free_cholesky_mpi() {
%1 = call i32 @unexpected_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 106)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Unimplemented free_cholesky_mpi\00"
@.str.1 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/slitvinov/BD_BOX/refs/heads/master/src/diff_alg/cholesky_mpi.c\00"
define void @free_cholesky_mpi() {
%1 = tail call i32 @unexpected_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.1, i64 0, i64 0), i32 106)
ret void
}
void __attribute__((regparm(3))) foo(int x, int y) {
  __asm__ __volatile__("" : : "d"(x), "r"(y));
}


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

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%edx
ret

LLVM IR (-O0):
define void @foo(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
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
tail call void asm sideeffect "", "{dx},r,~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _mm_load_ss(float *);
int /*<<< orphan*/ _mm_store_ss(float *, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_sub_ss(int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t determ_subtract_float(uint32_t a, uint32_t b) {
  uint32_t r;
  _mm_store_ss((float *)&r,
               _mm_sub_ss(_mm_load_ss((float *)&a), _mm_load_ss((float *)&b)));
  return r;
}


x86 assembly (clang, -O0):
<determ_subtract_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rdi
call   1050 <_mm_load_ss@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <_mm_load_ss@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1040 <_mm_sub_ss@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <_mm_store_ss@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determ_subtract_float>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x8(%rsp)
lea    0xc(%rsp),%rdi
call   1050 <_mm_load_ss@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
call   1050 <_mm_load_ss@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <_mm_sub_ss@plt>
lea    0x4(%rsp),%rdi
mov    %eax,%esi
call   1030 <_mm_store_ss@plt>
mov    0x4(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @determ_subtract_float(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = bitcast i32* %5 to float*
%7 = bitcast i32* %3 to float*
%8 = call i32 @_mm_load_ss(float* %7)
%9 = bitcast i32* %4 to float*
%10 = call i32 @_mm_load_ss(float* %9)
%11 = call i32 @_mm_sub_ss(i32 %8, i32 %10)
%12 = call i32 @_mm_store_ss(float* %6, i32 %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @determ_subtract_float(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = bitcast i32* %5 to i8*
%7 = bitcast i32* %5 to float*
%8 = bitcast i32* %3 to float*
%9 = call i32 @_mm_load_ss(float* %8)
%10 = bitcast i32* %4 to float*
%11 = call i32 @_mm_load_ss(float* %10)
%12 = call i32 @_mm_sub_ss(i32 %9, i32 %11)
%13 = call i32 @_mm_store_ss(float* %7, i32 %12)
%14 = load i32, i32* %5
ret i32 %14
}
void sg_broadcast_msg_handler(char *source_instance, void *msg,
                              unsigned short msglen) {
  printf("got server group broadcast msg: len: %d, sinstance: %.20s, msg: "
         "%.*s\n\n",
         msglen, source_instance, msglen, (char *)msg);
}


x86 assembly (clang, -O0):
<sg_broadcast_msg_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%esi
mov    -0x8(%rbp),%rdx
movzwl -0x12(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_broadcast_msg_handler>:
mov    %edx,%ecx
mov    %rsi,%r8
mov    %rdi,%rdx
lea    0xee1(%rip),%rdi
mov    %ecx,%esi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [71 x i8] c"got server group broadcast msg: len: %d, sinstance: %.20s, msg: %.*s\0A\0A\00"
define void @sg_broadcast_msg_handler(i8* %0, i8* %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i16
store i8* %0, i8** %4
store i8* %1, i8** %5
store i16 %2, i16* %6
%7 = load i16, i16* %6
%8 = zext i16 %7 to i32
%9 = load i8*, i8** %4
%10 = load i16, i16* %6
%11 = zext i16 %10 to i32
%12 = load i8*, i8** %5
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9, i32 %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"got server group broadcast msg: len: %d, sinstance: %.20s, msg: %.*s\0A\0A\00"
define void @sg_broadcast_msg_handler(i8* %0, i8* %1, i16 zeroext %2) {
%4 = zext i16 %2 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %0, i32 %4, i8* %1)
ret void
}
/* Type definitions */
struct tcphdr {
  int dummy;
};
struct sk_buff {
  int dummy;
};

/* Variables and functions */
scalar_t__ skb_transport_header(struct sk_buff const *);
struct tcphdr *tcp_hdr(const struct sk_buff *skb) {
  return (struct tcphdr *)skb_transport_header(skb);
}


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

x86 assembly (clang, -O2):
<tcp_hdr>:
jmp    1030 <skb_transport_header@plt>

LLVM IR (-O0):
%struct.tcphdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.tcphdr* @tcp_hdr(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
%4 = call i64 @skb_transport_header(%struct.sk_buff* %3)
%5 = inttoptr i64 %4 to %struct.tcphdr*
ret %struct.tcphdr* %5
}

LLVM IR (-O2):
%struct.tcphdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.tcphdr* @tcp_hdr(%struct.sk_buff* %0) {
%2 = tail call i64 @skb_transport_header(%struct.sk_buff* %0)
%3 = inttoptr i64 %2 to %struct.tcphdr*
ret %struct.tcphdr* %3
}
int r_max(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<r_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <r_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <r_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @r_max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @r_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int tolower(int c) { return ('A' <= c && c <= 'Z') ? c - 'A' + 'a' : c; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x41,%eax
cmp    -0x4(%rbp),%eax
jg     1130 <tolower+0x30>
cmpl   $0x5a,-0x4(%rbp)
jg     1130 <tolower+0x30>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <tolower+0x36>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 65, %3
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 65
%11 = add nsw i32 %10, 97
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void NullCursorDraw(void *self) {}


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

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

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

LLVM IR (-O2):
define void @NullCursorDraw(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ consoleCmdSetCampos(int, int /*<<< orphan*/);
int /*<<< orphan*/ pow(int, double);
void consoleCmdSetCamposl(int index, double value) {
  consoleCmdSetCampos(index, pow(2, value));
}


x86 assembly (clang, -O0):
<consoleCmdSetCamposl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <consoleCmdSetCampos@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consoleCmdSetCamposl>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <consoleCmdSetCampos@plt>

LLVM IR (-O0):
define void @consoleCmdSetCamposl(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = load double, double* %4
%7 = call i32 @pow(i32 2, double %6)
%8 = call i32 @consoleCmdSetCampos(i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @consoleCmdSetCamposl(i32 %0, double %1) {
%3 = tail call i32 @pow(i32 2, double %1)
%4 = tail call i32 @consoleCmdSetCampos(i32 %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int arr[], size_t arr_sz) {
  size_t i;
  for (i = 0; i < arr_sz; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1160 <print_array+0x50>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <print_array+0x18>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1157 <print_array+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_array(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int bs_get_info(int, char *, char **);
int /*<<< orphan*/ snprintf(char *, int, char *);
int bs_stats(int fd, char **yaml) {
  char command[64];
  snprintf(command, 64, "stats\r\n");
  return bs_get_info(fd, command, yaml);
}


x86 assembly (clang, -O0):
<bs_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0x40,%esi
lea    0xec1(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x4(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <bs_get_info@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_stats>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecc(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1040 <snprintf@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <bs_get_info@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"stats\0D\0A\00"
define i32 @bs_stats(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [64 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 64, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%10 = load i8**, i8*** %4
%11 = call i32 @bs_get_info(i32 %8, i8* %9, i8** %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"stats\0D\0A\00"
define i32 @bs_stats(i32 %0, i8** %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @bs_get_info(i32 %0, i8* %4, i8** %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void check_alloc_bitstream(void *ptr) {
  if (!ptr) {
    fprintf(stderr, "alloc error: OUT OF MEMORY\n");
  }
}


x86 assembly (clang, -O0):
<check_alloc_bitstream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <check_alloc_bitstream+0x2c>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_alloc_bitstream>:
test   %rdi,%rdi
je     1116 <check_alloc_bitstream+0x6>
ret
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"alloc error: OUT OF MEMORY\0A\00"
define void @check_alloc_bitstream(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"alloc error: OUT OF MEMORY\0A\00"
define void @check_alloc_bitstream(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int booster_xstat(int, char const *, void *);
int __xstat(int ver, const char *path, void *buf) {
  return booster_xstat(ver, path, buf);
}


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

x86 assembly (clang, -O2):
<__xstat>:
jmp    1030 <booster_xstat@plt>

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

LLVM IR (-O2):
define i32 @__xstat(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @booster_xstat(i32 %0, i8* %1, i8* %2)
ret i32 %4
}
extern short ReturnShort() { return 102; }


x86 assembly (clang, -O0):
<ReturnShort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x66,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReturnShort>:
mov    $0x66,%ax
ret

LLVM IR (-O0):
define signext i16 @ReturnShort() {
ret i16 102
}

LLVM IR (-O2):
define signext i16 @ReturnShort() {
ret i16 102
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t map_noise_to_water(double noise) {
  if (noise < .38) {
    return 1;
  }
  if (noise < .42) {
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<map_noise_to_water>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1128 <map_noise_to_water+0x28>
movl   $0x1,-0x4(%rbp)
jmp    114e <map_noise_to_water+0x4e>
movsd  0xed8(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1147 <map_noise_to_water+0x47>
movl   $0x2,-0x4(%rbp)
jmp    114e <map_noise_to_water+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_noise_to_water>:
movsd  0xef8(%rip),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
add    %ecx,%ecx
movsd  0xeed(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @map_noise_to_water(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 3.800000e-01
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, 4.200000e-01
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %12
11: ; preds = %7
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @map_noise_to_water(double %0) {
%2 = fcmp olt double %0, 3.800000e-01
%3 = fcmp olt double %0, 4.200000e-01
%4 = select i1 %3, i32 2, i32 0
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
void glVertexAttrib1fv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glVertexAttrib1fv() {
ret void
}
unsigned ns_get16(const unsigned char *cp) { return cp[0] << 8 | cp[1]; }


x86 assembly (clang, -O0):
<ns_get16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_get16>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @ns_get16(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
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ns_get16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ abs(int);
int floor(int /*<<< orphan*/);
int /*<<< orphan*/ log10(int /*<<< orphan*/);
int NumPlaces(int n) {
  if (n == 0)
    return 1;
  return floor(log10(abs(n))) + 1;
}


x86 assembly (clang, -O0):
<NumPlaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1151 <NumPlaces+0x21>
movl   $0x1,-0x4(%rbp)
jmp    116d <NumPlaces+0x3d>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1040 <log10@plt>
mov    %eax,%edi
call   1050 <floor@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumPlaces>:
test   %edi,%edi
je     1142 <NumPlaces+0x22>
push   %rax
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
mov    %eax,%edi
call   1030 <log10@plt>
mov    %eax,%edi
call   1040 <floor@plt>
add    $0x1,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @NumPlaces(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @abs(i32 %8)
%10 = call i32 @log10(i32 %9)
%11 = call i32 @floor(i32 %10)
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @NumPlaces(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%5 = tail call i32 @log10(i32 %4)
%6 = tail call i32 @floor(i32 %5)
%7 = add nsw i32 %6, 1
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ 1, %1 ]
ret i32 %9
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int got_clock(void) {
  struct timespec t;
  if (clock_gettime(CLOCK_MONOTONIC, &t) == -1)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<got_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0xffffffff,%eax
jne    113f <got_clock+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1146 <got_clock+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<got_clock>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @got_clock() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %8
7: ; preds = %0
store i32 1, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @got_clock() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int terminal_set32(int /*<<< orphan*/ const *);
int terminal_wset(const wchar_t *value) {
  return terminal_set32((const int32_t *)value);
}


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

x86 assembly (clang, -O2):
<terminal_wset>:
jmp    1030 <terminal_set32@plt>

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

LLVM IR (-O2):
define i32 @terminal_wset(i32* %0) {
%2 = tail call i32 @terminal_set32(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void *MAP_FAILED;
scalar_t__ errno;
void *mmap(void *, uintptr_t, int /*<<< orphan*/, int /*<<< orphan*/,
           int /*<<< orphan*/, int /*<<< orphan*/);
void *x_cgo_mmap(void *addr, uintptr_t length, int32_t prot, int32_t flags,
                 int32_t fd, uint32_t offset) {
  void *p;
  ;
  p = mmap(addr, length, prot, flags, fd, offset);
  ;
  if (p == MAP_FAILED) {
    p = (void *)(uintptr_t)errno;
  }
  return p;
}


x86 assembly (clang, -O0):
<x_cgo_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1030 <mmap@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%rax
jne    116f <x_cgo_mmap+0x5f>
mov    0x2e78(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_cgo_mmap>:
push   %rax
call   1030 <mmap@plt>
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
jne    112c <x_cgo_mmap+0x1c>
mov    0x2eb7(%rip),%rax
mov    (%rax),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@MAP_FAILED = global i8* null
@errno = global i64 0
define i8* @x_cgo_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%8 = load i8*, i8** @MAP_FAILED
%9 = icmp eq i8* %7, %8
%10 = load i64, i64* @errno
%11 = inttoptr i64 %10 to i8*
%12 = select i1 %9, i8* %11, i8* %7
ret i8* %12
}
void init_asdf_data_(void) {}


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

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

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

LLVM IR (-O2):
define void @init_asdf_data_() {
ret void
}
int test_imm_81uint16_reg(unsigned short val) {
  return ((val) & (0x81 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_81uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 129
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_81uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 129
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int test_adds();
int test_subs();
int ed25519_donna_selftest(void) {
  int ret = 0;
  ret |= test_adds();
  ret |= test_subs();
  return (ret == 0) ? 0 : -1;
}


x86 assembly (clang, -O0):
<ed25519_donna_selftest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_adds@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_subs@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ed25519_donna_selftest>:
push   %rbx
xor    %eax,%eax
call   1030 <test_adds@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <test_subs@plt>
xor    %ecx,%ecx
or     %ebx,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ed25519_donna_selftest() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_adds()
%3 = load i32, i32* %1
%4 = or i32 %3, %2
store i32 %4, i32* %1
%5 = call i32 (...) @test_subs()
%6 = load i32, i32* %1
%7 = or i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 -1
ret i32 %11
}

LLVM IR (-O2):
define i32 @ed25519_donna_selftest() {
%1 = tail call i32 (...) @test_adds()
%2 = tail call i32 (...) @test_subs()
%3 = or i32 %2, %1
%4 = icmp ne i32 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_ERROR;
int getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int *);
int socket_check(int fd) {
  int ret;
  int code;
  socklen_t len = sizeof(int);
  ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, &code, &len);
  if ((ret || code) != 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<socket_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x15(%rbp)
jne    1160 <socket_check+0x50>
cmpl   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     117d <socket_check+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    1184 <socket_check+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_check>:
push   %rax
movl   $0x4,(%rsp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
call   1030 <getsockopt@plt>
xor    %ecx,%ecx
or     0x4(%rsp),%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @socket_check(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %6
%7 = load i32, i32* %3
%8 = load i32, i32* @SOL_SOCKET
%9 = load i32, i32* @SO_ERROR
%10 = call i32 @getsockopt(i32 %7, i32 %8, i32 %9, i32* %5, i32* %6)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %1
%14 = load i32, i32* %5
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %13, %1
%17 = phi i1 [ true, %1 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %22
21: ; preds = %16
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @socket_check(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_ERROR
%8 = call i32 @getsockopt(i32 %0, i32 %6, i32 %7, i32* %2, i32* %3)
%9 = icmp ne i32 %8, 0
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
%12 = select i1 %9, i1 true, i1 %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(int);
int readchar(int);
int readno(int fd) {
  int c, no = 0;
  for (;;) {
    c = readchar(fd);
    if (!isdigit(c))
      break;
    no = 10 * no + c - '0';
  }
  return no;
}


x86 assembly (clang, -O0):
<readno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <readchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%eax
jne    1153 <readno+0x33>
jmp    1165 <readno+0x45>
imul   $0xa,-0xc(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <readno+0x12>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readno>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <readchar@plt>
lea    -0x30(%rax),%ecx
xor    %ebx,%ebx
cmp    $0x9,%ecx
ja     114a <readno+0x3a>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    (%rbx,%rbx,4),%ecx
lea    (%rax,%rcx,2),%ebx
add    $0xffffffd0,%ebx
mov    %ebp,%edi
call   1030 <readchar@plt>
mov    %eax,%ecx
add    $0xffffffd0,%ecx
cmp    $0xa,%ecx
jb     1130 <readno+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readno(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %2
%7 = call i32 @readchar(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @isdigit(i32 %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %5
br label %18
12: ; preds = %5
%13 = load i32, i32* %4
%14 = mul nsw i32 10, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
%17 = sub nsw i32 %16, 48
store i32 %17, i32* %4
br label %5
18: ; preds = %11
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @readno(i32 %0) {
%2 = tail call i32 @readchar(i32 %0)
%3 = add i32 %2, -48
%4 = icmp ult i32 %3, 10
br i1 %4, label %5, label %14
5: ; preds = %1, %5
%6 = phi i32 [ %11, %5 ], [ %2, %1 ]
%7 = phi i32 [ %10, %5 ], [ 0, %1 ]
%8 = mul nsw i32 %7, 10
%9 = add nsw i32 %6, -48
%10 = add i32 %9, %8
%11 = tail call i32 @readchar(i32 %0)
%12 = add i32 %11, -48
%13 = icmp ult i32 %12, 10
br i1 %13, label %5, label %14
14: ; preds = %5, %1
%15 = phi i32 [ 0, %1 ], [ %10, %5 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ handle_WIND(int /*<<< orphan*/);
int gen_WIND(void) {
  handle_WIND(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_WIND>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_WIND@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_WIND() {
%1 = call i32 @handle_WIND(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_WIND() {
%1 = tail call i32 @handle_WIND(i32 0)
ret i32 0
}
/* Variables and functions */
unsigned long GetNextMsg255();
unsigned long getnextmsg() { return GetNextMsg255(); }


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

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

LLVM IR (-O0):
define i64 @getnextmsg() {
%1 = call i64 (...) @GetNextMsg255()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getnextmsg() {
%1 = tail call i64 (...) @GetNextMsg255()
ret i64 %1
}
void gtk_action_group_set_sensitive() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_group_set_sensitive() {
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void set_tree_addr(uint32_t addr[8], uint64_t tree) {
  addr[1] = 0;
  addr[2] = (uint32_t)(tree >> 32);
  addr[3] = (uint32_t)tree;
}


x86 assembly (clang, -O0):
<set_tree_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_tree_addr>:
movq   $0x0,0x8(%rdi)
movslq %esi,%rax
mov    %rax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @set_tree_addr(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = getelementptr inbounds i64, i64* %5, i64 1
store i64 0, i64* %6
%7 = load i32, i32* %4
%8 = ashr i32 %7, 32
%9 = sext i32 %8 to i64
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i64 2
store i64 %9, i64* %11
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = load i64*, i64** %3
%15 = getelementptr inbounds i64, i64* %14, i64 3
store i64 %13, i64* %15
ret void
}

LLVM IR (-O2):
define void @set_tree_addr(i64* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i64, i64* %0, i64 1
store i64 0, i64* %3
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %4, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _unsupported();
void _Unwind_GetTextRelBase() { _unsupported(); }


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

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

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

LLVM IR (-O2):
define void @_Unwind_GetTextRelBase() {
%1 = tail call i32 (...) @_unsupported()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, size_t);
int main(void) {
  int n = 0;
  size_t intsize;
  intsize = sizeof(int);
  printf("n = %d, n has %zd bytes; all ints have %zd bytes.\n", n, sizeof n,
         intsize);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"n = %d, n has %zd bytes; all ints have %zd bytes.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
store i64 4, i64* %3
%4 = load i32, i32* %2
%5 = load i64, i64* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %4, i32 4, i64 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"n = %d, n has %zd bytes; all ints have %zd bytes.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 0, i32 4, i64 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void syswarn(char const *msg) { perror(msg); }


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

x86 assembly (clang, -O2):
<syswarn>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @syswarn(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
void another_test() {}


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

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

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

LLVM IR (-O2):
define void @another_test() {
ret void
}
int Operand_immrx4_decode(unsigned int *valp) {
  unsigned immrx4_0, r_0;
  r_0 = *valp & 0xf;
  immrx4_0 = (((0xfffffff) << 4) | r_0) << 2;
  *valp = immrx4_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_immrx4_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xf,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     $0xfffffff0,%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_immrx4_decode>:
mov    (%rdi),%eax
shl    $0x2,%eax
or     $0xffffffc0,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_immrx4_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 15
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = or i32 -16, %8
%10 = shl i32 %9, 2
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32*, i32** %2
store i32 %11, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_immrx4_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 2
%4 = or i32 %3, -64
store i32 %4, i32* %0
ret i32 0
}