xunge/DecIR huggingface dataset:
double log2(double x) {
  __asm("fld1 ; fxch ; fyl2x" : "+t"(x));
  return x;
}


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
fldl   -0x10(%rbp)
fld1
fxch   %st(1)
fyl2x
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fld1
fxch   %st(1)
fyl2x
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double asm "fld1 ; fxch ; fyl2x", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %3)
store double %4, double* %2
%5 = load double, double* %2
ret double %5
}

LLVM IR (-O2):
define double @log2(double %0) {
%2 = tail call double asm "fld1 ; fxch ; fyl2x", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ dly_tsk(int);
int /*<<< orphan*/ rct_set_usb_ana_on();
void _init_usb_pll(void) {
  rct_set_usb_ana_on();
  dly_tsk(1);
}


x86 assembly (clang, -O0):
<_init_usb_pll>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <rct_set_usb_ana_on@plt>
mov    $0x1,%edi
call   1030 <dly_tsk@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_init_usb_pll>:
push   %rax
xor    %eax,%eax
call   1040 <rct_set_usb_ana_on@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <dly_tsk@plt>

LLVM IR (-O0):
define void @_init_usb_pll() {
%1 = call i32 (...) @rct_set_usb_ana_on()
%2 = call i32 @dly_tsk(i32 1)
ret void
}

LLVM IR (-O2):
define void @_init_usb_pll() {
%1 = tail call i32 (...) @rct_set_usb_ana_on()
%2 = tail call i32 @dly_tsk(i32 1)
ret void
}
/* Type definitions */
struct ctrl_command {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_error(char *);
void cmd_start_zip_in(struct ctrl_command *cmd) {
  send_error("can't start decompression - no libz support!");
}


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

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

LLVM IR (-O0):
%struct.ctrl_command = type { i32 }
@.str = [45 x i8] c"can't start decompression - no libz support!\00"
define void @cmd_start_zip_in(%struct.ctrl_command* %0) {
%2 = alloca %struct.ctrl_command*
store %struct.ctrl_command* %0, %struct.ctrl_command** %2
%3 = call i32 @send_error(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ctrl_command = type { i32 }
@.str = [45 x i8] c"can't start decompression - no libz support!\00"
define void @cmd_start_zip_in(%struct.ctrl_command* nocapture readnone %0) {
%2 = tail call i32 @send_error(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}
void test_list_destroy() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpnle_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpnle_pd(__m128d __a, __m128d __b) {
  return _mm_cmpnle_pd(__a, __b);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpnle_pd>:
jmp    1030 <_mm_cmpnle_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpnle_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpnle_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long event;
};
struct TYPE_4__ {
  TYPE_1__ xreparent;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xreparent_event(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xreparent.event = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xreparent_event(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xreparent_event(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int zeroIfNegative(int x) { return x >= 0 ? x : 0; }


x86 assembly (clang, -O0):
<zeroIfNegative>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111c <zeroIfNegative+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <zeroIfNegative+0x26>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <zeroIfNegative+0x26>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroIfNegative>:
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @zeroIfNegative(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
gen_ret() { output_line("ret"); }


x86 assembly (clang, -O0):
<gen_ret>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <output_line@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"ret\00"
define i32 @gen_ret() {
%1 = alloca i32
%2 = call i32 @output_line(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [4 x i8] c"ret\00"
define i32 @gen_ret() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int fun1308() { return 1308; }


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

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

LLVM IR (-O0):
define i32 @fun1308() {
ret i32 1308
}

LLVM IR (-O2):
define i32 @fun1308() {
ret i32 1308
}
/* Type definitions */
typedef int /*<<< orphan*/ XmbTextItem;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XmbTextItem(void) {
  XmbTextItem *_p = (XmbTextItem *)malloc(sizeof(XmbTextItem));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XmbTextItem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XmbTextItem+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XmbTextItem>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XmbTextItem+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i8* @alloc_XmbTextItem() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
void account_cpu_user_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @account_cpu_user_exit() {
ret void
}
void random_rd_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @random_rd_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sk_close(int, int);
int srv_close(int sock, int ssl) {
  sk_close(sock, ssl);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @srv_close(i32 %0, i32 %1) {
%3 = tail call i32 @sk_close(i32 %0, i32 %1)
ret i32 0
}
int f1() { return 4; }


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

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

LLVM IR (-O0):
define i32 @f1() {
ret i32 4
}

LLVM IR (-O2):
define i32 @f1() {
ret i32 4
}
int _increasing_float(const void *a, const void *b) {
  if ((*(float *)b) > (*(float *)a))
    return (-1);
  else if ((*(float *)b) < (*(float *)a))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<_increasing_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    112d <_increasing_float+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <_increasing_float+0x5e>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1152 <_increasing_float+0x52>
movl   $0x1,-0x4(%rbp)
jmp    115e <_increasing_float+0x5e>
jmp    1157 <_increasing_float+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_increasing_float>:
movss  (%rsi),%xmm0
movss  (%rdi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
ucomiss %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_increasing_float(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** %5
%7 = bitcast i8* %6 to float*
%8 = load float, float* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to float*
%11 = load float, float* %10
%12 = fcmp ogt float %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %25
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = bitcast i8* %15 to float*
%17 = load float, float* %16
%18 = load i8*, i8** %4
%19 = bitcast i8* %18 to float*
%20 = load float, float* %19
%21 = fcmp olt float %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 1, i32* %3
br label %25
23: ; preds = %14
br label %24
24: ; preds = %23
store i32 0, i32* %3
br label %25
25: ; preds = %24, %22, %13
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @_increasing_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to float*
%4 = load float, float* %3
%5 = bitcast i8* %0 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = fcmp olt float %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int istrsenvisx(char *, int /*<<< orphan*/ *, char const *, size_t, int,
                char const *, int /*<<< orphan*/ *);
int strsvisx(char *mbdst, const char *mbsrc, size_t len, int flags,
             const char *mbextra) {
  return istrsenvisx(mbdst, NULL, mbsrc, len, flags, mbextra, NULL);
}


x86 assembly (clang, -O0):
<strsvisx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
xor    %eax,%eax
mov    %eax,%esi
movq   $0x0,(%rsp)
call   1030 <istrsenvisx@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsvisx>:
push   %rax
mov    %r8,%r9
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
movq   $0x0,(%rsp)
xor    %esi,%esi
call   1030 <istrsenvisx@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @strsvisx(i8* %0, i8* %1, i64 %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i32 @istrsenvisx(i8* %11, i32* null, i8* %12, i64 %13, i32 %14, i8* %15, i32* null)
ret i32 %16
}

LLVM IR (-O2):
define i32 @strsvisx(i8* %0, i8* %1, i64 %2, i32 %3, i8* %4) {
%6 = tail call i32 @istrsenvisx(i8* %0, i32* null, i8* %1, i64 %2, i32 %3, i8* %4, i32* null)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _read(int);
int gettid();
int /*<<< orphan*/ printf(char *, int);
void thread_read(void *args) {
  int fd = (int)args;
  printf("%d: START\n", gettid());
  _read(fd);
  printf("%d: END\n", gettid());
}


x86 assembly (clang, -O0):
<thread_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <gettid@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1050 <_read@plt>
mov    $0x0,%al
call   1030 <gettid@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_read>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <gettid@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <_read@plt>
xor    %eax,%eax
call   1030 <gettid@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%d: START\0A\00"
@.str.1 = [9 x i8] c"%d: END\0A\00"
define void @thread_read(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = call i32 (...) @gettid()
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @_read(i32 %8)
%10 = call i32 (...) @gettid()
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d: START\0A\00"
@.str.1 = [9 x i8] c"%d: END\0A\00"
define void @thread_read(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 (...) @gettid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @_read(i32 %3)
%7 = tail call i32 (...) @gettid()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
int errno;
int udp_errno(void *arg) { return errno; }


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

x86 assembly (clang, -O2):
<udp_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @udp_errno(i8* nocapture readnone %0) {
%2 = load i32, i32* @errno
ret i32 %2
}
/* Variables and functions */
char *btshas_ralloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
char *btshas_rstrdup(char *str) {
  char *s1;
  int l;
  l = strlen(str);
  s1 = btshas_ralloc(l + 1);
  memcpy(s1, str, l + 1);
  return (s1);
}


x86 assembly (clang, -O0):
<btshas_rstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <btshas_ralloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btshas_rstrdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <btshas_ralloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @btshas_rstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @btshas_ralloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ move_native_irq(int);
__attribute__((always_)) void move_irq(int irq) { move_native_irq(irq); }


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

x86 assembly (clang, -O2):
<move_irq>:
jmp    1030 <move_native_irq@plt>

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

LLVM IR (-O2):
define void @move_irq(i32 %0) {
%2 = tail call i32 @move_native_irq(i32 %0)
ret void
}
/* Variables and functions */
double sinhf(double);
double sinh(double arg) { return sinhf(arg); }


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

x86 assembly (clang, -O2):
<sinh>:
jmp    1030 <sinhf@plt>

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

LLVM IR (-O2):
define double @sinh(double %0) {
%2 = tail call double @sinhf(double %0)
ret double %2
}
/* Type definitions */
struct char_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_to_char(char *, struct char_data *);
void do_qui(struct char_data *ch, char *argument, int cmd) {
  send_to_char("You have to write quit - no less, to quit!\n\r", ch);
  return;
}


x86 assembly (clang, -O0):
<do_qui>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <send_to_char@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_qui>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <send_to_char@plt>

LLVM IR (-O0):
%struct.char_data = type { i32 }
@.str = [45 x i8] c"You have to write quit - no less, to quit!\0A\0D\00"
define void @do_qui(%struct.char_data* %0, i8* %1, i32 %2) {
%4 = alloca %struct.char_data*
%5 = alloca i8*
%6 = alloca i32
store %struct.char_data* %0, %struct.char_data** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.char_data*, %struct.char_data** %4
%8 = call i32 @send_to_char(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), %struct.char_data* %7)
ret void
}

LLVM IR (-O2):
%struct.char_data = type { i32 }
@.str = [45 x i8] c"You have to write quit - no less, to quit!\0A\0D\00"
define void @do_qui(%struct.char_data* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @send_to_char(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), %struct.char_data* %0)
ret void
}
/* Variables and functions */
double floor(double);
double sidereal(double);
double r_ascension(double jultime) {
  double ra;
  ra = sidereal(jultime);
  ra -= 24.0 * floor(ra / 24.0);
  return (ra / 24.0);
}


x86 assembly (clang, -O0):
<r_ascension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sidereal@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <floor@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xea9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_ascension>:
push   %rax
call   1030 <sidereal@plt>
movsd  %xmm0,(%rsp)
divsd  0xecd(%rip),%xmm0
call   1040 <floor@plt>
mulsd  0xec8(%rip),%xmm0
addsd  (%rsp),%xmm0
divsd  0xeb3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @r_ascension(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @sidereal(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = fdiv double %6, 2.400000e+01
%8 = call double @llvm.floor.f64(double %7)
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double -2.400000e+01, double %8, double %9)
store double %10, double* %3
%11 = load double, double* %3
%12 = fdiv double %11, 2.400000e+01
ret double %12
}

LLVM IR (-O2):
define double @r_ascension(double %0) {
%2 = tail call double @sidereal(double %0)
%3 = fdiv double %2, 2.400000e+01
%4 = tail call double @llvm.floor.f64(double %3)
%5 = tail call double @llvm.fmuladd.f64(double %4, double -2.400000e+01, double %2)
%6 = fdiv double %5, 2.400000e+01
ret double %6
}
void swap(int data[], int idx1, int idx2) {
  int temp = data[idx1];
  data[idx1] = data[idx2];
  data[idx2] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void open_hdhr(char *idstring) {}


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

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

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

LLVM IR (-O2):
define void @open_hdhr(i8* nocapture %0) {
ret void
}
vtch(c) int c;
{ putchar(c & 0377); }


x86 assembly (clang, -O0):
<vtch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0xff,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vtch>:
movzbl %dil,%edi
xor    %eax,%eax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @vtch(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 255
%6 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @vtch(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ flush(size_t *);
int /*<<< orphan*/ maccess(size_t *);
size_t rdtsc();
size_t onlyreload(size_t *addr) {
  size_t time = rdtsc();
  flush(addr);
  size_t delta = rdtsc() - time;
  maccess(addr);
  maccess(addr);
  return delta;
}


x86 assembly (clang, -O0):
<onlyreload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rdtsc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <flush@plt>
mov    $0x0,%al
call   1040 <rdtsc@plt>
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <maccess@plt>
mov    -0x8(%rbp),%rdi
call   1050 <maccess@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onlyreload>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %eax,%eax
call   1040 <rdtsc@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1030 <flush@plt>
xor    %eax,%eax
call   1040 <rdtsc@plt>
mov    %rax,%rbx
sub    %r14,%rbx
mov    %r15,%rdi
call   1050 <maccess@plt>
mov    %r15,%rdi
call   1050 <maccess@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @onlyreload(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64
store i64* %0, i64** %2
%5 = call i64 (...) @rdtsc()
store i64 %5, i64* %3
%6 = load i64*, i64** %2
%7 = call i32 @flush(i64* %6)
%8 = call i64 (...) @rdtsc()
%9 = load i64, i64* %3
%10 = sub i64 %8, %9
store i64 %10, i64* %4
%11 = load i64*, i64** %2
%12 = call i32 @maccess(i64* %11)
%13 = load i64*, i64** %2
%14 = call i32 @maccess(i64* %13)
%15 = load i64, i64* %4
ret i64 %15
}

LLVM IR (-O2):
define i64 @onlyreload(i64* %0) {
%2 = tail call i64 (...) @rdtsc()
%3 = tail call i32 @flush(i64* %0)
%4 = tail call i64 (...) @rdtsc()
%5 = sub i64 %4, %2
%6 = tail call i32 @maccess(i64* %0)
%7 = tail call i32 @maccess(i64* %0)
ret i64 %5
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int connect(int, struct sockaddr *, int);
int socket_connect(int sock, struct sockaddr_in *sa) {
  return connect(sock, (struct sockaddr *)sa, sizeof(struct sockaddr));
}


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

x86 assembly (clang, -O2):
<socket_connect>:
mov    $0x4,%edx
jmp    1030 <connect@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @socket_connect(i32 %0, %struct.sockaddr_in* %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in*
store i32 %0, i32* %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
%5 = load i32, i32* %3
%6 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%7 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%8 = call i32 @connect(i32 %5, %struct.sockaddr* %7, i32 4)
ret i32 %8
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @socket_connect(i32 %0, %struct.sockaddr_in* %1) {
%3 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%4 = tail call i32 @connect(i32 %0, %struct.sockaddr* %3, i32 4)
ret i32 %4
}
unsigned int av_log2(unsigned int x) {
  unsigned int ret;
  __asm__ volatile("or $1, %1 \n\t"
                   "bsr %1, %0 \n\t"
                   : "=a"(ret)
                   : "D"(x));
  return ret;
}


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

x86 assembly (clang, -O2):
<av_log2>:
or     $0x1,%edi
bsr    %edi,%eax
ret

LLVM IR (-O0):
define i32 @av_log2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "or $$1, $1 \0A\09bsr $1, $0 \0A\09", "={ax},{di},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @av_log2(i32 %0) {
%2 = tail call i32 asm sideeffect "or $$1, $1 \0A\09bsr $1, $0 \0A\09", "={ax},{di},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
int __sx25_save_link_parameters(struct link_data *linkid) {
  (void)linkid;
  return (0);
}


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

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

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

LLVM IR (-O2):
%struct.link_data = type opaque
define i32 @__sx25_save_link_parameters(%struct.link_data* nocapture readnone %0) {
ret i32 0
}
int fun516() { return 516; }


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

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

LLVM IR (-O0):
define i32 @fun516() {
ret i32 516
}

LLVM IR (-O2):
define i32 @fun516() {
ret i32 516
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("H\bel\tlo,\n W\borl\bd!\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"H\08el\09lo,\0A W\08orl\08d!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"H\08el\09lo,\0A W\08orl\08d!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t Maj(uint64_t x, uint64_t y, uint64_t z) {
  return (x & y) | (z & (x | y));
}


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

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

LLVM IR (-O0):
define i32 @Maj(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 = and i32 %7, %8
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = or i32 %11, %12
%14 = and i32 %10, %13
%15 = or i32 %9, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @Maj(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = or i32 %1, %0
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  long i;
  unsigned char c = 0;
  for (i = 0L; i < 104857600L; i++) {
    fwrite(&c, 1, 1, stdout);
    c++;
  }
  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)
movb   $0x0,-0x19(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x6400000,-0x18(%rbp)
06
jge    1172 <main+0x62>
mov    0x2e99(%rip),%rax
mov    (%rax),%ecx
lea    -0x19(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
mov    -0x19(%rbp),%al
add    $0x1,%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1132 <main+0x22>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
mov    $0x6400000,%ebx
mov    0x2eb6(%rip),%r15
lea    0xf(%rsp),%r14
nop
mov    (%r15),%ecx
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
addb   $0x1,0xf(%rsp)
add    $0xffffffffffffffff,%rbx
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 0, i8* %7
store i64 0, i64* %6
br label %8
8: ; preds = %16, %2
%9 = load i64, i64* %6
%10 = icmp slt i64 %9, 104857600
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32, i32* @stdout
%13 = call i32 @fwrite(i8* %7, i32 1, i32 1, i32 %12)
%14 = load i8, i8* %7
%15 = add i8 %14, 1
store i8 %15, i8* %7
br label %16
16: ; preds = %11
%17 = load i64, i64* %6
%18 = add nsw i64 %17, 1
store i64 %18, i64* %6
br label %8
19: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
store i8 0, i8* %3
br label %4
4: ; preds = %2, %4
%5 = phi i64 [ 0, %2 ], [ %10, %4 ]
%6 = load i32, i32* @stdout
%7 = call i32 @fwrite(i8* %3, i32 1, i32 1, i32 %6)
%8 = load i8, i8* %3
%9 = add i8 %8, 1
store i8 %9, i8* %3
%10 = add nuw nsw i64 %5, 1
%11 = icmp eq i64 %10, 104857600
br i1 %11, label %12, label %4
12: ; preds = %4
ret i32 0
}
/* Type definitions */
typedef size_t off_t;

/* Variables and functions */
size_t find_potential_buddy(off_t offset, size_t buddy_size) {
  size_t buddy_lowbits = ~(-buddy_size);
  if (offset & buddy_lowbits)
    return -1;
  else
    return (offset ^ buddy_size);
}


x86 assembly (clang, -O0):
<find_potential_buddy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %eax,%eax
sub    -0x18(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
and    -0x20(%rbp),%rax
cmp    $0x0,%rax
je     1139 <find_potential_buddy+0x39>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1145 <find_potential_buddy+0x45>
mov    -0x10(%rbp),%rax
xor    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_potential_buddy>:
lea    -0x1(%rsi),%rax
and    %rdi,%rax
xor    %rdi,%rsi
neg    %rax
sbb    %rax,%rax
or     %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @find_potential_buddy(i64 %0, i64 %1) {
%3 = add i64 %1, -1
%4 = and i64 %3, %0
%5 = icmp eq i64 %4, 0
%6 = xor i64 %1, %0
%7 = select i1 %5, i64 %6, i64 -1
ret i64 %7
}
/* Variables and functions */
long llround(double);
long lround(double __a) { return llround(__a); }


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

x86 assembly (clang, -O2):
<lround>:
jmp    1030 <llround@plt>

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

LLVM IR (-O2):
define i64 @lround(double %0) {
%2 = tail call i64 @llround(double %0)
ret i64 %2
}
int xtensa_uimm16x4(v)
int v;
{ return (v & 3) == 0 && (v >= -262144 && v <= -4); }


x86 assembly (clang, -O0):
<xtensa_uimm16x4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    113d <xtensa_uimm16x4+0x3d>
xor    %eax,%eax
cmpl   $0xfffc0000,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1137 <xtensa_uimm16x4+0x37>
cmpl   $0xfffffffc,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtensa_uimm16x4>:
test   $0x3,%dil
sete   %al
add    $0x40000,%edi
cmp    $0x3fffd,%edi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @xtensa_uimm16x4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, -262144
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, -4
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
br label %14
14: ; preds = %12, %1
%15 = phi i1 [ false, %1 ], [ %13, %12 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @xtensa_uimm16x4(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = add i32 %0, 262144
%5 = icmp ult i32 %4, 262141
%6 = and i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
struct me_dirent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct me_dirent *);
void minix_free_readdir(struct me_dirent *md, int n) { free(md); }


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

x86 assembly (clang, -O2):
<minix_free_readdir>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.me_dirent = type { i32 }
define void @minix_free_readdir(%struct.me_dirent* %0, i32 %1) {
%3 = alloca %struct.me_dirent*
%4 = alloca i32
store %struct.me_dirent* %0, %struct.me_dirent** %3
store i32 %1, i32* %4
%5 = load %struct.me_dirent*, %struct.me_dirent** %3
%6 = call i32 @free(%struct.me_dirent* %5)
ret void
}

LLVM IR (-O2):
%struct.me_dirent = type { i32 }
define void @minix_free_readdir(%struct.me_dirent* nocapture %0, i32 %1) {
%3 = tail call i32 @free(%struct.me_dirent* %0)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(void *, void *);
int hash_str_equal(void *key1, void *key2) {
  int retval = strcmp(key1, key2) == 0;
  return retval;
}


x86 assembly (clang, -O0):
<hash_str_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str_equal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hash_str_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @hash_str_equal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct _cgatsAlloc {
  int dummy;
};

/* Variables and functions */
void *malloc(size_t);
void *cgatsAllocStd_malloc(struct _cgatsAlloc *pp, size_t size) {
  void *rv = malloc(size);
  return rv;
}


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

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

LLVM IR (-O0):
%struct._cgatsAlloc = type { i32 }
define i8* @cgatsAllocStd_malloc(%struct._cgatsAlloc* %0, i64 %1) {
%3 = alloca %struct._cgatsAlloc*
%4 = alloca i64
%5 = alloca i8*
store %struct._cgatsAlloc* %0, %struct._cgatsAlloc** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
ret i8* %8
}

LLVM IR (-O2):
%struct._cgatsAlloc = type { i32 }
define noalias i8* @cgatsAllocStd_malloc(%struct._cgatsAlloc* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
const char *mg_version(void) { return ("2.8-sg"); }


x86 assembly (clang, -O0):
<mg_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"2.8-sg\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"2.8-sg\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
extern unsigned int __inl_p(unsigned short port) {
  unsigned int _v;
  __asm__ __volatile__("in"
                       "l"
                       " %"
                       "w"
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "d"(port));
  __asm__ __volatile__("jmp 1f\n1:\tjmp 1f\n1:");
  return _v;
}


x86 assembly (clang, -O0):
<__inl_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%eax
mov    %eax,-0x8(%rbp)
jmp    1118 <__inl_p+0x18>
jmp    111d <__inl_p+0x1d>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inl_p>:
mov    %edi,%edx
in     (%dx),%eax
jmp    1105 <__inl_p+0x5>
jmp    1107 <__inl_p+0x7>
ret

LLVM IR (-O0):
define i32 @__inl_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 asm sideeffect "inl ${1:w},$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @__inl_p(i16 zeroext %0) {
%2 = tail call i32 asm sideeffect "inl ${1:w},$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
tail call void asm sideeffect "jmp 1f\0A1:\09jmp 1f\0A1:", "~{dirflag},~{fpsr},~{flags}"()
ret i32 %2
}
int test_imm_6Euint32_reg(unsigned int val) {
  return ((val) & (0x6E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Euint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x6e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_6Euint32_reg(i32 %0) {
%2 = and i32 %0, 110
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ increment(int *);
int *malloc(int);
int /*<<< orphan*/ sleep(int);
int main() {
  int *i = malloc(sizeof(int));
  increment(i);
  sleep(1);
  (*i)++;
  (*i)++;
  (*i)++;
  (*i)++;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <increment@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <increment@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
addl   $0x4,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 4)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @increment(i32* %3)
%5 = call i32 @sleep(i32 1)
%6 = load i32*, i32** %1
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
%9 = load i32*, i32** %1
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %9
%12 = load i32*, i32** %1
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %12
%15 = load i32*, i32** %1
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 1
store i32 %17, i32* %15
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @increment(i32* %1)
%3 = tail call i32 @sleep(i32 1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 4
store i32 %5, i32* %1
ret i32 0
}