xunge/DecIR huggingface dataset:
float minver_fabs(float n) {
  float f;
  if (n >= 0)
    f = n;
  else
    f = -n;
  return f;
}


x86 assembly (clang, -O0):
<minver_fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <minver_fabs+0x29>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1140 <minver_fabs+0x40>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<minver_fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm1,%xmm1
cmpnless %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @minver_fabs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %2
store float %7, float* %3
br label %11
8: ; preds = %1
%9 = load float, float* %2
%10 = fneg float %9
store float %10, float* %3
br label %11
11: ; preds = %8, %6
%12 = load float, float* %3
ret float %12
}

LLVM IR (-O2):
define float @minver_fabs(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
void insb(int port, void *addr, int cnt) {
  asm volatile("cld; rep insb"
               : "=D"(addr), "=c"(cnt)
               : "d"(port), "0"(addr), "1"(cnt)
               : "memory", "cc");
}


x86 assembly (clang, -O0):
<insb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ecx
cld
rep insb (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insb>:
mov    %edx,%ecx
mov    %edi,%edx
mov    %rsi,%rdi
cld
rep insb (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insb(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call { i8*, i32 } asm sideeffect "cld; rep insb", "={di},={cx},{dx},0,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %7, i8* %8, i32 %9)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %5
store i32 %12, i32* %6
ret void
}

LLVM IR (-O2):
define void @insb(i32 %0, i8* %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "cld; rep insb", "={di},={cx},{dx},0,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_s16(int /*<<< orphan*/);
int /*<<< orphan*/ plcvm_pop();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_s2_s(void) { plcvm_push(plcvm_get_s16(plcvm_pop())); }


x86 assembly (clang, -O0):
<cb_ldm_s2_s>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <plcvm_pop@plt>
mov    %eax,%edi
call   1050 <plcvm_get_s16@plt>
mov    %eax,%edi
call   1040 <plcvm_push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_s2_s>:
push   %rax
xor    %eax,%eax
call   1030 <plcvm_pop@plt>
mov    %eax,%edi
call   1050 <plcvm_get_s16@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_s2_s() {
%1 = call i32 (...) @plcvm_pop()
%2 = call i32 @plcvm_get_s16(i32 %1)
%3 = call i32 @plcvm_push(i32 %2)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_s2_s() {
%1 = tail call i32 (...) @plcvm_pop()
%2 = tail call i32 @plcvm_get_s16(i32 %1)
%3 = tail call i32 @plcvm_push(i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ samba_write(scalar_t__, scalar_t__, int, int);
void mbox_write(uint32_t base, uint32_t offset, uint32_t value) {
  samba_write(base + offset, value, 4, 10000000);
}


x86 assembly (clang, -O0):
<mbox_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
mov    $0x989680,%ecx
call   1030 <samba_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbox_write>:
add    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x4,%edx
mov    $0x989680,%ecx
jmp    1030 <samba_write@plt>

LLVM IR (-O0):
define void @mbox_write(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = add nsw i64 %7, %8
%10 = load i64, i64* %6
%11 = call i32 @samba_write(i64 %9, i64 %10, i32 4, i32 10000000)
ret void
}

LLVM IR (-O2):
define void @mbox_write(i64 %0, i64 %1, i64 %2) {
%4 = add nsw i64 %1, %0
%5 = tail call i32 @samba_write(i64 %4, i64 %2, i32 4, i32 10000000)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
int /*<<< orphan*/ svcPanic();
caddr_t sbrk(int incr) { svcPanic(); }


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

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

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

LLVM IR (-O2):
define i32 @sbrk(i32 %0) {
%2 = tail call i32 (...) @svcPanic()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sendCmd(int, char *);
void sketchStart(int fd) { sendCmd(fd, "sketch\n"); }


x86 assembly (clang, -O0):
<sketchStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <sendCmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sketchStart>:
lea    0xee9(%rip),%rsi
jmp    1030 <sendCmd@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"sketch\0A\00"
define void @sketchStart(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sendCmd(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"sketch\0A\00"
define void @sketchStart(i32 %0) {
%2 = tail call i32 @sendCmd(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Most people's C programs should be indented six feet downward and "
         "covered with dirt.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [85 x i8] c"Most people's C programs should be indented six feet downward and covered with dirt.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [85 x i8] c"Most people's C programs should be indented six feet downward and covered with dirt.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ IPC_PRIVATE;
int msgget(int /*<<< orphan*/, int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  int key;
  key = msgget(IPC_PRIVATE, IPC_CREAT | 0600);
  if (key < 0) {
    puts("msgget failed");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
or     $0x180,%esi
call   1030 <msgget@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1171 <main+0x51>
lea    0xea0(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1178 <main+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    $0x180,%esi
or     (%rax),%esi
call   1030 <msgget@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
js     1147 <main+0x27>
pop    %rcx
ret
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@IPC_PRIVATE = global i32 0
@IPC_CREAT = global i32 0
@.str = [14 x i8] c"msgget failed\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @IPC_PRIVATE
%4 = load i32, i32* @IPC_CREAT
%5 = or i32 %4, 384
%6 = call i32 @msgget(i32 %3, i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@IPC_PRIVATE = global i32 0
@IPC_CREAT = global i32 0
@.str = [14 x i8] c"msgget failed\00"
define i32 @main() {
%1 = load i32, i32* @IPC_PRIVATE
%2 = load i32, i32* @IPC_CREAT
%3 = or i32 %2, 384
%4 = tail call i32 @msgget(i32 %1, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %0, %6
%9 = phi i32 [ 1, %6 ], [ 0, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void gui_redraw(void) { glutPostRedisplay(); }


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

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

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

LLVM IR (-O2):
define void @gui_redraw() {
%1 = tail call i32 (...) @glutPostRedisplay()
ret void
}
void set_bits(unsigned char *regs, int regIndex, unsigned char value,
              int start_bit, int nr_bits) {
  regs[regIndex] = (regs[regIndex] & (~(((1 << nr_bits) - 1) << start_bit))) |
                   (value << start_bit);
}


x86 assembly (clang, -O0):
<set_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
sub    $0x1,%edx
mov    -0x14(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xd(%rbp),%edx
mov    -0x14(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bits>:
mov    %ecx,%eax
movslq %esi,%r9
mov    $0xffffffff,%esi
mov    %r8d,%ecx
shl    %cl,%esi
not    %esi
mov    %eax,%ecx
shl    %cl,%esi
movzbl (%rdi,%r9,1),%r8d
mov    %eax,%ecx
shl    %cl,%edx
not    %esi
and    %r8d,%esi
or     %esi,%edx
mov    %dl,(%rdi,%r9,1)
ret

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

LLVM IR (-O2):
define void @set_bits(i8* nocapture %0, i32 %1, i8 zeroext %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl nsw i32 -1, %4
%11 = xor i32 %10, -1
%12 = shl i32 %11, %3
%13 = xor i32 %12, -1
%14 = and i32 %9, %13
%15 = zext i8 %2 to i32
%16 = shl i32 %15, %3
%17 = or i32 %14, %16
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closeTTY(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<closeTTY>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @closeTTY(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ deallocateAll();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void error(char *message) {
  printf(message);
  printf("\n");
  deallocateAll();
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <deallocateAll@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <deallocateAll@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @deallocateAll()
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 (...) @deallocateAll()
%5 = tail call i32 @exit(i32 1)
unreachable
}
unsigned long
count_num_bits_set_for_all_positive_numbers_v2(unsigned long num) {
  unsigned long total_bits_set, index, bit_index;
  unsigned long bits_set_in_num;
  total_bits_set = 0;
  return (total_bits_set);
}


x86 assembly (clang, -O0):
<count_num_bits_set_for_all_positive_numbers_v2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @count_num_bits_set_for_all_positive_numbers_v2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @count_num_bits_set_for_all_positive_numbers_v2(i64 %0) {
ret i64 0
}
/* Variables and functions */
unsigned short MMCSD_sendCmd(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
unsigned short MMCSD_goIdleState() {
  return MMCSD_sendCmd((0x4000 | (0)), 0, 0, 0x0004);
}


x86 assembly (clang, -O0):
<MMCSD_goIdleState>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4000,%edi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
call   1030 <MMCSD_sendCmd@plt>
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMCSD_goIdleState>:
mov    $0x4000,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
jmp    1030 <MMCSD_sendCmd@plt>

LLVM IR (-O0):
define zeroext i16 @MMCSD_goIdleState() {
%1 = call zeroext i16 @MMCSD_sendCmd(i32 16384, i32 0, i32 0, i32 4)
ret i16 %1
}

LLVM IR (-O2):
define zeroext i16 @MMCSD_goIdleState() {
%1 = tail call zeroext i16 @MMCSD_sendCmd(i32 16384, i32 0, i32 0, i32 4)
ret i16 %1
}
/* Variables and functions */
double M_PI;
double deg2rad(double theta) { return (theta * M_PI / 180.0); }


x86 assembly (clang, -O0):
<deg2rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2rad>:
mov    0x2ee1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @deg2rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fmul double %3, %4
%6 = fdiv double %5, 1.800000e+02
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @deg2rad(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
ret double %4
}
void printfloat(float n) {}


x86 assembly (clang, -O0):
<printfloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @printfloat(float %0) {
ret void
}
/* Variables and functions */
void utils_copyValue(void *dst, const void *src, size_t len) {}


x86 assembly (clang, -O0):
<utils_copyValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @utils_copyValue(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @utils_copyValue(i8* nocapture %0, i8* nocapture %1, i64 %2) {
ret void
}
const char *Mutex_Description(void) {
  return "The `Mutex` type can be used to gain mutual exclusion across Threads "
         "for "
         "access to some resource.";
}


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

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

LLVM IR (-O0):
@.str = [98 x i8] c"The `Mutex` type can be used to gain mutual exclusion across Threads for access to some resource.\00"
define i8* @Mutex_Description() {
ret i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [98 x i8] c"The `Mutex` type can be used to gain mutual exclusion across Threads for access to some resource.\00"
define i8* @Mutex_Description() {
ret i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
unsigned short VIDEC_HEADER_GET_EVEN_KEYFRAME(void *);
unsigned short VIDEC_HEADER_GET_ODD_KEYFRAME(void *);
unsigned short VIDEC_HEADER_GET_KEY_FRAME(void *p) {
  return (VIDEC_HEADER_GET_EVEN_KEYFRAME(p) | VIDEC_HEADER_GET_ODD_KEYFRAME(p));
}


x86 assembly (clang, -O0):
<VIDEC_HEADER_GET_KEY_FRAME>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <VIDEC_HEADER_GET_EVEN_KEYFRAME@plt>
movzwl %ax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <VIDEC_HEADER_GET_ODD_KEYFRAME@plt>
mov    %ax,%cx
mov    -0xc(%rbp),%eax
movzwl %cx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIDEC_HEADER_GET_KEY_FRAME>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <VIDEC_HEADER_GET_EVEN_KEYFRAME@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <VIDEC_HEADER_GET_ODD_KEYFRAME@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @VIDEC_HEADER_GET_KEY_FRAME(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call zeroext i16 @VIDEC_HEADER_GET_EVEN_KEYFRAME(i8* %3)
%5 = zext i16 %4 to i32
%6 = load i8*, i8** %2
%7 = call zeroext i16 @VIDEC_HEADER_GET_ODD_KEYFRAME(i8* %6)
%8 = zext i16 %7 to i32
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @VIDEC_HEADER_GET_KEY_FRAME(i8* %0) {
%2 = tail call zeroext i16 @VIDEC_HEADER_GET_EVEN_KEYFRAME(i8* %0)
%3 = tail call zeroext i16 @VIDEC_HEADER_GET_ODD_KEYFRAME(i8* %0)
%4 = or i16 %3, %2
ret i16 %4
}
unsigned ulog2(unsigned n) {
  unsigned i = 0;
  while ((1 << i) - 1 < n)
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<ulog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
cmp    -0x4(%rbp),%eax
jae    1132 <ulog2+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <ulog2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulog2>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ecx
mov    %edi,%eax
shr    %cl,%eax
test   %eax,%eax
jne    1110 <ulog2+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ulog2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = lshr i32 %0, %3
%5 = icmp eq i32 %4, 0
%6 = add i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_intro_message() { puts("Input your brainfuck code below."); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Input your brainfuck code below.\00"
define void @print_intro_message() {
%1 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Input your brainfuck code below.\00"
define void @print_intro_message() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fail(const char *in_msg) {
  fprintf(stderr, "RunlessBASIC: fatal: %s\n", in_msg);
  abort();
}


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

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"RunlessBASIC: fatal: %s\0A\00"
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"RunlessBASIC: fatal: %s\0A\00"
define void @fail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
int ft_strlen(char *str) {
  int len;
  len = 0;
  while (str[len] != '\0') {
    len++;
  }
  return (len);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <ft_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret

LLVM IR (-O0):
define i32 @ft_strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ gfmiv(int);
scalar_t__ gfmult(int /*<<< orphan*/, int /*<<< orphan*/);
int gfpow(scalar_t__);
uint8_t coeffB(uint8_t x, uint8_t y) {
  return gfmult(gfmiv(gfpow(y - x) ^ 1), gfmiv(gfpow(x)));
}


x86 assembly (clang, -O0):
<coeffB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
call   1050 <gfpow@plt>
mov    %eax,%edi
xor    $0x1,%edi
call   1040 <gfmiv@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <gfpow@plt>
mov    %eax,%edi
call   1040 <gfmiv@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <gfmult@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coeffB>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
sub    %rdi,%rsi
mov    %rsi,%rdi
call   1050 <gfpow@plt>
xor    $0x1,%eax
mov    %eax,%edi
call   1040 <gfmiv@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <gfpow@plt>
mov    %eax,%edi
call   1040 <gfmiv@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <gfmult@plt>

LLVM IR (-O0):
define i64 @coeffB(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = sub nsw i64 %5, %6
%8 = call i32 @gfpow(i64 %7)
%9 = xor i32 %8, 1
%10 = call i32 @gfmiv(i32 %9)
%11 = load i64, i64* %3
%12 = call i32 @gfpow(i64 %11)
%13 = call i32 @gfmiv(i32 %12)
%14 = call i64 @gfmult(i32 %10, i32 %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @coeffB(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = tail call i32 @gfpow(i64 %3)
%5 = xor i32 %4, 1
%6 = tail call i32 @gfmiv(i32 %5)
%7 = tail call i32 @gfpow(i64 %0)
%8 = tail call i32 @gfmiv(i32 %7)
%9 = tail call i64 @gfmult(i32 %6, i32 %8)
ret i64 %9
}
void GPMCNANDDataWrite(unsigned int baseAddr, unsigned int csNum,
                       unsigned int data) {
  (*((volatile unsigned int *)(baseAddr + (0x84 + (csNum * (0x30)))))) = data;
}


x86 assembly (clang, -O0):
<GPMCNANDDataWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%edx
add    $0x84,%edx
add    %edx,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCNANDDataWrite>:
lea    (%rsi,%rsi,2),%eax
shl    $0x4,%eax
add    %edi,%eax
add    $0x84,%eax
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPMCNANDDataWrite(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* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = mul i32 %9, 48
%11 = add i32 132, %10
%12 = add i32 %8, %11
%13 = zext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %7, i32* %14
ret void
}

LLVM IR (-O2):
define void @GPMCNANDDataWrite(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 48
%5 = add i32 %0, 132
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %2, i32* %8
ret void
}
/* Type definitions */
struct mat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat_invert(struct mat *);
int /*<<< orphan*/ mat_translate(struct mat *, float, float);
void mat_offset(struct mat *this, float dx, float dy) {
  mat_invert(this);
  mat_translate(this, -dx, -dy);
  mat_invert(this);
}


x86 assembly (clang, -O0):
<mat_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mat_invert@plt>
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x10(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
call   1030 <mat_translate@plt>
mov    -0x8(%rbp),%rdi
call   1040 <mat_invert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_offset>:
push   %rbx
sub    $0x20,%rsp
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rdi,%rbx
call   1040 <mat_invert@plt>
movaps 0xec3(%rip),%xmm2
movaps (%rsp),%xmm0
xorps  %xmm2,%xmm0
movaps 0x10(%rsp),%xmm1
xorps  %xmm2,%xmm1
mov    %rbx,%rdi
call   1030 <mat_translate@plt>
mov    %rbx,%rdi
add    $0x20,%rsp
pop    %rbx
jmp    1040 <mat_invert@plt>

LLVM IR (-O0):
%struct.mat = type { i32 }
define void @mat_offset(%struct.mat* %0, float %1, float %2) {
%4 = alloca %struct.mat*
%5 = alloca float
%6 = alloca float
store %struct.mat* %0, %struct.mat** %4
store float %1, float* %5
store float %2, float* %6
%7 = load %struct.mat*, %struct.mat** %4
%8 = call i32 @mat_invert(%struct.mat* %7)
%9 = load %struct.mat*, %struct.mat** %4
%10 = load float, float* %5
%11 = fneg float %10
%12 = load float, float* %6
%13 = fneg float %12
%14 = call i32 @mat_translate(%struct.mat* %9, float %11, float %13)
%15 = load %struct.mat*, %struct.mat** %4
%16 = call i32 @mat_invert(%struct.mat* %15)
ret void
}

LLVM IR (-O2):
%struct.mat = type { i32 }
define void @mat_offset(%struct.mat* %0, float %1, float %2) {
%4 = tail call i32 @mat_invert(%struct.mat* %0)
%5 = fneg float %1
%6 = fneg float %2
%7 = tail call i32 @mat_translate(%struct.mat* %0, float %5, float %6)
%8 = tail call i32 @mat_invert(%struct.mat* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_rdctl(int);
uint32_t _Nios2_Get_ctlreg_estatus(void) {
  return (uint32_t)__builtin_rdctl(1);
}


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

x86 assembly (clang, -O2):
<_Nios2_Get_ctlreg_estatus>:
mov    $0x1,%edi
jmp    1030 <__builtin_rdctl@plt>

LLVM IR (-O0):
define i32 @_Nios2_Get_ctlreg_estatus() {
%1 = call i32 @__builtin_rdctl(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @_Nios2_Get_ctlreg_estatus() {
%1 = tail call i32 @__builtin_rdctl(i32 1)
ret i32 %1
}
int baz(unsigned int x) { return x + 1U; }


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

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

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

LLVM IR (-O2):
define i32 @baz(i32 %0) {
%2 = add i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_attr_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_attr_getstacksize(int /*<<< orphan*/ *, size_t *);
int /*<<< orphan*/ pthread_attr_init(int /*<<< orphan*/ *);
size_t tp_info_sysdefaultstack() {
  pthread_attr_t attr;
  pthread_attr_init(&attr);
  size_t length = 0;
  pthread_attr_getstacksize(&attr, &length);
  pthread_attr_destroy(&attr);
  return length;
}


x86 assembly (clang, -O0):
<tp_info_sysdefaultstack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <pthread_attr_init@plt>
movq   $0x0,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <pthread_attr_getstacksize@plt>
lea    -0x4(%rbp),%rdi
call   1040 <pthread_attr_destroy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_info_sysdefaultstack>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <pthread_attr_init@plt>
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <pthread_attr_getstacksize@plt>
mov    %rbx,%rdi
call   1040 <pthread_attr_destroy@plt>
mov    (%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @tp_info_sysdefaultstack() {
%1 = alloca i32
%2 = alloca i64
%3 = call i32 @pthread_attr_init(i32* %1)
store i64 0, i64* %2
%4 = call i32 @pthread_attr_getstacksize(i32* %1, i64* %2)
%5 = call i32 @pthread_attr_destroy(i32* %1)
%6 = load i64, i64* %2
ret i64 %6
}

LLVM IR (-O2):
define i64 @tp_info_sysdefaultstack() {
%1 = alloca i32
%2 = alloca i64
%3 = bitcast i32* %1 to i8*
%4 = call i32 @pthread_attr_init(i32* %1)
%5 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%6 = call i32 @pthread_attr_getstacksize(i32* %1, i64* %2)
%7 = call i32 @pthread_attr_destroy(i32* %1)
%8 = load i64, i64* %2
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ init(char *);
scalar_t__ malloc(int);
int main() {
  char *p;
  init(p);
  p = (char *)malloc(42);
  p[0] = '\n';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
call   1030 <init@plt>
mov    $0x2a,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0xa,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <init@plt>
mov    $0x2a,%edi
call   1040 <malloc@plt>
movb   $0xa,(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @init(i8* %2)
%4 = call i64 @malloc(i32 42)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 10, i8* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @init(i8* undef)
%2 = tail call i64 @malloc(i32 42)
%3 = inttoptr i64 %2 to i8*
store i8 10, i8* %3
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int getN(char *sN) {
  int i, N;
  N = atoi(sN + 1);
  return N;
}


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

x86 assembly (clang, -O2):
<getN>:
add    $0x1,%rdi
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @getN(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i32 @atoi(i8* %2)
ret i32 %3
}
/* Type definitions */
typedef int __u16;

/* Variables and functions */
__u16 mdio_phy_id_c45(int prtad, int devad) {
  return 0x8000 | (prtad << 5) | devad;
}


x86 assembly (clang, -O0):
<mdio_phy_id_c45>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
or     $0x8000,%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdio_phy_id_c45>:
mov    %edi,%eax
shl    $0x5,%eax
or     %esi,%eax
or     $0x8000,%eax
ret

LLVM IR (-O0):
define i32 @mdio_phy_id_c45(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 = shl i32 %5, 5
%7 = or i32 32768, %6
%8 = load i32, i32* %4
%9 = or i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @mdio_phy_id_c45(i32 %0, i32 %1) {
%3 = shl i32 %0, 5
%4 = or i32 %3, %1
%5 = or i32 %4, 32768
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, Compiler!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
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 = [18 x i8] c"Hello, Compiler!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"Hello, Compiler!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void dum() {}


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

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

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

LLVM IR (-O2):
define void @dum() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inter_save();
int /*<<< orphan*/ mmo_char_sync();
int mmo_char_sync_timer(int tid, unsigned int tick, int id, int data) {
  mmo_char_sync();
  inter_save();
  return 0;
}


x86 assembly (clang, -O0):
<mmo_char_sync_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x0,%al
call   1040 <mmo_char_sync@plt>
mov    $0x0,%al
call   1030 <inter_save@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmo_char_sync_timer>:
push   %rax
xor    %eax,%eax
call   1040 <mmo_char_sync@plt>
xor    %eax,%eax
call   1030 <inter_save@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mmo_char_sync_timer(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 = call i32 (...) @mmo_char_sync()
%10 = call i32 (...) @inter_save()
ret i32 0
}

LLVM IR (-O2):
define i32 @mmo_char_sync_timer(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @mmo_char_sync()
%6 = tail call i32 (...) @inter_save()
ret i32 0
}
int con_debug_enter(struct vc_data *vc) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.vc_data = type opaque
define i32 @con_debug_enter(%struct.vc_data* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gensrand(unsigned int);
void srand(unsigned int seed) { gensrand(seed); }


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

x86 assembly (clang, -O2):
<srand>:
jmp    1030 <gensrand@plt>

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

LLVM IR (-O2):
define void @srand(i32 %0) {
%2 = tail call i32 @gensrand(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ generate_list(int);
int /*<<< orphan*/ reversal_list();
int /*<<< orphan*/ show_list();
int main(int argc, char *argv[]) {
  generate_list(10);
  show_list();
  reversal_list();
  show_list();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
call   1040 <generate_list@plt>
mov    $0x0,%al
call   1030 <show_list@plt>
mov    $0x0,%al
call   1050 <reversal_list@plt>
mov    $0x0,%al
call   1030 <show_list@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <generate_list@plt>
xor    %eax,%eax
call   1030 <show_list@plt>
xor    %eax,%eax
call   1050 <reversal_list@plt>
xor    %eax,%eax
call   1030 <show_list@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @generate_list(i32 10)
%7 = call i32 (...) @show_list()
%8 = call i32 (...) @reversal_list()
%9 = call i32 (...) @show_list()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @generate_list(i32 10)
%4 = tail call i32 (...) @show_list()
%5 = tail call i32 (...) @reversal_list()
%6 = tail call i32 (...) @show_list()
ret i32 0
}
int clip(int low, int val, int high) {
  if (val < low)
    return low;
  else if (val > high)
    return high;
  else
    return val;
}


x86 assembly (clang, -O0):
<clip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <clip+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clip+0x41>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <clip+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clip+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip>:
mov    %edx,%eax
cmp    %edx,%esi
cmovle %esi,%eax
cmp    %edi,%esi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clip(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = icmp sgt i32 %1, %2
%6 = select i1 %5, i32 %2, i32 %1
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
const char *basename(const char *s) {
  const char *r = s;
  while (*s != '\0') {
    if (*s == '/')
      r = ++s;
    else
      ++s;
  }
  return r;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1156 <basename+0x56>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1145 <basename+0x45>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
jmp    1151 <basename+0x51>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <basename+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
mov    %rdi,%rax
lea    0x1(%rax),%rcx
nopw   0x0(%rax,%rax,1)
movzbl -0x1(%rcx),%edx
test   %dl,%dl
je     1135 <basename+0x35>
cmp    $0x2f,%dl
je     1130 <basename+0x30>
add    $0x1,%rcx
jmp    1110 <basename+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rcx,%rax
jmp    1103 <basename+0x3>
ret

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

LLVM IR (-O2):
define i8* @basename(i8* %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %8, %7 ], [ %0, %1 ]
br label %4
4: ; preds = %2, %9
%5 = phi i8* [ %10, %9 ], [ %3, %2 ]
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %11
i8 47, label %7
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
br label %2
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %5, i64 1
br label %4
11: ; preds = %4
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) int is_dp_reg(uint32_t op) {
  return (!((op & 0x02000010) ^ 0x00000000)) &&
         ((op & 0x01900000) ^ 0x01000000);
}


x86 assembly (clang, -O0):
<is_dp_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x2000010,%ecx
xor    $0x0,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1137 <is_dp_reg+0x37>
mov    -0x4(%rbp),%eax
and    $0x1900000,%eax
xor    $0x1000000,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dp_reg>:
test   $0x2000010,%edi
sete   %al
and    $0x1900000,%edi
cmp    $0x1000000,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_dp_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 33554448
%5 = xor i32 %4, 0
%6 = icmp ne i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = and i32 %8, 26214400
%10 = xor i32 %9, 16777216
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_dp_reg(i32 %0) {
%2 = and i32 %0, 33554448
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 26214400
%5 = icmp ne i32 %4, 16777216
%6 = and i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}