xunge/DecIR huggingface dataset:
void plc_sleep(void) {}


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

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

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

LLVM IR (-O2):
define void @plc_sleep() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_close(int /*<<< orphan*/);
void PIC18F452_stop(void) {
  serial_close(0);
  ;
}


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

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

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

LLVM IR (-O2):
define void @PIC18F452_stop() {
%1 = tail call i32 @serial_close(i32 0)
ret void
}
unsigned getgid(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getgid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ test(int);
int main(int argc, char *argv[]) {
  int n;
  scanf("%d", &n);
  test(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1040 <test@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\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
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = call i32 @test(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @test(i32 %6)
ret i32 0
}
int _falmbDefaultTextExtents() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_falmbDefaultTextExtents() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ reset();
void tabReset() { reset(); }


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

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

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

LLVM IR (-O2):
define void @tabReset() {
%1 = tail call i32 (...) @reset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_get_position() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_get_position"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_cvolume_get_position\00"
define i32 @pa_cvolume_get_position() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
void *malloc(int);
void *pc_unit_constructor(void) { return malloc(sizeof(int64_t)); }


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

x86 assembly (clang, -O2):
<pc_unit_constructor>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @pc_unit_constructor() {
%1 = call i8* @malloc(i32 4)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @pc_unit_constructor() {
%1 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
ret i8* %1
}
_Complex double test_catanh(_Complex double x) { return __builtin_catanh(x); }


x86 assembly (clang, -O0):
<test_catanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <catanh@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_catanh>:
jmp    1030 <catanh@plt>

LLVM IR (-O0):
define { double, double } @test_catanh(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %6
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%9 = load double, double* %8
%10 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%13 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %9, double* %12
store double %11, double* %13
%14 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%15 = load double, double* %14
%16 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%17 = load double, double* %16
%18 = call { double, double } @catanh(double %15, double %17)
%19 = extractvalue { double, double } %18, 0
%20 = extractvalue { double, double } %18, 1
%21 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%22 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %19, double* %21
store double %20, double* %22
%23 = load { double, double }, { double, double }* %3
ret { double, double } %23
}

LLVM IR (-O2):
define { double, double } @test_catanh(double %0, double %1) {
%3 = tail call { double, double } @catanh(double %0, double %1)
ret { double, double } %3
}
/* Variables and functions */
scalar_t__ memcmp(char const *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
int startsWith(const char *str, const char *prefix) {
  if (strlen(str) < strlen(prefix))
    return 0;
  return memcmp(str, prefix, strlen(prefix)) == 0;
}


x86 assembly (clang, -O0):
<startsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jge    1162 <startsWith+0x42>
movl   $0x0,-0x4(%rbp)
jmp    119a <startsWith+0x7a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %rax,%rdx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rbx
jl     115b <startsWith+0x3b>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp slt i64 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @memcmp(i8* %0, i8* %1, i64 %4)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(long *, int, int, int /*<<< orphan*/ *);
void put_long(long i, FILE *f) { fwrite(&i, sizeof(long), 1, f); }


x86 assembly (clang, -O0):
<put_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_long>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @put_long(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @fwrite(i64* %3, i32 8, i32 1, i32* %5)
ret void
}

LLVM IR (-O2):
define void @put_long(i64 %0, i32* nocapture %1) {
%3 = alloca i64
store i64 %0, i64* %3
%4 = call i32 @fwrite(i64* %3, i32 8, i32 1, i32* %1)
ret void
}
int bcp(int x) { return __builtin_constant_p(x); }


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

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

LLVM IR (-O0):
define i32 @bcp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i1 @llvm.is.constant.i32(i32 %3)
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @bcp(i32 %0) {
ret i32 0
}
/* Variables and functions */
int sat_literal_new(int /*<<< orphan*/ *, char *, int);
int sat_literal_new_cb(char *name, int val) {
  return sat_literal_new(NULL, name, val);
}


x86 assembly (clang, -O0):
<sat_literal_new_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <sat_literal_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sat_literal_new_cb>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <sat_literal_new@plt>

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

LLVM IR (-O2):
define i32 @sat_literal_new_cb(i8* %0, i32 %1) {
%3 = tail call i32 @sat_literal_new(i32* null, i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char inportb(int);
scalar_t__ serial_received();
char read_serial() {
  while (serial_received() == 0)
    ;
  return inportb(0x3f8);
}


x86 assembly (clang, -O0):
<read_serial>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <read_serial+0x9>
mov    $0x0,%al
call   1030 <serial_received@plt>
cmp    $0x0,%rax
jne    113f <read_serial+0x1f>
jmp    1129 <read_serial+0x9>
mov    $0x3f8,%edi
call   1040 <inportb@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_serial>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <serial_received@plt>
test   %rax,%rax
je     1130 <read_serial+0x10>
mov    $0x3f8,%edi
pop    %rax
jmp    1040 <inportb@plt>

LLVM IR (-O0):
define signext i8 @read_serial() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @serial_received()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
%6 = call signext i8 @inportb(i32 1016)
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @read_serial() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @serial_received()
%3 = icmp eq i64 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call signext i8 @inportb(i32 1016)
ret i8 %5
}
/* Variables and functions */
int EBUSY;
int __syscall(int, int, int);
int __syscall_ret(int);
int dup2(int old, int new) {
  int r;
  while ((r = __syscall(63, old, new)) == -EBUSY)
    ;
  return __syscall_ret(r);
}


x86 assembly (clang, -O0):
<dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x3f,%edi
call   1030 <__syscall@plt>
mov    %eax,-0xc(%rbp)
xor    %ecx,%ecx
mov    0x2e96(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
jne    1159 <dup2+0x39>
jmp    112e <dup2+0xe>
mov    -0xc(%rbp),%edi
call   1040 <__syscall_ret@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup2>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2eb1(%rip),%r14
nop
mov    $0x3f,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <__syscall@plt>
mov    (%r14),%ecx
add    %eax,%ecx
je     1130 <dup2+0x10>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <__syscall_ret@plt>

LLVM IR (-O0):
@EBUSY = global i32 0
define i32 @dup2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @__syscall(i32 63, i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* @EBUSY
%11 = sub nsw i32 0, %10
%12 = icmp eq i32 %9, %11
br i1 %12, label %13, label %14
13: ; preds = %6
br label %6
14: ; preds = %6
%15 = load i32, i32* %5
%16 = call i32 @__syscall_ret(i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@EBUSY = global i32 0
define i32 @dup2(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @__syscall(i32 63, i32 %0, i32 %1)
%5 = load i32, i32* @EBUSY
%6 = sub nsw i32 0, %5
%7 = icmp eq i32 %4, %6
br i1 %7, label %3, label %8
8: ; preds = %3
%9 = tail call i32 @__syscall_ret(i32 %4)
ret i32 %9
}
void __DELETE_org_xmlvm_runtime_XMLVMArray(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_org_xmlvm_runtime_XMLVMArray(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_org_xmlvm_runtime_XMLVMArray(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int c;
  for (c = 0; c <= 255; c++) {
    printf("%c - %d\n", c, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%c - %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 255
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%c - %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void colorWht() { printf("%s", "\x1B[37m"); }


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

x86 assembly (clang, -O2):
<colorWht>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"\1B[37m\00"
define void @colorWht() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"\1B[37m\00"
define void @colorWht() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void support_card_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @support_card_reset() {
ret void
}
void avcodec_enum_to_chroma_pos() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_enum_to_chroma_pos() {
ret void
}
void swapDouble(double *x, double *y) {
  double temp = *x;
  *x = *y;
  *y = temp;
}


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

x86 assembly (clang, -O2):
<swapDouble>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rsi)
ret

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

LLVM IR (-O2):
define void @swapDouble(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
store double %4, double* %0
store double %3, double* %1
ret void
}
/* Variables and functions */
char id(int);
int /*<<< orphan*/ printf(char *, char, char);
void test1(int a, int b) {
  char x[] = {id(a), id(b + a)};
  printf("{%d, %d}\n", x[0], x[1]);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <id@plt>
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%edi
add    -0x4(%rbp),%edi
call   1040 <id@plt>
mov    %al,-0x9(%rbp)
mov    -0xa(%rbp),%al
lea    0xeaf(%rip),%rdi
movsbl %al,%esi
movsbl -0x9(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <id@plt>
mov    %eax,%r14d
add    %ebp,%ebx
mov    %ebx,%edi
call   1040 <id@plt>
movsbl %al,%edx
movsbl %r14b,%esi
lea    0xeb9(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"{%d, %d}\0A\00"
define void @test1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call signext i8 @id(i32 %7)
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = call signext i8 @id(i32 %12)
store i8 %13, i8* %9
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%15 = load i8, i8* %14
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
%17 = load i8, i8* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %15, i8 signext %17)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"{%d, %d}\0A\00"
define void @test1(i32 %0, i32 %1) {
%3 = tail call signext i8 @id(i32 %0)
%4 = add nsw i32 %1, %0
%5 = tail call signext i8 @id(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %3, i8 signext %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int errno;
int open(char const *, int /*<<< orphan*/, int);
int k_open(int *fd, const char *name, int flags, int mode) {
  int rc = open(name, O_RDWR, 0666);
  if (rc < 0)
    return errno;
  *fd = rc;
  return 0;
}


x86 assembly (clang, -O0):
<k_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    $0x1b6,%edx
call   1030 <open@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    115b <k_open+0x4b>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116b <k_open+0x5b>
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_open>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%rcx
mov    (%rcx),%esi
mov    %rax,%rdi
mov    $0x1b6,%edx
call   1030 <open@plt>
test   %eax,%eax
js     1137 <k_open+0x27>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@O_RDWR = global i32 0
@errno = global i32 0
define i32 @k_open(i32* nocapture writeonly %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = load i32, i32* @O_RDWR
%6 = tail call i32 @open(i8* %1, i32 %5, i32 438)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load i32, i32* @errno
br label %11
10: ; preds = %4
store i32 %6, i32* %0
br label %11
11: ; preds = %10, %8
%12 = phi i32 [ %9, %8 ], [ 0, %10 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ qsort(int *, int /*<<< orphan*/, int);
int main() {
  int a[] = {2, 5, 1, 3, 7, 0, 9, 4};
  qsort(a, 0, 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1030 <qsort@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1030 <qsort@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [8 x i32] [i32 2, i32 5, i32 1, i32 3, i32 7, i32 0, i32 9, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
store i32 0, i32* %1
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 @qsort(i32* %4, i32 0, i32 7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [8 x i32] [i32 2, i32 5, i32 1, i32 3, i32 7, i32 0, i32 9, i32 4]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @qsort(i32* %3, i32 0, i32 7)
ret i32 0
}
int fn(void) {
  int a[2];
  return a[0];
}


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

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

LLVM IR (-O0):
define i32 @fn() {
%1 = alloca [2 x i32]
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @fn() {
ret i32 undef
}
/* Variables and functions */
char *strchr(char *, char);
int strccount(char *str, char c) {
  char *s = str - 1;
  int rv = 0;
  while (s) {
    s = strchr(s + 1, c);
    rv++;
  }
  return rv - 1;
}


x86 assembly (clang, -O0):
<strccount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1163 <strccount+0x53>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1135 <strccount+0x25>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strccount>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
mov    $0xffffffff,%ebx
movsbl %sil,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rax
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <strccount+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @strccount(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 -1
store i8* %8, i8** %5
store i32 0, i32* %6
br label %9
9: ; preds = %12, %2
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %4
%16 = call i8* @strchr(i8* %14, i8 signext %15)
store i8* %16, i8** %5
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %9
19: ; preds = %9
%20 = load i32, i32* %6
%21 = sub nsw i32 %20, 1
ret i32 %21
}

LLVM IR (-O2):
define i32 @strccount(i8* %0, i8 signext %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 -1
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %9, %4 ]
%6 = phi i8* [ %3, %2 ], [ %8, %4 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i8* @strchr(i8* %7, i8 signext %1)
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i8* %8, null
br i1 %10, label %11, label %4
11: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
long sump(int *, int *);
int main() {
  int marbles[10] = {20, 10, 5, 39, 4, 16, 19, 26, 31, 20};
  long answer;
  answer = sump(marbles, marbles + 10);
  printf("The total number of marbles is %ld.\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rsi
add    $0x28,%rsi
call   1050 <sump@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x28(%rsp),%rsi
mov    %rsp,%rdi
call   1040 <sump@plt>
lea    0xecd(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.marbles = [10 x i32] [i32 20, i32 10, i32 5, i32 39, i32 4, i32 16, i32 19, i32 26, i32 31, i32 20]
@.str = [37 x i8] c"The total number of marbles is %ld.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i64
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds i32, i32* %6, i64 10
%8 = call i64 @sump(i32* %5, i32* %7)
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.marbles = [10 x i32] [i32 20, i32 10, i32 5, i32 39, i32 4, i32 16, i32 19, i32 26, i32 31, i32 20]
@.str = [37 x i8] c"The total number of marbles is %ld.\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 10
%5 = call i64 @sump(i32* %3, i32* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %5)
ret i32 0
}
/* Variables and functions */
float gammln(float);
float gamm2nln(float n) {
  float n2, g2nln;
  n2 = 2. * n;
  g2nln = gammln(n2);
  return (g2nln);
}


x86 assembly (clang, -O0):
<gamm2nln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <gammln@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamm2nln>:
addss  %xmm0,%xmm0
jmp    1030 <gammln@plt>

LLVM IR (-O0):
define float @gamm2nln(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fmul double 2.000000e+00, %6
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
%10 = call float @gammln(float %9)
store float %10, float* %4
%11 = load float, float* %4
ret float %11
}

LLVM IR (-O2):
define float @gamm2nln(float %0) {
%2 = fmul float %0, 2.000000e+00
%3 = tail call float @gammln(float %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int SyncLST(double newTime) {
  fprintf(stderr,
          "AUX mode of NexStar uses computer time and site location only \n");
  return -1;
}


x86 assembly (clang, -O0):
<SyncLST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SyncLST>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"AUX mode of NexStar uses computer time and site location only \0A\00"
define i32 @SyncLST(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"AUX mode of NexStar uses computer time and site location only \0A\00"
define i32 @SyncLST(double %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
void strCopy(char target[], char source[]) {
  for (; *source != '\0'; target++, source++) {
    *target = *source;
  }
  *target = *source;
}


x86 assembly (clang, -O0):
<strCopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <strCopy+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strCopy+0xc>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strCopy>:
mov    (%rsi),%al
test   %al,%al
je     1121 <strCopy+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <strCopy+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @strCopy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
store i8 0, i8* %14
ret void
}
int z_time_monthsToYears(int Months) { return Months / 12; }


x86 assembly (clang, -O0):
<z_time_monthsToYears>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<z_time_monthsToYears>:
movslq %edi,%rax
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @z_time_monthsToYears(i32 %0) {
%2 = sdiv i32 %0, 12
ret i32 %2
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int O_TRUNC;
int rw_test(char const *, int, int, int, int);
int test_rw_long_trunc(const char *file) {
  return rw_test(file, 1024, 5, O_CREAT | O_TRUNC | O_RDWR, 0777);
}


x86 assembly (clang, -O0):
<test_rw_long_trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
or     (%rax),%ecx
mov    0x2e9f(%rip),%rax
or     (%rax),%ecx
mov    $0x400,%esi
mov    $0x5,%edx
mov    $0x1ff,%r8d
call   1030 <rw_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rw_long_trunc>:
mov    0x2ee1(%rip),%rax
mov    0x2ed2(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2eaf(%rip),%rax
or     (%rax),%ecx
mov    $0x400,%esi
mov    $0x5,%edx
mov    $0x1ff,%r8d
jmp    1030 <rw_test@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@O_RDWR = global i32 0
define i32 @test_rw_long_trunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_CREAT
%5 = load i32, i32* @O_TRUNC
%6 = or i32 %4, %5
%7 = load i32, i32* @O_RDWR
%8 = or i32 %6, %7
%9 = call i32 @rw_test(i8* %3, i32 1024, i32 5, i32 %8, i32 511)
ret i32 %9
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@O_RDWR = global i32 0
define i32 @test_rw_long_trunc(i8* %0) {
%2 = load i32, i32* @O_CREAT
%3 = load i32, i32* @O_TRUNC
%4 = or i32 %3, %2
%5 = load i32, i32* @O_RDWR
%6 = or i32 %4, %5
%7 = tail call i32 @rw_test(i8* %0, i32 1024, i32 5, i32 %6, i32 511)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void write32(volatile void *addr, uint32_t b) {
  *(volatile uint32_t *)addr = b;
}


x86 assembly (clang, -O0):
<write32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @write32(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
/* Type definitions */
struct dnsresp {
  int dummy;
};

/* Variables and functions */
char *_resolv_v6_gai(char *raddr, struct dnsresp *d_resp, char *extra) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.dnsresp = type { i32 }
define i8* @_resolv_v6_gai(i8* %0, %struct.dnsresp* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.dnsresp*
%6 = alloca i8*
store i8* %0, i8** %4
store %struct.dnsresp* %1, %struct.dnsresp** %5
store i8* %2, i8** %6
ret i8* null
}

LLVM IR (-O2):
%struct.dnsresp = type { i32 }
define noalias i8* @_resolv_v6_gai(i8* nocapture readnone %0, %struct.dnsresp* nocapture readnone %1, i8* nocapture readnone %2) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int _SET_RANDOM() { srand(time(NULL)); }


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

x86 assembly (clang, -O2):
<_SET_RANDOM>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define i32 @_SET_RANDOM() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @_SET_RANDOM() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret i32 undef
}
/* Variables and functions */
int foo(int);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", foo(10)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1040 <foo@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @foo(i32 10)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @foo(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ printf(char *, char const *);
void die(const char *message) {
  if (errno) {
    perror(message);
  } else {
    printf("ERROR: %s\n", message);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     115b <die+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    116b <die+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
cmpq   $0x0,(%rax)
je     1153 <die+0x23>
mov    %rsi,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %5
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @die(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @exit(i32 1)
unreachable
}
void c_pomp_sections_exit_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_sections_exit_(%struct.ompregdescr* nocapture %0) {
ret void
}
void sysfs_remove_group(struct kobject *kobj,
                        const struct attribute_group *grp) {}


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

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

LLVM IR (-O0):
%struct.kobject = type opaque
%struct.attribute_group = type opaque
define void @sysfs_remove_group(%struct.kobject* %0, %struct.attribute_group* %1) {
%3 = alloca %struct.kobject*
%4 = alloca %struct.attribute_group*
store %struct.kobject* %0, %struct.kobject** %3
store %struct.attribute_group* %1, %struct.attribute_group** %4
ret void
}

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.attribute_group = type opaque
define void @sysfs_remove_group(%struct.kobject* nocapture %0, %struct.attribute_group* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void chars_print(char chr, int n, FILE *stream) {
  for (; n > 0; n--) {
    fputc(chr, stream);
  }
}


x86 assembly (clang, -O0):
<chars_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114c <chars_print+0x3c>
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <chars_print+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars_print>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <chars_print+0x32>
mov    %rdx,%r14
mov    %esi,%ebp
add    $0x1,%ebp
movsbl %dil,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <chars_print+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @chars_print(i8 signext %0, i32 %1, i32* %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32*
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
br label %7
7: ; preds = %14, %3
%8 = load i32, i32* %5
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i8, i8* %4
%12 = load i32*, i32** %6
%13 = call i32 @fputc(i8 signext %11, i32* %12)
br label %14
14: ; preds = %10
%15 = load i32, i32* %5
%16 = add nsw i32 %15, -1
store i32 %16, i32* %5
br label %7
17: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @chars_print(i8 signext %0, i32 %1, i32* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %1, %3 ]
%7 = tail call i32 @fputc(i8 signext %0, i32* %2)
%8 = add nsw i32 %6, -1
%9 = icmp ugt i32 %6, 1
br i1 %9, label %5, label %10
10: ; preds = %5, %3
ret void
}