xunge/DecIR huggingface dataset:
int __attribute__((__no__)) test_lt(__float128 x, __float128 y) {
  return x < y;
}


x86 assembly (clang, -O0):
<test_lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
movaps %xmm1,-0x20(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   1130 <__letf2>
test   %eax,%eax
sets   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret
nopl   (%rax)

x86 assembly (clang, -O2):
<test_lt>:
push   %rax
call   1120 <__letf2>
xor    %ecx,%ecx
test   %eax,%eax
sets   %cl
mov    %ecx,%eax
pop    %rcx
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)

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

LLVM IR (-O2):
define i32 @test_lt(fp128 %0, fp128 %1) {
%3 = fcmp olt fp128 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned short, unsigned short);
void serial_configure_baud_rate(unsigned short com, unsigned short divisor) {
  outb((com + 3), 0x80);
  outb((com), (divisor >> 8) & 0x00FF);
  outb((com), divisor & 0x00FF);
}


x86 assembly (clang, -O0):
<serial_configure_baud_rate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x3,%eax
mov    $0x80,%esi
movzwl %ax,%edi
call   1030 <outb@plt>
mov    -0x2(%rbp),%cx
movzwl -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movzwl %cx,%edi
movzwl %ax,%esi
call   1030 <outb@plt>
mov    -0x2(%rbp),%cx
movzwl -0x4(%rbp),%eax
and    $0xff,%eax
movzwl %cx,%edi
movzwl %ax,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_configure_baud_rate>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
lea    0x3(%rbx),%eax
movzwl %ax,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
mov    %ebp,%esi
shr    $0x8,%esi
mov    %ebx,%edi
call   1030 <outb@plt>
movzbl %bpl,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_configure_baud_rate(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = add nsw i32 %6, 3
%8 = trunc i32 %7 to i16
%9 = call i32 @outb(i16 zeroext %8, i16 zeroext 128)
%10 = load i16, i16* %3
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i16
%16 = call i32 @outb(i16 zeroext %10, i16 zeroext %15)
%17 = load i16, i16* %3
%18 = load i16, i16* %4
%19 = zext i16 %18 to i32
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i16
%22 = call i32 @outb(i16 zeroext %17, i16 zeroext %21)
ret void
}

LLVM IR (-O2):
define void @serial_configure_baud_rate(i16 zeroext %0, i16 zeroext %1) {
%3 = add i16 %0, 3
%4 = tail call i32 @outb(i16 zeroext %3, i16 zeroext 128)
%5 = lshr i16 %1, 8
%6 = tail call i32 @outb(i16 zeroext %0, i16 zeroext %5)
%7 = and i16 %1, 255
%8 = tail call i32 @outb(i16 zeroext %0, i16 zeroext %7)
ret void
}
/* Variables and functions */
scalar_t__ random();
void dirty_buffer(int *buf) {
  static int todirty = 0;
  buf[todirty++] = (int)random();
  if (todirty == (16384) / (sizeof(int)))
    todirty = 0;
}


x86 assembly (clang, -O0):
<dirty_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    0x2efd(%rip),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,0x2ef2(%rip)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
movslq 0x2ee5(%rip),%rax
cmp    $0x1000,%rax
jne    115d <dirty_buffer+0x4d>
movl   $0x0,0x2ecf(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirty_buffer>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <random@plt>
movslq 0x2f0a(%rip),%rcx
lea    0x1(%rcx),%edx
mov    %edx,0x2f01(%rip)
mov    %eax,(%rbx,%rcx,4)
cmp    $0x1000,%edx
jne    1140 <dirty_buffer+0x30>
movl   $0x0,0x2eec(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@dirty_buffer.todirty = internal global i32 0
define void @dirty_buffer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i64 (...) @random()
%4 = trunc i64 %3 to i32
%5 = load i32*, i32** %2
%6 = load i32, i32* @dirty_buffer.todirty
%7 = add nsw i32 %6, 1
store i32 %7, i32* @dirty_buffer.todirty
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
store i32 %4, i32* %9
%10 = load i32, i32* @dirty_buffer.todirty
%11 = sext i32 %10 to i64
%12 = icmp eq i64 %11, 4096
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 0, i32* @dirty_buffer.todirty
br label %14
14: ; preds = %13, %1
ret void
}

LLVM IR (-O2):
@dirty_buffer.todirty = internal unnamed_addr global i32 0
define void @dirty_buffer(i32* nocapture writeonly %0) {
%2 = tail call i64 (...) @random()
%3 = trunc i64 %2 to i32
%4 = load i32, i32* @dirty_buffer.todirty
%5 = add nsw i32 %4, 1
store i32 %5, i32* @dirty_buffer.todirty
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %3, i32* %7
%8 = icmp eq i32 %5, 4096
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* @dirty_buffer.todirty
br label %10
10: ; preds = %9, %1
ret void
}
void stopints() { asm("cli"); }


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

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

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

LLVM IR (-O2):
define void @stopints() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned long WatchdogValueGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000004))));
}


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

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

