xunge/DecIR huggingface dataset:
int digit(ch)
char ch;
{ return ('0' <= ch && ch <= '9'); }


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <digit+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit>:
shl    $0x18,%edi
add    $0xd0ffffff,%edi
xor    %eax,%eax
cmp    $0xaffffff,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @digit(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sle i32 48, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ false, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @digit(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -788529153
%4 = icmp ult i32 %3, 184549375
%5 = zext i1 %4 to i32
ret i32 %5
}
int countBinary(int n) {
  if (n == 0)
    return n;
  else
    return countBinary(n >> 1) + 1;
}


x86 assembly (clang, -O0):
<countBinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1130 <countBinary+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <countBinary+0x31>
mov    -0x8(%rbp),%edi
sar    $0x1,%edi
call   1030 <countBinary@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countBinary>:
xor    %eax,%eax
test   %edi,%edi
je     111c <countBinary+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <countBinary+0x10>
ret

LLVM IR (-O0):
define i32 @countBinary(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 %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = ashr i32 %9, 1
%11 = call i32 @countBinary(i32 %10)
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %13
13: ; preds = %8, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @countBinary(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = ashr i32 %4, 1
%7 = add nuw nsw i32 %5, 1
%8 = icmp ult i32 %4, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
float _surand();
int log(float);
float expRand(float lambda) {
  float u, x;
  u = _surand();
  x = (-1 / lambda) * log(u);
  return (x);
}


x86 assembly (clang, -O0):
<expRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <_surand@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xebf(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <log@plt>
movss  -0x10(%rbp),%xmm0
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expRand>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <_surand@plt>
movss  0xeca(%rip),%xmm1
divss  0x4(%rsp),%xmm1
movss  %xmm1,0x4(%rsp)
call   1040 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @expRand(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = call float (...) @_surand()
store float %5, float* %3
%6 = load float, float* %2
%7 = fdiv float -1.000000e+00, %6
%8 = load float, float* %3
%9 = call i32 @log(float %8)
%10 = sitofp i32 %9 to float
%11 = fmul float %7, %10
store float %11, float* %4
%12 = load float, float* %4
ret float %12
}

LLVM IR (-O2):
define float @expRand(float %0) {
%2 = tail call float (...) @_surand()
%3 = fdiv float -1.000000e+00, %0
%4 = tail call i32 @log(float %2)
%5 = sitofp i32 %4 to float
%6 = fmul float %3, %5
ret float %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t pmt_plane_pixel(uint8_t pmt_byte, uint8_t pmt_pixel_idx) {
  uint8_t bit_mask = 1 << pmt_pixel_idx;
  return (pmt_byte & bit_mask) >> pmt_pixel_idx;
}


x86 assembly (clang, -O0):
<pmt_plane_pixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmt_plane_pixel>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @pmt_plane_pixel(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
%5 = ashr i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("C file\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"C file\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fact(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  printf("fact(10) = %llu\n", fact(10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <fact@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"fact(10) = %llu\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fact(i32 10)
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"fact(10) = %llu\0A\00"
define i32 @main() {
%1 = tail call i32 @fact(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void doNext(int num) {
  if (num <= 3) {
    printf("%d ", num);
    doNext(num + 1);
  } else
    printf("\n");
}


x86 assembly (clang, -O0):
<doNext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jg     1156 <doNext+0x36>
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <doNext@plt>
jmp    1164 <doNext+0x44>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doNext>:
push   %r14
push   %rbx
push   %rax
cmp    $0x3,%edi
jg     1154 <doNext+0x34>
mov    %edi,%ebx
lea    0xece(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x4,%ebx
jne    1140 <doNext+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @doNext(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add i32 %4, 1
%7 = icmp eq i32 %6, 4
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_tty_constraint(unsigned int);
void print_tty_constraint_full(void) {
  print_tty_constraint(1U | 2U | 4U | 8U | 16U);
}


x86 assembly (clang, -O0):
<print_tty_constraint_full>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f,%edi
call   1030 <print_tty_constraint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tty_constraint_full>:
mov    $0x1f,%edi
jmp    1030 <print_tty_constraint@plt>

LLVM IR (-O0):
define void @print_tty_constraint_full() {
%1 = call i32 @print_tty_constraint(i32 31)
ret void
}

LLVM IR (-O2):
define void @print_tty_constraint_full() {
%1 = tail call i32 @print_tty_constraint(i32 31)
ret void
}
/* Variables and functions */
unsigned long strtoul(char const *, char **, int);
int stcld_u(const char *string, unsigned long *pul) {
  char *pc;
  *pul = strtoul(string, &pc, 10);
  return pc - string;
}


x86 assembly (clang, -O0):
<stcld_u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stcld_u>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    %rax,(%r14)
mov    (%rsp),%eax
sub    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @stcld_u(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i8*
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = load i8*, i8** %3
%7 = call i64 @strtoul(i8* %6, i8** %5, i32 10)
%8 = load i64*, i64** %4
store i64 %7, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @stcld_u(i8* %0, i64* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtoul(i8* %0, i8** %3, i32 10)
store i64 %5, i64* %1
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}
/* Type definitions */
struct kore_task {
  int dummy;
};

/* Variables and functions */
int kore_task_state(struct kore_task *);
int kore_task_finished(struct kore_task *t) {
  return ((kore_task_state(t) == 3));
}


x86 assembly (clang, -O0):
<kore_task_finished>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <kore_task_state@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kore_task_finished>:
push   %rax
call   1030 <kore_task_state@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.kore_task = type { i32 }
define i32 @kore_task_finished(%struct.kore_task* %0) {
%2 = alloca %struct.kore_task*
store %struct.kore_task* %0, %struct.kore_task** %2
%3 = load %struct.kore_task*, %struct.kore_task** %2
%4 = call i32 @kore_task_state(%struct.kore_task* %3)
%5 = icmp eq i32 %4, 3
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.kore_task = type { i32 }
define i32 @kore_task_finished(%struct.kore_task* %0) {
%2 = tail call i32 @kore_task_state(%struct.kore_task* %0)
%3 = icmp eq i32 %2, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ draw_symbol(int, char);
int /*<<< orphan*/ printf(char *);
void draw_top_line(int spaces_count) {
  draw_symbol(spaces_count + 1, ' ');
  printf("*");
  draw_symbol(spaces_count, ' ');
}


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

x86 assembly (clang, -O2):
<draw_top_line>:
push   %rbx
mov    %edi,%ebx
lea    0x1(%rbx),%edi
mov    $0x20,%esi
call   1040 <draw_symbol@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
mov    $0x20,%esi
pop    %rbx
jmp    1040 <draw_symbol@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
define void @draw_top_line(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @draw_symbol(i32 %4, i8 signext 32)
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = call i32 @draw_symbol(i32 %7, i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @draw_top_line(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @draw_symbol(i32 %2, i8 signext 32)
%4 = tail call i32 @putchar(i32 42)
%5 = tail call i32 @draw_symbol(i32 %0, i8 signext 32)
ret void
}
__attribute__((always_)) int register_trace_mm_page_alloc_zone_locked(
    void (*probe)(void *__data, struct page *page, unsigned int order,
                  int migratetype),
    void *data) {
  return -38;
}


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

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

LLVM IR (-O0):
%struct.page = type opaque
define i32 @register_trace_mm_page_alloc_zone_locked(void (i8*, %struct.page*, i32, i32)* %0, i8* %1) {
%3 = alloca void (i8*, %struct.page*, i32, i32)*
%4 = alloca i8*
store void (i8*, %struct.page*, i32, i32)* %0, void (i8*, %struct.page*, i32, i32)** %3
store i8* %1, i8** %4
ret i32 -38
}

LLVM IR (-O2):
%struct.page = type opaque
define i32 @register_trace_mm_page_alloc_zone_locked(void (i8*, %struct.page*, i32, i32)* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -38
}
/* Type definitions */
struct chunkpool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ chunkpool_free2(struct chunkpool *, int /*<<< orphan*/ *);
void chunkpool_free(struct chunkpool *ctx) { chunkpool_free2(ctx, NULL); }


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

x86 assembly (clang, -O2):
<chunkpool_free>:
xor    %esi,%esi
jmp    1030 <chunkpool_free2@plt>

LLVM IR (-O0):
%struct.chunkpool = type { i32 }
define void @chunkpool_free(%struct.chunkpool* %0) {
%2 = alloca %struct.chunkpool*
store %struct.chunkpool* %0, %struct.chunkpool** %2
%3 = load %struct.chunkpool*, %struct.chunkpool** %2
%4 = call i32 @chunkpool_free2(%struct.chunkpool* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.chunkpool = type { i32 }
define void @chunkpool_free(%struct.chunkpool* %0) {
%2 = tail call i32 @chunkpool_free2(%struct.chunkpool* %0, i32* null)
ret void
}
long extract_bd(insn, invalid)
unsigned long insn;
int *invalid;
{
  if ((insn & 0x8000) != 0)
    return (insn & 0xfffc) - 0x10000;
  else
    return insn & 0xfffc;
}


x86 assembly (clang, -O0):
<extract_bd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x8000,%rax
cmp    $0x0,%rax
je     1139 <extract_bd+0x39>
mov    -0x10(%rbp),%rax
and    $0xfffc,%rax
sub    $0x10000,%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <extract_bd+0x47>
mov    -0x10(%rbp),%rax
and    $0xfffc,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_bd>:
mov    %edi,%ecx
and    $0xfffc,%ecx
lea    -0x10000(%rcx),%rax
test   $0x8000,%edi
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @extract_bd(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %4
store i32* %1, i32** %5
%6 = load i64, i64* %4
%7 = and i64 %6, 32768
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i64, i64* %4
%11 = and i64 %10, 65532
%12 = sub i64 %11, 65536
store i64 %12, i64* %3
br label %16
13: ; preds = %2
%14 = load i64, i64* %4
%15 = and i64 %14, 65532
store i64 %15, i64* %3
br label %16
16: ; preds = %13, %9
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @extract_bd(i64 %0, i32* nocapture readnone %1) {
%3 = and i64 %0, 32768
%4 = icmp eq i64 %3, 0
%5 = and i64 %0, 65532
%6 = or i64 %5, -65536
%7 = select i1 %4, i64 %5, i64 %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *atgv[]) {
  int i;
  for (i = 32; i <= 126; i++) {
    printf("%d   <%c> \n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x20,-0x14(%rbp)
cmpl   $0x7e,-0x14(%rbp)
jg     1157 <main+0x47>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x20,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x7f,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d <%c> \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 32, %2 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 127
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
void clear_crlf(char *str) {
  if (!str)
    return;
  while (*str++ != '\0') {
    if (*str == '\n')
      *str = '\0';
  }
  return;
}


x86 assembly (clang, -O0):
<clear_crlf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <clear_crlf+0x18>
jmp    1159 <clear_crlf+0x59>
jmp    111d <clear_crlf+0x1d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1154 <clear_crlf+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    114f <clear_crlf+0x4f>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    111d <clear_crlf+0x1d>
jmp    1159 <clear_crlf+0x59>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_crlf>:
test   %rdi,%rdi
je     1123 <clear_crlf+0x23>
cmpb   $0x0,(%rdi)
je     1123 <clear_crlf+0x23>
add    $0x1,%rdi
xchg   %ax,%ax
movzbl (%rdi),%eax
test   %al,%al
je     1123 <clear_crlf+0x23>
add    $0x1,%rdi
cmp    $0xa,%al
jne    1110 <clear_crlf+0x10>
movb   $0x0,-0x1(%rdi)
ret

LLVM IR (-O0):
define void @clear_crlf(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 %6, label %5
5: ; preds = %1
br label %22
6: ; preds = %1
br label %7
7: ; preds = %20, %6
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %7
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = load i8*, i8** %2
store i8 0, i8* %19
br label %20
20: ; preds = %18, %13
br label %7
21: ; preds = %7
br label %22
22: ; preds = %21, %5
ret void
}

LLVM IR (-O2):
define void @clear_crlf(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %0, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
switch i8 %9, label %6 [
i8 10, label %10
i8 0, label %11
]
10: ; preds = %6
store i8 0, i8* %8
br label %11
11: ; preds = %6, %10, %3, %1
ret void
}
int cmp(const void *a, const void *b) { return *(int *)a > *(int *)b ? 1 : -1; }


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 -1
ret i32 %13
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = select i1 %7, i32 1, i32 -1
ret i32 %8
}
/* Variables and functions */
scalar_t__ atanh(double);
int /*<<< orphan*/ link_failure_atanh();
void test_atanh(double d) {
  if (atanh(d) != atanh(d))
    link_failure_atanh();
}


x86 assembly (clang, -O0):
<test_atanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <atanh@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <atanh@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_atanh+0x3c>
mov    $0x0,%al
call   1040 <link_failure_atanh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_atanh>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <atanh@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <atanh@plt>
cmp    %rax,%rbx
jne    1149 <test_atanh+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_atanh@plt>

LLVM IR (-O0):
define void @test_atanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @atanh(double %3)
%5 = load double, double* %2
%6 = call i64 @atanh(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_atanh()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_atanh(double %0) {
%2 = tail call i64 @atanh(double %0)
%3 = tail call i64 @atanh(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_atanh()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned int SyncGetThreadId() { return (unsigned int)pthread_self(); }


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

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

LLVM IR (-O0):
define i32 @SyncGetThreadId() {
%1 = call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @SyncGetThreadId() {
%1 = tail call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int mblen(const char *mbstr, size_t count) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @mblen(i8* nocapture readnone %0, i64 %1) {
ret i32 1
}
/* Variables and functions */
int b(void *);
int a(void *arg) { return b(arg) - 1; }


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

x86 assembly (clang, -O2):
<a>:
push   %rax
call   1030 <b@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @a(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @b(i8* %3)
%5 = sub nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @a(i8* %0) {
%2 = tail call i32 @b(i8* %0)
%3 = add nsw i32 %2, -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ O_NONBLOCK;
int /*<<< orphan*/ STDIN_FILENO;
scalar_t__ fcntl(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int prepare_getch();
int prepare_getch_nb(void) {
  int rc;
  rc = prepare_getch();
  if (fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK) != 0)
    rc = -1;
  return rc;
}


x86 assembly (clang, -O0):
<prepare_getch_nb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <prepare_getch@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0x0,%rax
je     1163 <prepare_getch_nb+0x43>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepare_getch_nb>:
push   %rbx
xor    %eax,%eax
call   1040 <prepare_getch@plt>
mov    %eax,%ebx
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
neg    %rax
sbb    %eax,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @prepare_getch_nb() {
%1 = alloca i32
%2 = call i32 (...) @prepare_getch()
store i32 %2, i32* %1
%3 = load i32, i32* @STDIN_FILENO
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = call i64 @fcntl(i32 %3, i32 %4, i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 -1, i32* %1
br label %9
9: ; preds = %8, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @prepare_getch_nb() {
%1 = tail call i32 (...) @prepare_getch()
%2 = load i32, i32* @STDIN_FILENO
%3 = load i32, i32* @F_SETFL
%4 = load i32, i32* @O_NONBLOCK
%5 = tail call i64 @fcntl(i32 %2, i32 %3, i32 %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 %1, i32 -1
ret i32 %7
}
/* Type definitions */
struct resource {
  int dummy;
};
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int resource_alignment(struct resource *);
__attribute__((always_)) int pci_resource_alignment(struct pci_dev *dev,
                                                    struct resource *res) {
  return resource_alignment(res);
}


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

x86 assembly (clang, -O2):
<pci_resource_alignment>:
mov    %rsi,%rdi
jmp    1030 <resource_alignment@plt>

LLVM IR (-O0):
%struct.pci_dev = type { i32 }
%struct.resource = type { i32 }
define i32 @pci_resource_alignment(%struct.pci_dev* %0, %struct.resource* %1) {
%3 = alloca %struct.pci_dev*
%4 = alloca %struct.resource*
store %struct.pci_dev* %0, %struct.pci_dev** %3
store %struct.resource* %1, %struct.resource** %4
%5 = load %struct.resource*, %struct.resource** %4
%6 = call i32 @resource_alignment(%struct.resource* %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
%struct.resource = type { i32 }
define i32 @pci_resource_alignment(%struct.pci_dev* nocapture readnone %0, %struct.resource* %1) {
%3 = tail call i32 @resource_alignment(%struct.resource* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ v4l2StopStreaming(void *);
int /*<<< orphan*/ v4l2UnmapBuf(void *);
int StopCamera(void *v4l2ctx) {
  ((void)0);
  v4l2StopStreaming(v4l2ctx);
  v4l2UnmapBuf(v4l2ctx);
  return 0;
}


x86 assembly (clang, -O0):
<StopCamera>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <v4l2StopStreaming@plt>
mov    -0x8(%rbp),%rdi
call   1030 <v4l2UnmapBuf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StopCamera>:
push   %rbx
mov    %rdi,%rbx
call   1040 <v4l2StopStreaming@plt>
mov    %rbx,%rdi
call   1030 <v4l2UnmapBuf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @StopCamera(i8* %0) {
%2 = tail call i32 @v4l2StopStreaming(i8* %0)
%3 = tail call i32 @v4l2UnmapBuf(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CompileConstant(int);
void DoMConstant(void) { CompileConstant(52); }


x86 assembly (clang, -O0):
<DoMConstant>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
call   1030 <CompileConstant@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoMConstant>:
mov    $0x34,%edi
jmp    1030 <CompileConstant@plt>

LLVM IR (-O0):
define void @DoMConstant() {
%1 = call i32 @CompileConstant(i32 52)
ret void
}

LLVM IR (-O2):
define void @DoMConstant() {
%1 = tail call i32 @CompileConstant(i32 52)
ret void
}
void test6(void) {
  int n = 20, **a, i = 0;
  (int(**)[i]){&a}[0][1][5] = 0;
}


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
movl   $0x14,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
shl    $0x0,%rcx
movl   $0x0,0x14(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @test6() {
%1 = alloca i32
%2 = alloca i32**
%3 = alloca i32
%4 = alloca i32**
store i32 20, i32* %1
store i32 0, i32* %3
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = bitcast i32*** %2 to i32**
store i32** %7, i32*** %4
%8 = load i32**, i32*** %4
%9 = getelementptr inbounds i32*, i32** %8, i64 0
%10 = load i32*, i32** %9
%11 = mul nsw i64 1, %6
%12 = getelementptr inbounds i32, i32* %10, i64 %11
%13 = getelementptr inbounds i32, i32* %12, i64 5
store i32 0, i32* %13
ret void
}

LLVM IR (-O2):
void av_spherical_tile_bounds() {}


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

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

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

LLVM IR (-O2):
define void @av_spherical_tile_bounds() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int tr_leaf_usage() {
  fprintf(stderr, "Usage: treebest leaf <nh_tree>\n");
  return 1;
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: treebest leaf <nh_tree>\0A\00"
define i32 @tr_leaf_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: treebest leaf <nh_tree>\0A\00"
define i32 @tr_leaf_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
void sspm_default_free_part(void *part) {}


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

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

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

LLVM IR (-O2):
define void @sspm_default_free_part(i8* nocapture %0) {
ret void
}
void *arrayToPointer(void *arr) { return arr; }


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

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

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

LLVM IR (-O2):
define i8* @arrayToPointer(i8* readnone returned %0) {
ret i8* %0
}
int test_imm_2Buint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x2B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Buint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x2b,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Buint64_midword_mem>:
testb  $0x2b,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Buint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2818048
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int link(const char *oldname __attribute__((unused)),
         const char *newname __attribute__((unused))) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void *shmalloc(size_t size) { printf("\nOpenSHMEM Analyzer\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define noalias i8* @shmalloc(i64 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i8* undef
}
int lemon_type_cmp(struct lemon *lemon, void *a, void *b) { return a == b; }


x86 assembly (clang, -O0):
<lemon_type_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lemon_type_cmp>:
xor    %eax,%eax
cmp    %rdx,%rsi
sete   %al
ret

LLVM IR (-O0):
%struct.lemon = type opaque
define i32 @lemon_type_cmp(%struct.lemon* %0, i8* %1, i8* %2) {
%4 = alloca %struct.lemon*
%5 = alloca i8*
%6 = alloca i8*
store %struct.lemon* %0, %struct.lemon** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = icmp eq i8* %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.lemon = type opaque
define i32 @lemon_type_cmp(%struct.lemon* nocapture readnone %0, i8* readnone %1, i8* readnone %2) {
%4 = icmp eq i8* %1, %2
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
int /*<<< orphan*/ scanf(char *, float *);
float sqrt(float);
int main() {
  float number, result;
  scanf("%f", &number);
  result = sqrt(number);
  printf("The radical number of %f is :%3f\n", number, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1050 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1159 <main+0x29>
xorps  %xmm1,%xmm1
sqrtss %xmm0,%xmm1
jmp    1161 <main+0x31>
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [34 x i8] c"The radical number of %f is :%3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = call float @sqrt(float %5)
store float %6, float* %3
%7 = load float, float* %2
%8 = load float, float* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), float %7, float %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [34 x i8] c"The radical number of %f is :%3f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call float @sqrt(float %4)
%6 = load float, float* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), float %6, float %5)
ret i32 0
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, unsigned int, int);
int gpio_write(int pi, unsigned gpio, unsigned level) {
  return pigpio_command(pi, 4, gpio, level, 1);
}


x86 assembly (clang, -O0):
<gpio_write>:
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),%edx
mov    -0xc(%rbp),%ecx
mov    $0x4,%esi
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_write>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x4,%esi
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @gpio_write(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 @pigpio_command(i32 %7, i32 4, i32 %8, i32 %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @gpio_write(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pigpio_command(i32 %0, i32 4, i32 %1, i32 %2, i32 1)
ret i32 %4
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int sendto(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int);
int send_packet(int fd, char *buffer, int size, struct sockaddr *addr,
                int slen) {
  return sendto(fd, buffer, size, 0, addr, slen);
}


x86 assembly (clang, -O0):
<send_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
xor    %ecx,%ecx
call   1030 <sendto@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_packet>:
mov    %r8d,%r9d
mov    %rcx,%r8
xor    %ecx,%ecx
jmp    1030 <sendto@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @send_packet(i32 %0, i8* %1, i32 %2, %struct.sockaddr* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca %struct.sockaddr*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store %struct.sockaddr* %3, %struct.sockaddr** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load %struct.sockaddr*, %struct.sockaddr** %9
%15 = load i32, i32* %10
%16 = call i32 @sendto(i32 %11, i8* %12, i32 %13, i32 0, %struct.sockaddr* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @send_packet(i32 %0, i8* %1, i32 %2, %struct.sockaddr* %3, i32 %4) {
%6 = tail call i32 @sendto(i32 %0, i8* %1, i32 %2, i32 0, %struct.sockaddr* %3, i32 %4)
ret i32 %6
}
int profile() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @profile() {
ret i32 0
}
int ShrTest16(int X, unsigned C1, unsigned C2) { return (X >> C1) << C2; }


x86 assembly (clang, -O0):
<ShrTest16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShrTest16>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
mov    %edx,%ecx
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ShrTest16(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 = ashr i32 %7, %8
%10 = load i32, i32* %6
%11 = shl i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @ShrTest16(i32 %0, i32 %1, i32 %2) {
%4 = ashr i32 %0, %1
%5 = shl i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *x = malloc(size);
  if (!x)
    abort();
  return x;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <xmalloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
int g_is_higher_d(double s, double d) {
  if (s > d) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<g_is_higher_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112a <g_is_higher_d+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1131 <g_is_higher_d+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_is_higher_d>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @g_is_higher_d(double %0, double %1) {
%3 = fcmp ule double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo1();
int /*<<< orphan*/ pr_info(char *);
int so2_dumpstack_init(void) {
  pr_info("dumpstack_init\n");
  foo1();
  return 0;
}


x86 assembly (clang, -O0):
<so2_dumpstack_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <pr_info@plt>
mov    $0x0,%al
call   1040 <foo1@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<so2_dumpstack_init>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <pr_info@plt>
xor    %eax,%eax
call   1040 <foo1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"dumpstack_init\0A\00"
define i32 @so2_dumpstack_init() {
%1 = call i32 @pr_info(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @foo1()
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"dumpstack_init\0A\00"
define i32 @so2_dumpstack_init() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @foo1()
ret i32 0
}