xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int, int,
                           int);
int /*<<< orphan*/ stderr;
void assert_equal_int(int actual, int expected, const char *file, int line) {
  if (expected != actual) {
    fprintf(stderr, "%s:%d expected %d, got %d\n", file, line, expected,
            actual);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<assert_equal_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     116f <assert_equal_int+0x4f>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0x4(%rbp),%r9d
lea    0xea0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_equal_int>:
cmp    %edi,%esi
jne    1125 <assert_equal_int+0x5>
ret
push   %rax
mov    %esi,%r8d
mov    %edi,%r9d
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"%s:%d expected %d, got %d\0A\00"
define void @assert_equal_int(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, %0
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i32 %1, i32 %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main(void) {
  putchar('h');
  putchar('i');
  putchar('!');
  putchar('\n');
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x68,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @putchar(i8 signext 104)
%3 = call i32 @putchar(i8 signext 105)
%4 = call i32 @putchar(i8 signext 33)
%5 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 104)
%2 = tail call i32 @putchar(i8 signext 105)
%3 = tail call i32 @putchar(i8 signext 33)
%4 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
long double exp(long double);
long double log(long double);
long double powl(long double x, long double y) { return exp(y * log(x)); }


x86 assembly (clang, -O0):
<powl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fstpt  -0x2c(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <log@plt>
fldt   -0x2c(%rbp)
fmulp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <exp@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powl>:
sub    $0x28,%rsp
fldt   0x40(%rsp)
fstpt  0x1c(%rsp)
fldt   0x30(%rsp)
fstpt  (%rsp)
call   1040 <log@plt>
fldt   0x1c(%rsp)
fmulp  %st,%st(1)
fstpt  (%rsp)
call   1030 <exp@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %4
%6 = load x86_fp80, x86_fp80* %3
%7 = call x86_fp80 @log(x86_fp80 %6)
%8 = fmul x86_fp80 %5, %7
%9 = call x86_fp80 @exp(x86_fp80 %8)
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @log(x86_fp80 %0)
%4 = fmul x86_fp80 %3, %1
%5 = tail call x86_fp80 @exp(x86_fp80 %4)
ret x86_fp80 %5
}
void XtVaCreatePopupShell() {}


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

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

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

LLVM IR (-O2):
define void @XtVaCreatePopupShell() {
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t shift_byte(int32_t lsb, int32_t mlsb, int32_t mmsb, int32_t msb) {
  int32_t tmp = 0;
  tmp = lsb;
  tmp |= mlsb << 8;
  tmp |= mmsb << 16;
  tmp |= msb << 24;
  return tmp;
}


x86 assembly (clang, -O0):
<shift_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x18,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_byte>:
mov    %ecx,%eax
shl    $0x8,%esi
or     %edi,%esi
shl    $0x10,%edx
shl    $0x18,%eax
or     %edx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @shift_byte(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %5
store i32 %10, i32* %9
%11 = load i32, i32* %6
%12 = shl i32 %11, 8
%13 = load i32, i32* %9
%14 = or i32 %13, %12
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = shl i32 %15, 16
%17 = load i32, i32* %9
%18 = or i32 %17, %16
store i32 %18, i32* %9
%19 = load i32, i32* %8
%20 = shl i32 %19, 24
%21 = load i32, i32* %9
%22 = or i32 %21, %20
store i32 %22, i32* %9
%23 = load i32, i32* %9
ret i32 %23
}

LLVM IR (-O2):
define i32 @shift_byte(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %1, 8
%6 = or i32 %5, %0
%7 = shl i32 %2, 16
%8 = or i32 %6, %7
%9 = shl i32 %3, 24
%10 = or i32 %8, %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int mvwaddnstr(int /*<<< orphan*/ *, int, int, char *, int);
int /*<<< orphan*/ vsnprintf(char *, int, char const *, int /*<<< orphan*/);
int vw_printw(WINDOW *win, const char *fmt, va_list varglist) {
  char buf[800];
  vsnprintf(buf, 800, fmt, varglist);
  return mvwaddnstr(win, -1, -1, buf, -1);
}


x86 assembly (clang, -O0):
<vw_printw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x340(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x320,%esi
call   1030 <vsnprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x340(%rbp),%rcx
mov    $0xffffffff,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
call   1040 <mvwaddnstr@plt>
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vw_printw>:
push   %r14
push   %rbx
sub    $0x328,%rsp
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x320,%esi
call   1030 <vsnprintf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
mov    %r14,%rcx
mov    $0xffffffff,%r8d
call   1040 <mvwaddnstr@plt>
add    $0x328,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @vw_printw(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [800 x i8]
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [800 x i8], [800 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @vsnprintf(i8* %8, i32 800, i8* %9, i32 %10)
%12 = load i32*, i32** %4
%13 = getelementptr inbounds [800 x i8], [800 x i8]* %7, i64 0, i64 0
%14 = call i32 @mvwaddnstr(i32* %12, i32 -1, i32 -1, i8* %13, i32 -1)
ret i32 %14
}

LLVM IR (-O2):
define i32 @vw_printw(i32* %0, i8* nocapture %1, i32 %2) {
%4 = alloca [800 x i8]
%5 = getelementptr inbounds [800 x i8], [800 x i8]* %4, i64 0, i64 0
%6 = call i32 @vsnprintf(i8* %5, i32 800, i8* %1, i32 %2)
%7 = call i32 @mvwaddnstr(i32* %0, i32 -1, i32 -1, i8* %5, i32 -1)
ret i32 %7
}
void ptrace_sandbox_permit_alarm(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_alarm(%struct.pt_sandbox* nocapture %0) {
ret void
}
int reset_int(char *opt, char *optarg, void *arg) {
  *((int *)arg) = 0;
  return 0;
}


x86 assembly (clang, -O0):
<reset_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_int>:
movl   $0x0,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @reset_int(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = bitcast i8* %7 to i32*
store i32 0, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @reset_int(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %2 to i32*
store i32 0, i32* %4
ret i32 0
}
/* Type definitions */
struct hdr_histogram {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ counts_get_normalised(struct hdr_histogram *,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ counts_index(struct hdr_histogram *, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int64_t get_count_at_index(struct hdr_histogram *h, int32_t bucket_index,
                           int32_t sub_bucket_index) {
  return counts_get_normalised(h,
                               counts_index(h, bucket_index, sub_bucket_index));
}


x86 assembly (clang, -O0):
<get_count_at_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <counts_index@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <counts_get_normalised@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.hdr_histogram = type { i32 }
define i32 @get_count_at_index(%struct.hdr_histogram* %0, i32 %1, i32 %2) {
%4 = alloca %struct.hdr_histogram*
%5 = alloca i32
%6 = alloca i32
store %struct.hdr_histogram* %0, %struct.hdr_histogram** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.hdr_histogram*, %struct.hdr_histogram** %4
%8 = load %struct.hdr_histogram*, %struct.hdr_histogram** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @counts_index(%struct.hdr_histogram* %8, i32 %9, i32 %10)
%12 = call i32 @counts_get_normalised(%struct.hdr_histogram* %7, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.hdr_histogram = type { i32 }
define i32 @get_count_at_index(%struct.hdr_histogram* %0, i32 %1, i32 %2) {
%4 = tail call i32 @counts_index(%struct.hdr_histogram* %0, i32 %1, i32 %2)
%5 = tail call i32 @counts_get_normalised(%struct.hdr_histogram* %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ biscHighByte(int);
int /*<<< orphan*/ biscLowByte(int);
int biscSendByte(int /*<<< orphan*/);
int biscSendInt(int num) {
  if (biscSendByte(biscHighByte(num)) == -1)
    return -1;
  if (biscSendByte(biscLowByte(num)) == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<biscSendInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <biscHighByte@plt>
mov    %eax,%edi
call   1040 <biscSendByte@plt>
cmp    $0xffffffff,%eax
jne    115f <biscSendInt+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <biscSendInt+0x5a>
mov    -0x8(%rbp),%edi
call   1030 <biscLowByte@plt>
mov    %eax,%edi
call   1040 <biscSendByte@plt>
cmp    $0xffffffff,%eax
jne    1183 <biscSendInt+0x53>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <biscSendInt+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<biscSendInt>:
push   %rbx
mov    %edi,%ebx
call   1050 <biscHighByte@plt>
mov    %eax,%edi
call   1040 <biscSendByte@plt>
cmp    $0xffffffff,%eax
je     1160 <biscSendInt+0x30>
mov    %ebx,%edi
call   1030 <biscLowByte@plt>
mov    %eax,%edi
call   1040 <biscSendByte@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @biscSendInt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @biscHighByte(i32 %4)
%6 = call i32 @biscSendByte(i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %16
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @biscLowByte(i32 %10)
%12 = call i32 @biscSendByte(i32 %11)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 -1, i32* %2
br label %16
15: ; preds = %9
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @biscSendInt(i32 %0) {
%2 = tail call i32 @biscHighByte(i32 %0)
%3 = tail call i32 @biscSendByte(i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = tail call i32 @biscLowByte(i32 %0)
%7 = tail call i32 @biscSendByte(i32 %6)
%8 = icmp eq i32 %7, -1
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ -1, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ SetFont104();
void setfont() { SetFont104(); }


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

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

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

LLVM IR (-O2):
define void @setfont() {
%1 = tail call i32 (...) @SetFont104()
ret void
}
/* Variables and functions */
int snowflakes(int *, int);
int snowflakes_brute(int *, int);
int test_valley() {
  int array[] = {5, 4, 3, 2, 1, 0, 1, 2, 3, 4};
  return 16 == snowflakes_brute(array, 10) && 16 == snowflakes(array, 10);
}


x86 assembly (clang, -O0):
<test_valley>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <snowflakes_brute@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x10,%ecx
cmp    %edx,%ecx
mov    %al,-0x31(%rbp)
jne    118c <test_valley+0x5c>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <snowflakes@plt>
mov    %eax,%ecx
mov    $0x10,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_valley>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <snowflakes_brute@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x10,%ecx
jne    1174 <test_valley+0x54>
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <snowflakes@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x10,%ecx
sete   %al
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_valley.array = [10 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1, i32 0, i32 1, i32 2, i32 3, i32 4]
define i32 @test_valley() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @snowflakes_brute(i32* %3, i32 10)
%5 = icmp eq i32 16, %4
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = call i32 @snowflakes(i32* %7, i32 10)
%9 = icmp eq i32 16, %8
br label %10
10: ; preds = %6, %0
%11 = phi i1 [ false, %0 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@__const.test_valley.array = [10 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1, i32 0, i32 1, i32 2, i32 3, i32 4]
define i32 @test_valley() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @snowflakes_brute(i32* %3, i32 10)
%5 = icmp eq i32 %4, 16
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @snowflakes(i32* %3, i32 10)
%8 = icmp eq i32 %7, 16
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %0
%11 = phi i32 [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void OutStr(char *str, char *Color) {
  printf("<font color=#%s>%s</font>", Color, str);
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"<font color=#%s>%s</font>\00"
define void @OutStr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"<font color=#%s>%s</font>\00"
define void @OutStr(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
ret void
}
/* Variables and functions */
void UI_Shutdown(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __chk_fail();
int /*<<< orphan*/ readlinkat(int, char const *, void *, size_t);
ssize_t __readlinkat_chk(int fd, const char *path, void *buf, size_t len,
                         size_t buflen) {
  if (len > buflen)
    __chk_fail();
  return readlinkat(fd, path, buf, len);
}


x86 assembly (clang, -O0):
<__readlinkat_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jbe    1150 <__readlinkat_chk+0x30>
mov    $0x0,%al
call   1030 <__chk_fail@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <readlinkat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__readlinkat_chk>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebp
cmp    %r8,%rcx
jbe    113e <__readlinkat_chk+0x1e>
xor    %eax,%eax
call   1030 <__chk_fail@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <readlinkat@plt>

LLVM IR (-O0):
define i32 @__readlinkat_chk(i32 %0, i8* %1, i8* %2, i64 %3, i64 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i64, i64* %9
%12 = load i64, i64* %10
%13 = icmp ugt i64 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %5
%15 = call i32 (...) @__chk_fail()
br label %16
16: ; preds = %14, %5
%17 = load i32, i32* %6
%18 = load i8*, i8** %7
%19 = load i8*, i8** %8
%20 = load i64, i64* %9
%21 = call i32 @readlinkat(i32 %17, i8* %18, i8* %19, i64 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @__readlinkat_chk(i32 %0, i8* %1, i8* %2, i64 %3, i64 %4) {
%6 = icmp ugt i64 %3, %4
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 (...) @__chk_fail()
br label %9
9: ; preds = %7, %5
%10 = tail call i32 @readlinkat(i32 %0, i8* %1, i8* %2, i64 %3)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Carrier_test(unsigned int);
void un_test(unsigned int seed) { Carrier_test(seed); }


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

x86 assembly (clang, -O2):
<un_test>:
jmp    1030 <Carrier_test@plt>

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

LLVM IR (-O2):
define void @un_test(i32 %0) {
%2 = tail call i32 @Carrier_test(i32 %0)
ret void
}
int getDistanceSquared(int x1, int y1, int x2, int y2) {
  return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
}


x86 assembly (clang, -O0):
<getDistanceSquared>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x4(%rbp),%ecx
imul   %ecx,%eax
mov    -0x10(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%edx
sub    -0x8(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDistanceSquared>:
sub    %edi,%edx
imul   %edx,%edx
sub    %esi,%ecx
imul   %ecx,%ecx
lea    (%rcx,%rdx,1),%eax
ret

LLVM IR (-O0):
define i32 @getDistanceSquared(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = load i32, i32* %8
%17 = load i32, i32* %6
%18 = sub nsw i32 %16, %17
%19 = load i32, i32* %8
%20 = load i32, i32* %6
%21 = sub nsw i32 %19, %20
%22 = mul nsw i32 %18, %21
%23 = add nsw i32 %15, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @getDistanceSquared(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %2, %0
%6 = mul nsw i32 %5, %5
%7 = sub nsw i32 %3, %1
%8 = mul nsw i32 %7, %7
%9 = add nuw nsw i32 %8, %6
ret i32 %9
}
/* Variables and functions */
int getNum(int *, char *);
int getBoolean(int *ptr, char *tok) {
  int i;
  int rc;
  if ((rc = getNum(&i, tok)))
    return rc;
  if (i == 0 || i == 1)
    *ptr = i;
  else
    return 11;
  return 0;
}


x86 assembly (clang, -O0):
<getBoolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdi
call   1030 <getNum@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
je     1144 <getBoolean+0x34>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1179 <getBoolean+0x69>
cmpl   $0x0,-0x1c(%rbp)
je     1158 <getBoolean+0x48>
cmpl   $0x1,-0x1c(%rbp)
jne    1166 <getBoolean+0x56>
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1172 <getBoolean+0x62>
movl   $0xb,-0x4(%rbp)
jmp    1179 <getBoolean+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBoolean>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
call   1030 <getNum@plt>
test   %eax,%eax
jne    1138 <getBoolean+0x28>
mov    0xc(%rsp),%ecx
mov    $0xb,%eax
cmp    $0x1,%ecx
ja     1138 <getBoolean+0x28>
mov    %ecx,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getBoolean(i32* nocapture writeonly %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @getNum(i32* %3, i8* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp ult i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 %8, i32* %0
br label %11
11: ; preds = %7, %2, %10
%12 = phi i32 [ 0, %10 ], [ %5, %2 ], [ 11, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main_main() {
  int c = 14;
  int res = 65 - 10 + c;
  printf("x = %d\n", res);
}


x86 assembly (clang, -O0):
<main_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x37,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_main>:
lea    0xee9(%rip),%rdi
mov    $0x45,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"x = %d\0A\00"
define void @main_main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 69)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS)
    stream = stdout;
  fprintf(stream, "Usage: %s <n>\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [15 x i8] c"Usage: %s <n>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
unsigned int CalculateLog2Max256(unsigned int);
unsigned int CalculateBitsNeededMax256(unsigned int n) {
  unsigned int shift = CalculateLog2Max256(n);
  shift += ((1 << shift) - n) >> 31;
  return shift;
}


x86 assembly (clang, -O0):
<CalculateBitsNeededMax256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <CalculateLog2Max256@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    -0x4(%rbp),%eax
shr    $0x1f,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateBitsNeededMax256>:
push   %rbx
mov    %edi,%ebx
call   1030 <CalculateLog2Max256@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
sub    %ebx,%edx
shr    $0x1f,%edx
add    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CalculateBitsNeededMax256(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @CalculateLog2Max256(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 1, %6
%8 = load i32, i32* %2
%9 = sub i32 %7, %8
%10 = lshr i32 %9, 31
%11 = load i32, i32* %3
%12 = add i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @CalculateBitsNeededMax256(i32 %0) {
%2 = tail call i32 @CalculateLog2Max256(i32 %0)
%3 = shl nuw i32 1, %2
%4 = sub i32 %3, %0
%5 = lshr i32 %4, 31
%6 = add i32 %5, %2
ret i32 %6
}
void gdk_window_is_visible() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_is_visible() {
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int save_strcmp(const char *s1, const char *s2) {
  if ((!s1) && (!s2))
    return (0);
  if ((!s1) || (!s2))
    return (-1);
  return (strcmp(s1, s2));
}


x86 assembly (clang, -O0):
<save_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <save_strcmp+0x32>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <save_strcmp+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1174 <save_strcmp+0x64>
cmpq   $0x0,-0x10(%rbp)
je     1158 <save_strcmp+0x48>
cmpq   $0x0,-0x18(%rbp)
jne    1164 <save_strcmp+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <save_strcmp+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_strcmp>:
xor    %eax,%eax
mov    %rdi,%rcx
or     %rsi,%rcx
je     112e <save_strcmp+0x1e>
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     112e <save_strcmp+0x1e>
test   %rsi,%rsi
je     112e <save_strcmp+0x1e>
jmp    1030 <strcmp@plt>
ret

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

LLVM IR (-O2):
define i32 @save_strcmp(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = and i1 %3, %4
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %10
10: ; preds = %6, %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ], [ -1, %6 ]
ret i32 %11
}
char *make_version_name(file, version)
char *file;
int version;
{
  char *backup_name;
  backup_name = malloc(strlen(file) + 16);
  if (backup_name == 0)
    return 0;
  sprintf(backup_name, "%s.~%d~", file, version);
  return backup_name;
}


x86 assembly (clang, -O0):
<make_version_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x10,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1170 <make_version_name+0x40>
movq   $0x0,-0x8(%rbp)
jmp    1191 <make_version_name+0x61>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xe7e(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_version_name>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x10(%rax),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbp
test   %rax,%rax
je     1167 <make_version_name+0x37>
lea    0xea9(%rip),%rsi
mov    %rbp,%rdi
mov    %rbx,%rdx
mov    %r14d,%ecx
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s.~%d~\00"
define noalias i8* @make_version_name(i8* %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add i64 %3, 16
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
br label %9
9: ; preds = %2, %7
ret i8* %5
}
/* Type definitions */
struct yaffs_dev {
  int dummy;
};

/* Variables and functions */
int yaffs_inodecount_common(struct yaffs_dev *, int /*<<< orphan*/);
int yaffs_inodecount_reldev(struct yaffs_dev *dev) {
  return yaffs_inodecount_common(dev, (0));
}


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

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

LLVM IR (-O0):
%struct.yaffs_dev = type { i32 }
define i32 @yaffs_inodecount_reldev(%struct.yaffs_dev* %0) {
%2 = alloca %struct.yaffs_dev*
store %struct.yaffs_dev* %0, %struct.yaffs_dev** %2
%3 = load %struct.yaffs_dev*, %struct.yaffs_dev** %2
%4 = call i32 @yaffs_inodecount_common(%struct.yaffs_dev* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.yaffs_dev = type { i32 }
define i32 @yaffs_inodecount_reldev(%struct.yaffs_dev* %0) {
%2 = tail call i32 @yaffs_inodecount_common(%struct.yaffs_dev* %0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ PEM_write_X509(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int abac_write_id_to_fp(X509 *cert, FILE *fp) {
  assert(cert);
  if (!PEM_write_X509(fp, cert)) {
    ERR_print_errors_fp(stderr);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<abac_write_id_to_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <PEM_write_X509@plt>
cmp    $0x0,%eax
jne    1179 <abac_write_id_to_fp+0x49>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <ERR_print_errors_fp@plt>
movl   $0x1,-0x4(%rbp)
jmp    1180 <abac_write_id_to_fp+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abac_write_id_to_fp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <PEM_write_X509@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jne    1165 <abac_write_id_to_fp+0x35>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <ERR_print_errors_fp@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
define i32 @abac_write_id_to_fp(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
%6 = load i32*, i32** %4
%7 = call i32 @assert(i32* %6)
%8 = load i32*, i32** %5
%9 = load i32*, i32** %4
%10 = call i32 @PEM_write_X509(i32* %8, i32* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @ERR_print_errors_fp(i32 %13)
store i32 1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @abac_write_id_to_fp(i32* %0, i32* %1) {
%3 = tail call i32 @assert(i32* %0)
%4 = tail call i32 @PEM_write_X509(i32* %1, i32* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @ERR_print_errors_fp(i32 %7)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %10
}
int ld_lt_mr1(long double *a1, long double a2) { return (((*a1) < (a2))); }


x86 assembly (clang, -O0):
<ld_lt_mr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_lt_mr1>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @ld_lt_mr1(x86_fp80* %0, x86_fp80 %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp olt x86_fp80 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_lt_mr1(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp olt x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
void cvmx_ipd_free_ptr(void) {}


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

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

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

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


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

x86 assembly (clang, -O2):
<xrop3_127_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_127_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = xor i32 %4, -1
ret i32 %5
}
void swap_in_place(int *A, int *B) {
  *A = *A ^ *B;
  *B = *A ^ *B;
  *A = *A ^ *B;
}


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

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

LLVM IR (-O0):
define void @swap_in_place(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = xor i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = xor i32 %12, %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = xor i32 %18, %20
%22 = load i32*, i32** %3
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @swap_in_place(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = xor i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = xor i32 %8, %7
store i32 %9, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ tx;
struct timex {
  int tai;
};

/* Variables and functions */
int /*<<< orphan*/ adjtimex(struct timex *);
int /*<<< orphan*/ memset(struct timex *, int /*<<< orphan*/, int);
int get_tai(void) {
  struct timex tx;
  memset(&tx, 0, sizeof(tx));
  adjtimex(&tx);
  return tx.tai;
}


x86 assembly (clang, -O0):
<get_tai>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x8(%rbp),%rdi
call   1040 <adjtimex@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tai>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
call   1040 <adjtimex@plt>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timex = type { i32 }
define i32 @get_tai() {
%1 = alloca %struct.timex
%2 = call i32 @memset(%struct.timex* %1, i32 0, i32 4)
%3 = call i32 @adjtimex(%struct.timex* %1)
%4 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.timex = type { i32 }
define i32 @get_tai() {
%1 = alloca %struct.timex
%2 = bitcast %struct.timex* %1 to i8*
%3 = call i32 @memset(%struct.timex* %1, i32 0, i32 4)
%4 = call i32 @adjtimex(%struct.timex* %1)
%5 = getelementptr inbounds %struct.timex, %struct.timex* %1, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ss2sas(int);
void ss2sas_(int *startstop) { ss2sas(*startstop); }


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

x86 assembly (clang, -O2):
<ss2sas_>:
mov    (%rdi),%edi
jmp    1030 <ss2sas@plt>

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

LLVM IR (-O2):
define void @ss2sas_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @ss2sas(i32 %2)
ret void
}