LLVM IR (-O0):
define i64 @WatchdogValueGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @WatchdogValueGet(i64 %0) {
%2 = add i64 %0, 4
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ g(int /*<<< orphan*/);
void testMacro(void) { g(0); }


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

x86 assembly (clang, -O2):
<testMacro>:
xor    %edi,%edi
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @testMacro() {
%1 = call i32 @g(i32 0)
ret void
}

LLVM IR (-O2):
define void @testMacro() {
%1 = tail call i32 @g(i32 0)
ret void
}
void outportb(unsigned short _port, unsigned char _data) {
  asm volatile("outb %1, %0" : : "dN"(_port), "a"(_data));
}


x86 assembly (clang, -O0):
<outportb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x3(%rbp),%al
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outportb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outportb(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
%6 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @outportb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb $1, $0", "{dx}N,{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i8 %1)
ret void
}
int test_imm_B3int64_lowword_reg(long long val) {
  return ((val) & (0xB3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B3int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 179
%5 = icmp ne i64 %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_B3int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 179
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void test_no_clause() {
  int i;
#pragma omp target parallel for simd
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target parallel for simd
  ++i;
}


x86 assembly (clang, -O0):
<test_no_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_no_clause+0x28>
jmp    111a <test_no_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_no_clause+0xb>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_no_clause() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 16
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
ret void
}

LLVM IR (-O2):
define void @test_no_clause() {
ret void
}
/* Variables and functions */
int lib_func();
int /*<<< orphan*/ printf(char *, int);
int student_func(int);
int main(void) {
  int temp = lib_func();
  int temp2 = student_func(temp);
  printf("%d\n", temp2);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @lib_func()
%2 = tail call i32 @student_func(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Print();
int /*<<< orphan*/ fork();
int main(int argc, char **argv) {
  fork();
  Print();
  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    $0x0,%al
call   1040 <fork@plt>
mov    $0x0,%al
call   1030 <Print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
xor    %eax,%eax
call   1030 <Print@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 (...) @fork()
%7 = call i32 (...) @Print()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fork()
%4 = tail call i32 (...) @Print()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add_entry(char *, char *);
void populate_census() {
  add_entry("Allen Comp Sci", "AllenCompSci");
  add_entry("Maxwell Cody", "MaxwellCody");
}


x86 assembly (clang, -O0):
<populate_census>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
call   1030 <add_entry@plt>
lea    0xeee(%rip),%rdi
lea    0xef4(%rip),%rsi
call   1030 <add_entry@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<populate_census>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef0(%rip),%rsi
call   1030 <add_entry@plt>
lea    0xef1(%rip),%rdi
lea    0xef7(%rip),%rsi
pop    %rax
jmp    1030 <add_entry@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Allen Comp Sci\00"
@.str.1 = [13 x i8] c"AllenCompSci\00"
@.str.2 = [13 x i8] c"Maxwell Cody\00"
@.str.3 = [12 x i8] c"MaxwellCody\00"
define void @populate_census() {
%1 = call i32 @add_entry(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @add_entry(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Allen Comp Sci\00"
@.str.1 = [13 x i8] c"AllenCompSci\00"
@.str.2 = [13 x i8] c"Maxwell Cody\00"
@.str.3 = [12 x i8] c"MaxwellCody\00"
define void @populate_census() {
%1 = tail call i32 @add_entry(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @add_entry(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void machine_check_handler(struct exception_info *info) {
  asm volatile("" : : :);
  asm volatile("hlt");
}


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

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

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

LLVM IR (-O2):
%struct.exception_info = type opaque
define void @machine_check_handler(%struct.exception_info* nocapture readnone %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int setup_client(unsigned port) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setup_client(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_exit_func_2(void) { printf("my_exit_func_2\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"my_exit_func_2\00"
define void @my_exit_func_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int sys_stub(int /*<<< orphan*/);
int sys_close(int fd) {
  ;
  return sys_stub(EBADF);
}


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

x86 assembly (clang, -O2):
<sys_close>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sys_stub@plt>

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

LLVM IR (-O2):
@EBADF = global i32 0
define i32 @sys_close(i32 %0) {
%2 = load i32, i32* @EBADF
%3 = tail call i32 @sys_stub(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t roundup(uint32_t num, uint32_t multiple) {
  return (num + multiple - 1) / multiple;
}


x86 assembly (clang, -O0):
<roundup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @roundup(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 = add nsw i32 %5, %6
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @roundup(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sdiv i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ subdivideEdge(int, int);
void initialSubdivision() {
  subdivideEdge(0, 3);
  subdivideEdge(1, 4);
  subdivideEdge(2, 5);
}


x86 assembly (clang, -O0):
<initialSubdivision>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <subdivideEdge@plt>
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <subdivideEdge@plt>
mov    $0x2,%edi
mov    $0x5,%esi
call   1030 <subdivideEdge@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialSubdivision>:
push   %rax
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <subdivideEdge@plt>
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <subdivideEdge@plt>
mov    $0x2,%edi
mov    $0x5,%esi
pop    %rax
jmp    1030 <subdivideEdge@plt>

LLVM IR (-O0):
define void @initialSubdivision() {
%1 = call i32 @subdivideEdge(i32 0, i32 3)
%2 = call i32 @subdivideEdge(i32 1, i32 4)
%3 = call i32 @subdivideEdge(i32 2, i32 5)
ret void
}

LLVM IR (-O2):
define void @initialSubdivision() {
%1 = tail call i32 @subdivideEdge(i32 0, i32 3)
%2 = tail call i32 @subdivideEdge(i32 1, i32 4)
%3 = tail call i32 @subdivideEdge(i32 2, i32 5)
ret void
}
/* Type definitions */
typedef void (*funcptr)();
typedef void (*HANDLER)(int);

/* Variables and functions */
int /*<<< orphan*/ print();
int /*<<< orphan*/ printf(char *, float, ...);
int /*<<< orphan*/ stub1();
void stub2();
void main() {
  float((f));
  float *g(), (*h)();
  float fm;
  ((f)) = 2.1;
  printf("((f)) = %f\n", ((f)));
  fm = 2.1;
  f = 2.2;
  printf("fm = %f,f = %f\n", fm, f);
  print();
  (*print)();
  typedef void (*funcptr)();
  (*(funcptr)print)();
  typedef void (*HANDLER)(int);
  HANDLER signal(int, HANDLER);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  0xed4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xec7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xea3(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe9d(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <print@plt>
mov    $0x0,%al
call   1040 <print@plt>
mov    $0x0,%al
call   1040 <print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
movss  0xed0(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
movsd  0xec2(%rip),%xmm1
movss  0xeb2(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <print@plt>
xor    %eax,%eax
call   1040 <print@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <print@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"((f)) = %f\0A\00"
@.str.1 = [16 x i8] c"fm = %f,f = %f\0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float (...)*
%3 = alloca float
store float 0x4000CCCCC0000000, float* %1
%4 = load float, float* %1
%5 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %4)
store float 0x4000CCCCC0000000, float* %3
store float 0x40019999A0000000, float* %1
%6 = load float, float* %3
%7 = load float, float* %1
%8 = fpext float %7 to double
%9 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float %6, double %8)
%10 = call i32 (...) @print()
%11 = call i32 (...) @print()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"((f)) = %f\0A\00"
@.str.1 = [16 x i8] c"fm = %f,f = %f\0A\00"
define void @main() {
%1 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float 0x4000CCCCC0000000)
%2 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), float 0x4000CCCCC0000000, double 0x40019999A0000000)
%3 = tail call i32 (...) @print()
%4 = tail call i32 (...) @print()
tail call void (...) bitcast (i32 (...)* @print to void (...)*)()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_SETLK;
int _create_locked_cmd(char *, int /*<<< orphan*/);
int pmix_create_locked(char *path) { return _create_locked_cmd(path, F_SETLK); }


x86 assembly (clang, -O0):
<pmix_create_locked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <_create_locked_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmix_create_locked>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <_create_locked_cmd@plt>

LLVM IR (-O0):
@F_SETLK = global i32 0
define i32 @pmix_create_locked(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_SETLK
%5 = call i32 @_create_locked_cmd(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@F_SETLK = global i32 0
define i32 @pmix_create_locked(i8* %0) {
%2 = load i32, i32* @F_SETLK
%3 = tail call i32 @_create_locked_cmd(i8* %0, i32 %2)
ret i32 %3
}
int mycmp(const void *a, const void *b) {
  const unsigned int *s = a;
  const unsigned int *t = b;
  if (*s > *t)
    return -1;
  else if (*s == *t)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<mycmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jbe    113a <mycmp+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <mycmp+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    1158 <mycmp+0x58>
movl   $0x0,-0x4(%rbp)
jmp    115f <mycmp+0x5f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mycmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ugt i32 %5, %6
%8 = icmp ne i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fn3();
void fn2(void) { fn3(); }


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

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

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

LLVM IR (-O2):
define void @fn2() {
%1 = tail call i32 (...) @fn3()
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, ...);
void handle_signal(int sig) {
  do {
    printf("[%d]--", getpid());
    printf("handle signal : [%d]\n", sig);
    printf("\n");
  } while (0);
}


x86 assembly (clang, -O0):
<handle_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_signal>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"[%d]--\00"
@.str.1 = [22 x i8] c"handle signal : [%d]\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @handle_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = call i32 (...) @getpid()
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"[%d]--\00"
@.str.1 = [22 x i8] c"handle signal : [%d]\0A\00"
define void @handle_signal(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%5 = tail call i32 @putchar(i32 10)
ret void
}
_Complex long long foo_long_long(_Complex long long x) { return x; }


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

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

LLVM IR (-O0):
define { i64, i64 } @foo_long_long(i64 %0, i64 %1) {
%3 = alloca { i64, i64 }
%4 = alloca { i64, i64 }
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
%8 = load i64, i64* %7
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
%10 = load i64, i64* %9
%11 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %3, i32 0, i32 0
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %3, i32 0, i32 1
store i64 %8, i64* %11
store i64 %10, i64* %12
%13 = load { i64, i64 }, { i64, i64 }* %3
ret { i64, i64 } %13
}

LLVM IR (-O2):
define { i64, i64 } @foo_long_long(i64 %0, i64 %1) {
%3 = insertvalue { i64, i64 } poison, i64 %0, 0
%4 = insertvalue { i64, i64 } %3, i64 %1, 1
ret { i64, i64 } %4
}
void UpdateWeights(short stage) {}


x86 assembly (clang, -O0):
<UpdateWeights>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @UpdateWeights(i16 signext %0) {
ret void
}
int test_imm_CFint64_lowword_mem(long long *val) {
  return ((*val) & (0xCF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CFint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 207
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ wait(int *);
void sig_chld(int signo __attribute__((unused))) {
  pid_t pid;
  int stat;
  pid = wait(&stat);
  return;
}


x86 assembly (clang, -O0):
<sig_chld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <wait@plt>
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_chld>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <wait@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @sig_chld(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @wait(i32* %2)
ret void
}
/* Type definitions */
struct file {
  int dummy;
};

/* Variables and functions */
scalar_t__ argfd(int /*<<< orphan*/, int /*<<< orphan*/, struct file **);
int fdalloc(struct file *);
int /*<<< orphan*/ filedup(struct file *);
int sys_dup(void) {
  struct file *f;
  int fd;
  if (argfd(0, 0, &f) < 0) {
    return -1;
  }
  if ((fd = fdalloc(f)) < 0) {
    return -1;
  }
  filedup(f);
  return fd;
}


x86 assembly (clang, -O0):
<sys_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %esi,%esi
lea    -0x10(%rbp),%rdx
mov    %esi,%edi
call   1050 <argfd@plt>
cmp    $0x0,%rax
jge    115b <sys_dup+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    118b <sys_dup+0x5b>
mov    -0x10(%rbp),%rdi
call   1040 <fdalloc@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    117c <sys_dup+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    118b <sys_dup+0x5b>
mov    -0x10(%rbp),%rdi
call   1030 <filedup@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_dup>:
push   %rbp
push   %rbx
push   %rax
mov    %rsp,%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1050 <argfd@plt>
mov    $0xffffffff,%ebx
test   %rax,%rax
js     1163 <sys_dup+0x33>
mov    (%rsp),%rdi
call   1040 <fdalloc@plt>
test   %eax,%eax
js     1163 <sys_dup+0x33>
mov    %eax,%ebp
mov    (%rsp),%rdi
call   1030 <filedup@plt>
mov    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.file = type { i32 }
define i32 @sys_dup() {
%1 = alloca i32
%2 = alloca %struct.file*
%3 = alloca i32
%4 = call i64 @argfd(i32 0, i32 0, %struct.file** %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %16
7: ; preds = %0
%8 = load %struct.file*, %struct.file** %2
%9 = call i32 @fdalloc(%struct.file* %8)
store i32 %9, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 -1, i32* %1
br label %16
12: ; preds = %7
%13 = load %struct.file*, %struct.file** %2
%14 = call i32 @filedup(%struct.file* %13)
%15 = load i32, i32* %3
store i32 %15, i32* %1
br label %16
16: ; preds = %12, %11, %6
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
%struct.file = type { i32 }
define i32 @sys_dup() {
%1 = alloca %struct.file*
%2 = bitcast %struct.file** %1 to i8*
%3 = call i64 @argfd(i32 0, i32 0, %struct.file** %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %0
%6 = load %struct.file*, %struct.file** %1
%7 = call i32 @fdalloc(%struct.file* %6)
%8 = icmp slt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = load %struct.file*, %struct.file** %1
%11 = call i32 @filedup(%struct.file* %10)
br label %12
12: ; preds = %5, %0, %9
%13 = phi i32 [ %7, %9 ], [ -1, %0 ], [ -1, %5 ]
ret i32 %13
}
char const *getprogname(void) { return ""; }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @getprogname() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @getprogname() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct PMC {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
void Parrot_gc_mark_PMC_alive_fun(int *interp, struct PMC *pmc) { abort(); }


x86 assembly (clang, -O0):
<Parrot_gc_mark_PMC_alive_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<Parrot_gc_mark_PMC_alive_fun>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.PMC = type { i32 }
define void @Parrot_gc_mark_PMC_alive_fun(i32* %0, %struct.PMC* %1) {
%3 = alloca i32*
%4 = alloca %struct.PMC*
store i32* %0, i32** %3
store %struct.PMC* %1, %struct.PMC** %4
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.PMC = type { i32 }
define void @Parrot_gc_mark_PMC_alive_fun(i32* nocapture readnone %0, %struct.PMC* nocapture readnone %1) {
%3 = tail call i32 (...) @abort()
unreachable
}
int host_request_exec_path(char *buffer, int max_buffer_size) {
  int ret;
  memset(buffer, 0, max_buffer_size);
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, "
                       "0x20"
                       "\n"
                       ".byte "
                       "0x00"
                       ", 0x00\n"
                       ".byte 0x00, 0x00, 0x00\n"
                       ".byte 0x00\n"
                       : "=a"(ret)
                       : "a"(buffer), "b"(max_buffer_size));
  return ret;
}


x86 assembly (clang, -O0):
<host_request_exec_path>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ebx
(bad)
add    %ah,(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    %al,(%rax)
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_request_exec_path>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rbx
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
(bad)
add    %ah,(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @host_request_exec_path(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x20\0A.byte 0x00, 0x00\0A.byte 0x00, 0x00, 0x00\0A.byte 0x00\0A", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i8* %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @host_request_exec_path(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %3, i1 false)
%4 = tail call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x20\0A.byte 0x00, 0x00\0A.byte 0x00, 0x00, 0x00\0A.byte 0x00\0A", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ XMapRequestEvent;

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


x86 assembly (clang, -O0):
<alloc_XMapRequestEvent>:
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_XMapRequestEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @alloc_XMapRequestEvent() {
%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_XMapRequestEvent() {
%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
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  long event_mask;
};
typedef TYPE_1__ XSetWindowAttributes;

/* Variables and functions */
void set_XSetWindowAttributes_event_mask(void *_p, long _v) {
  ((XSetWindowAttributes *)_p)->event_mask = (long)_v;
}


x86 assembly (clang, -O0):
<set_XSetWindowAttributes_event_mask>:
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_XSetWindowAttributes_event_mask>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XSetWindowAttributes_event_mask(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_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XSetWindowAttributes_event_mask(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
__attribute__((always_)) int fls(int x) {
  int r;
  asm("bsrl %1,%0\n\t"
      "jnz 1f\n\t"
      "movl $-1,%0\n"
      "1:"
      : "=r"(r)
      : "rm"(x));
  return r + 1;
}


x86 assembly (clang, -O0):
<fls>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
bsr    -0xc(%rbp),%eax
jne    111c <fls+0x1c>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fls>:
mov    %edi,-0x4(%rsp)
bsr    -0x4(%rsp),%eax
jne    1110 <fls+0x10>
mov    $0xffffffff,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @fls(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "bsrl $1,$0\0A\09jnz 1f\0A\09movl $$-1,$0\0A1:", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @fls(i32 %0) {
%2 = tail call i32 asm "bsrl $1,$0\0A\09jnz 1f\0A\09movl $$-1,$0\0A1:", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
void TermHGraf() {}


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

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

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

LLVM IR (-O2):
define void @TermHGraf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++)
    printf("argv[%d]: %s\n", i, argv[i]);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1172 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1157 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <main+0x20>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"argv[%d]: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct BoolExpr {
  int dummy;
};

/* Variables and functions */
bool _eq(struct BoolExpr *a, struct BoolExpr *b) { return (a == b); }


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

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

LLVM IR (-O0):
%struct.BoolExpr = type { i32 }
define i32 @_eq(%struct.BoolExpr* %0, %struct.BoolExpr* %1) {
%3 = alloca %struct.BoolExpr*
%4 = alloca %struct.BoolExpr*
store %struct.BoolExpr* %0, %struct.BoolExpr** %3
store %struct.BoolExpr* %1, %struct.BoolExpr** %4
%5 = load %struct.BoolExpr*, %struct.BoolExpr** %3
%6 = load %struct.BoolExpr*, %struct.BoolExpr** %4
%7 = icmp eq %struct.BoolExpr* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.BoolExpr = type { i32 }
define i32 @_eq(%struct.BoolExpr* readnone %0, %struct.BoolExpr* readnone %1) {
%3 = icmp eq %struct.BoolExpr* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
OP(fd, a9) { op_a9(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_a9()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ gen_defindex(int);
void cm_defcodeindex(void) { gen_defindex(1); }


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

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

LLVM IR (-O0):
define void @cm_defcodeindex() {
%1 = call i32 @gen_defindex(i32 1)
ret void
}

LLVM IR (-O2):
define void @cm_defcodeindex() {
%1 = tail call i32 @gen_defindex(i32 1)
ret void
}
/* Variables and functions */
int isalnum(int);
int ISALNUM(int ch) { return isalnum(ch); }


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

x86 assembly (clang, -O2):
<ISALNUM>:
jmp    1030 <isalnum@plt>

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

LLVM IR (-O2):
define i32 @ISALNUM(i32 %0) {
%2 = tail call i32 @isalnum(i32 %0)
ret i32 %2
}
int signum_fun_int(int a) { return (a != 0) | (a >> 31); }


x86 assembly (clang, -O0):
<signum_fun_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_fun_int>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
sar    $0x1f,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @signum_fun_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = load i32, i32* %2
%7 = ashr i32 %6, 31
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @signum_fun_int(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = ashr i32 %0, 31
%5 = or i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print(void) { printf("hello world !\n"); }


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

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

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

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