xunge/DecIR huggingface dataset:
int drm_create_iommu_mapping(struct drm_device *drm_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.drm_device = type opaque
define i32 @drm_create_iommu_mapping(%struct.drm_device* nocapture readnone %0) {
ret i32 0
}
void fn0(void) {}


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

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

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

LLVM IR (-O2):
define void @fn0() {
ret void
}
unsigned long read_verilog_time() {
  unsigned long tick_time;
  tick_time = (*(volatile unsigned char *)0x0034);
  tick_time = ((tick_time << 8) + (*(volatile unsigned char *)0x0030));
  tick_time = ((tick_time << 8) + (*(volatile unsigned char *)0x001C));
  tick_time = ((tick_time << 8) + (*(volatile unsigned char *)0x0018));
  return tick_time;
}


x86 assembly (clang, -O0):
<read_verilog_time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%eax
mov    (%rax),%al
movzbl %al,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x8,%rax
mov    $0x30,%ecx
mov    (%rcx),%cl
movzbl %cl,%ecx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x8,%rax
mov    $0x1c,%ecx
mov    (%rcx),%cl
movzbl %cl,%ecx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x8,%rax
mov    $0x18,%ecx
mov    (%rcx),%cl
movzbl %cl,%ecx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_verilog_time>:
movzbl 0x34,%eax
movzbl 0x30,%ecx
shl    $0x10,%rax
shl    $0x8,%rcx
or     %rax,%rcx
movzbl 0x1c,%edx
or     %rcx,%rdx
shl    $0x8,%rdx
movzbl 0x18,%eax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @read_verilog_time() {
%1 = alloca i64
%2 = load volatile i8, i8* inttoptr (i64 52 to i8*)
%3 = zext i8 %2 to i64
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = shl i64 %4, 8
%6 = load volatile i8, i8* inttoptr (i64 48 to i8*)
%7 = zext i8 %6 to i64
%8 = add i64 %5, %7
store i64 %8, i64* %1
%9 = load i64, i64* %1
%10 = shl i64 %9, 8
%11 = load volatile i8, i8* inttoptr (i64 28 to i8*)
%12 = zext i8 %11 to i64
%13 = add i64 %10, %12
store i64 %13, i64* %1
%14 = load i64, i64* %1
%15 = shl i64 %14, 8
%16 = load volatile i8, i8* inttoptr (i64 24 to i8*)
%17 = zext i8 %16 to i64
%18 = add i64 %15, %17
store i64 %18, i64* %1
%19 = load i64, i64* %1
ret i64 %19
}

LLVM IR (-O2):
define i64 @read_verilog_time() {
%1 = load volatile i8, i8* inttoptr (i64 52 to i8*)
%2 = zext i8 %1 to i64
%3 = load volatile i8, i8* inttoptr (i64 48 to i8*)
%4 = zext i8 %3 to i64
%5 = shl nuw nsw i64 %2, 16
%6 = shl nuw nsw i64 %4, 8
%7 = or i64 %6, %5
%8 = load volatile i8, i8* inttoptr (i64 28 to i8*)
%9 = zext i8 %8 to i64
%10 = or i64 %7, %9
%11 = shl nuw nsw i64 %10, 8
%12 = load volatile i8, i8* inttoptr (i64 24 to i8*)
%13 = zext i8 %12 to i64
%14 = or i64 %11, %13
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void stack_underflow(void) {
  printf("Parentheses/braces are not nested properly\n");
  exit(1);
}


x86 assembly (clang, -O0):
<stack_underflow>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<stack_underflow>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Parentheses/braces are not nested properly\0A\00"
define void @stack_underflow() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [43 x i8] c"Parentheses/braces are not nested properly\00"
define void @stack_underflow() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int is_power_two(unsigned n) { return (n & (n - 1)) == 0; }


x86 assembly (clang, -O0):
<is_power_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_two>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_power_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_power_two(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SYS_kill;
int syscall_1(int /*<<< orphan*/, int);
int kill(int pid) { return syscall_1(SYS_kill, pid); }


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

x86 assembly (clang, -O2):
<kill>:
mov    %edi,%esi
mov    0x2edf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall_1@plt>

LLVM IR (-O0):
@SYS_kill = global i32 0
define i32 @kill(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SYS_kill
%4 = load i32, i32* %2
%5 = call i32 @syscall_1(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SYS_kill = global i32 0
define i32 @kill(i32 %0) {
%2 = load i32, i32* @SYS_kill
%3 = tail call i32 @syscall_1(i32 %2, i32 %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int w5100_write(int, int /*<<< orphan*/ *, int);
unsigned w5100_writeSUBR(uint8_t *buff) { return w5100_write(0x0005, buff, 4); }


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

x86 assembly (clang, -O2):
mov    %rdi,%rsi
mov    $0x5,%edi
mov    $0x4,%edx
jmp    1030 <w5100_write@plt>

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

LLVM IR (-O2):
define i32 @w5100_writeSUBR(i32* %0) {
%2 = tail call i32 @w5100_write(i32 5, i32* %0, i32 4)
ret i32 %2
}
/* Variables and functions */
unsigned char *dh_compute_shared_key(unsigned char *, unsigned char const *,
                                     size_t, unsigned char const *, size_t);
unsigned char *ke_dh_shared(unsigned char *shared, const unsigned char *pub,
                            size_t pub_size, const unsigned char *priv,
                            size_t priv_size) {
  return dh_compute_shared_key(shared, pub, pub_size, priv, priv_size);
}


x86 assembly (clang, -O0):
<ke_dh_shared>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <dh_compute_shared_key@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ke_dh_shared>:
jmp    1030 <dh_compute_shared_key@plt>

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

LLVM IR (-O2):
define i8* @ke_dh_shared(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @dh_compute_shared_key(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
/* Variables and functions */
void *get_memory_from_pool(int);
void *page_alloc(int num_pages) { return get_memory_from_pool(num_pages); }


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

x86 assembly (clang, -O2):
<page_alloc>:
jmp    1030 <get_memory_from_pool@plt>

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

LLVM IR (-O2):
define i8* @page_alloc(i32 %0) {
%2 = tail call i8* @get_memory_from_pool(i32 %0)
ret i8* %2
}
int LOP2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @LOP2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, int);
scalar_t__ strend(char const *, char const *);
void strend_test(const char *str, const char *tail) {
  printf("strend (%s, %s) = %d\n", str, tail, (int)strend(str, tail));
}


x86 assembly (clang, -O0):
<strend_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strend@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strend_test>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strend@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"strend (%s, %s) = %d\0A\00"
define void @strend_test(i8* %0, i8* %1) {
%3 = tail call i64 @strend(i8* %0, i8* %1)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ value_as_float(unsigned int);
unsigned int value_as_int(scalar_t__);
unsigned int add_func(unsigned int param1, unsigned int param2) {
  return value_as_int(value_as_float(param1) + value_as_float(param2));
}


x86 assembly (clang, -O0):
<add_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <value_as_float@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <value_as_float@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
call   1040 <value_as_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_func>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <value_as_float@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <value_as_float@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <value_as_int@plt>

LLVM IR (-O0):
define i32 @add_func(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 = call i64 @value_as_float(i32 %5)
%7 = load i32, i32* %4
%8 = call i64 @value_as_float(i32 %7)
%9 = add nsw i64 %6, %8
%10 = call i32 @value_as_int(i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @add_func(i32 %0, i32 %1) {
%3 = tail call i64 @value_as_float(i32 %0)
%4 = tail call i64 @value_as_float(i32 %1)
%5 = add nsw i64 %4, %3
%6 = tail call i32 @value_as_int(i64 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ calculateTriangularNumber(int);
int main(void) {
  calculateTriangularNumber(10);
  calculateTriangularNumber(20);
  calculateTriangularNumber(30);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @calculateTriangularNumber(i32 10)
%3 = call i32 @calculateTriangularNumber(i32 20)
%4 = call i32 @calculateTriangularNumber(i32 30)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @calculateTriangularNumber(i32 10)
%2 = tail call i32 @calculateTriangularNumber(i32 20)
%3 = tail call i32 @calculateTriangularNumber(i32 30)
ret i32 0
}
int isspace(int c) { return (c == 0x20) || ((c >= 0x09) && (c <= 0x0d)); }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1135 <isspace+0x35>
xor    %eax,%eax
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     112f <isspace+0x2f>
cmpl   $0xd,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
sete   %al
add    $0xfffffff7,%edi
cmp    $0x5,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = add i32 %0, -9
%4 = icmp ult i32 %3, 5
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ dump_generations();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ print_string(char *);
void out_of_memory(void) {
  print_string("Out of memory\n\n");
  dump_generations();
  exit(1);
}


x86 assembly (clang, -O0):
<out_of_memory>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x0,%al
call   1040 <dump_generations@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<out_of_memory>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <print_string@plt>
xor    %eax,%eax
call   1040 <dump_generations@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory\0A\0A\00"
define void @out_of_memory() {
%1 = call i32 @print_string(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @dump_generations()
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory\0A\0A\00"
define void @out_of_memory() {
%1 = tail call i32 @print_string(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @dump_generations()
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned short NumberOnly();
int /*<<< orphan*/ WriteInstruction(char *);
int /*<<< orphan*/ WriteNumber(unsigned short);
void CR_FillDown(void) {
  unsigned short int nNum = NumberOnly();
  WriteInstruction("ld b,");
  WriteNumber(nNum);
  WriteInstruction("call filld");
}


x86 assembly (clang, -O0):
<CR_FillDown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <NumberOnly@plt>
mov    %ax,-0x2(%rbp)
lea    0xeb6(%rip),%rdi
call   1040 <WriteInstruction@plt>
movzwl -0x2(%rbp),%edi
call   1030 <WriteNumber@plt>
lea    0xea7(%rip),%rdi
call   1040 <WriteInstruction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_FillDown>:
push   %rbx
xor    %eax,%eax
call   1050 <NumberOnly@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
call   1040 <WriteInstruction@plt>
movzwl %bx,%edi
call   1030 <WriteNumber@plt>
lea    0xeb1(%rip),%rdi
pop    %rbx
jmp    1040 <WriteInstruction@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ld b,\00"
@.str.1 = [11 x i8] c"call filld\00"
define void @CR_FillDown() {
%1 = alloca i16
%2 = call zeroext i16 (...) @NumberOnly()
store i16 %2, i16* %1
%3 = call i32 @WriteInstruction(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i16, i16* %1
%5 = call i32 @WriteNumber(i16 zeroext %4)
%6 = call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ld b,\00"
@.str.1 = [11 x i8] c"call filld\00"
define void @CR_FillDown() {
%1 = tail call zeroext i16 (...) @NumberOnly()
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @WriteNumber(i16 zeroext %1)
%4 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dumb_set_cell(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ make_cell(int, char);
void dumb_set_picture_cell(int row, int col, char c) {
  dumb_set_cell(row, col, make_cell(16, c));
}


x86 assembly (clang, -O0):
<dumb_set_picture_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x10,%edi
movsbl -0x9(%rbp),%esi
call   1030 <make_cell@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    %eax,%edx
call   1040 <dumb_set_cell@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumb_set_picture_cell>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x10,%edi
mov    %edx,%esi
call   1030 <make_cell@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <dumb_set_cell@plt>

LLVM IR (-O0):
define void @dumb_set_picture_cell(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8, i8* %6
%10 = call i32 @make_cell(i32 16, i8 signext %9)
%11 = call i32 @dumb_set_cell(i32 %7, i32 %8, i32 %10)
ret void
}

LLVM IR (-O2):
define void @dumb_set_picture_cell(i32 %0, i32 %1, i8 signext %2) {
%4 = tail call i32 @make_cell(i32 16, i8 signext %2)
%5 = tail call i32 @dumb_set_cell(i32 %0, i32 %1, i32 %4)
ret void
}
void init_add_rel_mask_color_pt_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_add_rel_mask_color_pt_funcs_c() {
ret void
}
void draw_text(int x, int y, char *string) {}


x86 assembly (clang, -O0):
<draw_text>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @draw_text(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
float __ieee754_sqrtf(int);
void benchmark(void) {
  volatile float result = 0;
  result = __ieee754_sqrtf(2);
  result = __ieee754_sqrtf(3);
  result = __ieee754_sqrtf(5);
  result = __ieee754_sqrtf(6);
  result = __ieee754_sqrtf(7);
  result = __ieee754_sqrtf(8);
}


x86 assembly (clang, -O0):
<benchmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <__ieee754_sqrtf@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x3,%edi
call   1030 <__ieee754_sqrtf@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x5,%edi
call   1030 <__ieee754_sqrtf@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x6,%edi
call   1030 <__ieee754_sqrtf@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x7,%edi
call   1030 <__ieee754_sqrtf@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x8,%edi
call   1030 <__ieee754_sqrtf@plt>
movss  %xmm0,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    $0x2,%edi
call   1030 <__ieee754_sqrtf@plt>
movss  %xmm0,0x4(%rsp)
mov    $0x3,%edi
call   1030 <__ieee754_sqrtf@plt>
movss  %xmm0,0x4(%rsp)
mov    $0x5,%edi
call   1030 <__ieee754_sqrtf@plt>
movss  %xmm0,0x4(%rsp)
mov    $0x6,%edi
call   1030 <__ieee754_sqrtf@plt>
movss  %xmm0,0x4(%rsp)
mov    $0x7,%edi
call   1030 <__ieee754_sqrtf@plt>
movss  %xmm0,0x4(%rsp)
mov    $0x8,%edi
call   1030 <__ieee754_sqrtf@plt>
movss  %xmm0,0x4(%rsp)
pop    %rax
ret

LLVM IR (-O0):
define void @benchmark() {
%1 = alloca float
store volatile float 0.000000e+00, float* %1
%2 = call float @__ieee754_sqrtf(i32 2)
store volatile float %2, float* %1
%3 = call float @__ieee754_sqrtf(i32 3)
store volatile float %3, float* %1
%4 = call float @__ieee754_sqrtf(i32 5)
store volatile float %4, float* %1
%5 = call float @__ieee754_sqrtf(i32 6)
store volatile float %5, float* %1
%6 = call float @__ieee754_sqrtf(i32 7)
store volatile float %6, float* %1
%7 = call float @__ieee754_sqrtf(i32 8)
store volatile float %7, float* %1
ret void
}

LLVM IR (-O2):
define void @benchmark() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store volatile float 0.000000e+00, float* %1
%3 = tail call float @__ieee754_sqrtf(i32 2)
store volatile float %3, float* %1
%4 = tail call float @__ieee754_sqrtf(i32 3)
store volatile float %4, float* %1
%5 = tail call float @__ieee754_sqrtf(i32 5)
store volatile float %5, float* %1
%6 = tail call float @__ieee754_sqrtf(i32 6)
store volatile float %6, float* %1
%7 = tail call float @__ieee754_sqrtf(i32 7)
store volatile float %7, float* %1
%8 = tail call float @__ieee754_sqrtf(i32 8)
store volatile float %8, float* %1
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_multprec_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(492, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_multprec_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1ec,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_multprec_target_system>:
mov    $0x1ec,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @write_multprec_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 492, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_multprec_target_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 492, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void gtk_tree_row_reference_free() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_row_reference_free() {
ret void
}
/* Variables and functions */
scalar_t__ ECHILD;
scalar_t__ errno;
int /*<<< orphan*/ exec(char *);
scalar_t__ wait(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  exec("./one");
  while (wait(NULL))
    if (errno == ECHILD)
      break;
  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)
lea    0xec3(%rip),%rdi
call   1030 <exec@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <wait@plt>
cmp    $0x0,%rax
je     1179 <main+0x59>
mov    0x2e84(%rip),%rax
mov    (%rax),%rax
mov    0x2e72(%rip),%rcx
cmp    (%rcx),%rax
jne    1174 <main+0x54>
jmp    1179 <main+0x59>
jmp    1142 <main+0x22>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <exec@plt>
mov    0x2ea9(%rip),%r14
mov    0x2e9a(%rip),%rbx
xchg   %ax,%ax
xor    %edi,%edi
call   1040 <wait@plt>
test   %rax,%rax
je     1154 <main+0x34>
mov    (%r14),%rax
cmp    (%rbx),%rax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"./one\00"
@errno = global i64 0
@ECHILD = global i64 0
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 @exec(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %15, %2
%8 = call i64 @wait(i32* null)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i64, i64* @errno
%12 = load i64, i64* @ECHILD
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
br label %16
15: ; preds = %10
br label %7
16: ; preds = %14, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"./one\00"
@errno = global i64 0
@ECHILD = global i64 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exec(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %7, %2
%5 = tail call i64 @wait(i32* null)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @ECHILD
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %7, %4
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int __api(int, unsigned long);
int rt_reg_run(struct timeval *tv) {
  unsigned long ms = tv->tv_sec * 1000 + tv->tv_usec / 1000;
  return (__api(14, ms) == 1) ? 0 : 1;
}


x86 assembly (clang, -O0):
<rt_reg_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0xe,%edi
call   1030 <__api@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_reg_run>:
push   %rax
movslq (%rdi),%rax
imul   $0x3e8,%rax,%rax
movslq 0x4(%rdi),%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
movslq %ecx,%rsi
add    %rax,%rsi
mov    $0xe,%edi
call   1030 <__api@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @rt_reg_run(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca i64
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %7, %11
%13 = sext i32 %12 to i64
store i64 %13, i64* %3
%14 = load i64, i64* %3
%15 = call i32 @__api(i32 14, i64 %14)
%16 = icmp eq i32 %15, 1
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 0, i32 1
ret i32 %18
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @rt_reg_run(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000
%8 = add nsw i32 %7, %4
%9 = sext i32 %8 to i64
%10 = tail call i32 @__api(i32 14, i64 %9)
%11 = icmp ne i32 %10, 1
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
double acos(double);
double d_acos(double *x) { return (acos(*x)); }


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

x86 assembly (clang, -O2):
<d_acos>:
movsd  (%rdi),%xmm0
jmp    1030 <acos@plt>

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

LLVM IR (-O2):
define double @d_acos(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @acos(double %2)
ret double %3
}
void taktik5(int sagSensorDeger, int solSensorDeger, int ortaSensorDeger,
             int sagKenarDeger, int solKenarDeger, int motorHizi) {}


x86 assembly (clang, -O0):
<taktik5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @taktik5(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @taktik5(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret void
}
int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2) { return 0; }


x86 assembly (clang, -O0):
<msm_proc_comm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @msm_proc_comm(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
ret i32 0
}

LLVM IR (-O2):
define i32 @msm_proc_comm(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ nop();
void FP_exit_at_end_of_proc_good() {
  nop();
  exit(5);
}


x86 assembly (clang, -O0):
<FP_exit_at_end_of_proc_good>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <nop@plt>
mov    $0x5,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<FP_exit_at_end_of_proc_good>:
push   %rax
xor    %eax,%eax
call   1030 <nop@plt>
mov    $0x5,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @FP_exit_at_end_of_proc_good() {
%1 = call i32 (...) @nop()
%2 = call i32 @exit(i32 5)
unreachable
}

LLVM IR (-O2):
define void @FP_exit_at_end_of_proc_good() {
%1 = tail call i32 (...) @nop()
%2 = tail call i32 @exit(i32 5)
unreachable
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(scalar_t__, char);
void com_putc(char c) {
  while ((inb(0x3f8 + 5) & 0x20) == 0)
    ;
  outb(0x3f8 + 0, c);
}


x86 assembly (clang, -O0):
<com_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3fd,%edi
call   1040 <inb@plt>
and    $0x20,%eax
cmp    $0x0,%eax
jne    1149 <com_putc+0x29>
jmp    112e <com_putc+0xe>
mov    $0x3f8,%edi
movsbl -0x1(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<com_putc>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x3fd,%edi
call   1040 <inb@plt>
test   $0x20,%al
je     1130 <com_putc+0x10>
movsbl %bl,%esi
mov    $0x3f8,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @com_putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = call i32 @inb(i32 1021)
%5 = and i32 %4, 32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
%10 = call i32 @outb(i64 1016, i8 signext %9)
ret void
}

LLVM IR (-O2):
define void @com_putc(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @inb(i32 1021)
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call i32 @outb(i64 1016, i8 signext %0)
ret void
}
/* Variables and functions */
int sol_network_init();
int /*<<< orphan*/ sol_network_shutdown();
int sol_comms_init(void) {
  int r;
  r = sol_network_init();
  if (r < 0)
    goto network_error;
  return 0;
  sol_network_shutdown();
network_error:
  return -1;
}


x86 assembly (clang, -O0):
<sol_comms_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <sol_network_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <sol_comms_init+0x21>
jmp    113d <sol_comms_init+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <sol_comms_init+0x34>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sol_comms_init>:
push   %rax
xor    %eax,%eax
call   1030 <sol_network_init@plt>
sar    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sol_comms_init() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @sol_network_init()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %9
8: ; preds = %6
store i32 -1, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @sol_comms_init() {
%1 = tail call i32 (...) @sol_network_init()
%2 = ashr i32 %1, 31
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ print_hex1(unsigned char);
void print_hex2(unsigned char v) {
  print_hex1((v >> 4) & 15);
  print_hex1(v & 15);
}


x86 assembly (clang, -O0):
<print_hex2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movzbl %al,%edi
call   1030 <print_hex1@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl %al,%edi
call   1030 <print_hex1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex2>:
push   %rbx
mov    %edi,%ebx
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <print_hex1@plt>
and    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <print_hex1@plt>

LLVM IR (-O0):
define void @print_hex2(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = and i32 %5, 15
%7 = trunc i32 %6 to i8
%8 = call i32 @print_hex1(i8 zeroext %7)
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = and i32 %10, 15
%12 = trunc i32 %11 to i8
%13 = call i32 @print_hex1(i8 zeroext %12)
ret void
}

LLVM IR (-O2):
define void @print_hex2(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = tail call i32 @print_hex1(i8 zeroext %2)
%4 = and i8 %0, 15
%5 = tail call i32 @print_hex1(i8 zeroext %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/);
pid_t getpid(void) { return __syscall(39, 0, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<getpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x27,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <__syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpid>:
push   %rax
movl   $0x0,(%rsp)
mov    $0x27,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <__syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getpid() {
%1 = call i32 @__syscall(i32 39, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getpid() {
%1 = tail call i32 @__syscall(i32 39, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ParseOptGeometry(char *);
int /*<<< orphan*/ diagnostics(int, char *, char *);
int /*<<< orphan*/ free(char *);
char *getBraceParam();
void CmdGeometry(int code) {
  char *options;
  options = getBraceParam();
  if (options) {
    diagnostics(2, "geometry command, argument %s\n", options);
    ParseOptGeometry(options);
    free(options);
  }
}


x86 assembly (clang, -O0):
<CmdGeometry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1188 <CmdGeometry+0x48>
mov    -0x10(%rbp),%rdx
mov    $0x2,%edi
lea    0xe8f(%rip),%rsi
call   1050 <diagnostics@plt>
mov    -0x10(%rbp),%rdi
call   1060 <ParseOptGeometry@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdGeometry>:
push   %rbx
xor    %eax,%eax
call   1040 <getBraceParam@plt>
test   %rax,%rax
je     1175 <CmdGeometry+0x35>
mov    %rax,%rbx
lea    0xea9(%rip),%rsi
mov    $0x2,%edi
mov    %rax,%rdx
call   1050 <diagnostics@plt>
mov    %rbx,%rdi
call   1060 <ParseOptGeometry@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"geometry command, argument %s\0A\00"
define void @CmdGeometry(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* (...) @getBraceParam()
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @diagnostics(i32 2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @ParseOptGeometry(i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
br label %14
14: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"geometry command, argument %s\0A\00"
define void @CmdGeometry(i32 %0) {
%2 = tail call i8* (...) @getBraceParam()
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @diagnostics(i32 2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = tail call i32 @ParseOptGeometry(i8* %2)
%7 = tail call i32 @free(i8* %2)
br label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int ENOSYS;
int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg, ...) {
  return -ENOSYS;
}


x86 assembly (clang, -O0):
<clone>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%eax
neg    %eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clone>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @clone(i32 (i8*)* %0, i8* %1, i32 %2, i8* %3, ...) {
%5 = alloca i32 (i8*)*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i32 (i8*)* %0, i32 (i8*)** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @ENOSYS
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @clone(i32 (i8*)* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, ...) {
%5 = load i32, i32* @ENOSYS
%6 = sub nsw i32 0, %5
ret i32 %6
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int TRDB_D5M_shift_amount(int);
uint16_t TRDB_D5M_WRITE(uint16_t full_reg_value, uint16_t mask,
                        uint16_t write_value) {
  return (full_reg_value & (~mask)) |
         ((write_value << TRDB_D5M_shift_amount(mask)) & mask);
}


x86 assembly (clang, -O0):
<TRDB_D5M_WRITE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <TRDB_D5M_shift_amount@plt>
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
shl    %cl,%edx
mov    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TRDB_D5M_WRITE>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %esi,%edi
call   1030 <TRDB_D5M_shift_amount@plt>
mov    %eax,%ecx
shl    %cl,%ebx
xor    %r14d,%ebx
and    %ebp,%ebx
xor    %r14d,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @TRDB_D5M_WRITE(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = call i32 @TRDB_D5M_shift_amount(i32 %12)
%14 = shl i32 %11, %13
%15 = load i32, i32* %5
%16 = and i32 %14, %15
%17 = or i32 %10, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @TRDB_D5M_WRITE(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, -1
%5 = and i32 %4, %0
%6 = tail call i32 @TRDB_D5M_shift_amount(i32 %1)
%7 = shl i32 %2, %6
%8 = and i32 %7, %1
%9 = or i32 %8, %5
ret i32 %9
}
char test_char_5(char a, char b, char c, char d, char e) { return 0x2; }


x86 assembly (clang, -O0):
<test_char_5>:
push   %rbp
mov    %rsp,%rbp
mov    %r8b,%al
mov    %dil,-0x1(%rbp)
mov    %sil,-0x2(%rbp)
mov    %dl,-0x3(%rbp)
mov    %cl,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0x2,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_char_5>:
mov    $0x2,%al
ret

LLVM IR (-O0):
define signext i8 @test_char_5(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4) {
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8 %0, i8* %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8 %3, i8* %9
store i8 %4, i8* %10
ret i8 2
}

LLVM IR (-O2):
define signext i8 @test_char_5(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4) {
ret i8 2
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_SMOOTH;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
int /*<<< orphan*/ lightc();
void myInit(void) {
  glEnable(GL_DEPTH_TEST);
  glShadeModel(GL_SMOOTH);
  lightc();
}


x86 assembly (clang, -O0):
<myInit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <glShadeModel@plt>
mov    $0x0,%al
call   1050 <lightc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<myInit>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <glShadeModel@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <lightc@plt>

LLVM IR (-O0):
@GL_DEPTH_TEST = global i32 0
@GL_SMOOTH = global i32 0
define void @myInit() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_SMOOTH
%4 = call i32 @glShadeModel(i32 %3)
%5 = call i32 (...) @lightc()
ret void
}

LLVM IR (-O2):
@GL_DEPTH_TEST = global i32 0
@GL_SMOOTH = global i32 0
define void @myInit() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = tail call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_SMOOTH
%4 = tail call i32 @glShadeModel(i32 %3)
%5 = tail call i32 (...) @lightc()
ret void
}
/* Type definitions */
struct cc_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __cc_cal_cube_face(struct cc_context *);
int /*<<< orphan*/ __cc_cal_norm_xy(struct cc_context *, unsigned int const,
                                    unsigned int const);
int /*<<< orphan*/ __cc_cal_theta_phi(struct cc_context *);
int /*<<< orphan*/ __cc_cal_xyz_from_theta_phi(struct cc_context *);
void __cc_cal_sphere_xyz(struct cc_context *ctx, const unsigned int x,
                         const unsigned int y) {
  __cc_cal_norm_xy(ctx, x, y);
  __cc_cal_theta_phi(ctx);
  __cc_cal_xyz_from_theta_phi(ctx);
  __cc_cal_cube_face(ctx);
}


x86 assembly (clang, -O0):
<__cc_cal_sphere_xyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <__cc_cal_norm_xy@plt>
mov    -0x8(%rbp),%rdi
call   1040 <__cc_cal_theta_phi@plt>
mov    -0x8(%rbp),%rdi
call   1060 <__cc_cal_xyz_from_theta_phi@plt>
mov    -0x8(%rbp),%rdi
call   1050 <__cc_cal_cube_face@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cc_cal_sphere_xyz>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__cc_cal_norm_xy@plt>
mov    %rbx,%rdi
call   1040 <__cc_cal_theta_phi@plt>
mov    %rbx,%rdi
call   1060 <__cc_cal_xyz_from_theta_phi@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <__cc_cal_cube_face@plt>

LLVM IR (-O0):
%struct.cc_context = type { i32 }
define void @__cc_cal_sphere_xyz(%struct.cc_context* %0, i32 %1, i32 %2) {
%4 = alloca %struct.cc_context*
%5 = alloca i32
%6 = alloca i32
store %struct.cc_context* %0, %struct.cc_context** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.cc_context*, %struct.cc_context** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @__cc_cal_norm_xy(%struct.cc_context* %7, i32 %8, i32 %9)
%11 = load %struct.cc_context*, %struct.cc_context** %4
%12 = call i32 @__cc_cal_theta_phi(%struct.cc_context* %11)
%13 = load %struct.cc_context*, %struct.cc_context** %4
%14 = call i32 @__cc_cal_xyz_from_theta_phi(%struct.cc_context* %13)
%15 = load %struct.cc_context*, %struct.cc_context** %4
%16 = call i32 @__cc_cal_cube_face(%struct.cc_context* %15)
ret void
}

LLVM IR (-O2):
%struct.cc_context = type { i32 }
define void @__cc_cal_sphere_xyz(%struct.cc_context* %0, i32 %1, i32 %2) {
%4 = tail call i32 @__cc_cal_norm_xy(%struct.cc_context* %0, i32 %1, i32 %2)
%5 = tail call i32 @__cc_cal_theta_phi(%struct.cc_context* %0)
%6 = tail call i32 @__cc_cal_xyz_from_theta_phi(%struct.cc_context* %0)
%7 = tail call i32 @__cc_cal_cube_face(%struct.cc_context* %0)
ret void
}