xunge/DecIR huggingface dataset:
/* Type definitions */
struct collection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ collection_delete(struct collection *);
struct collection *collection_new();
int /*<<< orphan*/ ctest_assert_pass(char *);
int test_collection_01() {
  struct collection *col;
  col = collection_new();
  collection_delete(col);
  char *assert_message = "Testing collection for simple new/delete..";
  ctest_assert_pass(assert_message);
  return 0;
}


x86 assembly (clang, -O0):
<test_collection_01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <collection_new@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <collection_delete@plt>
lea    0xead(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ctest_assert_pass@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_collection_01>:
push   %rax
xor    %eax,%eax
call   1030 <collection_new@plt>
mov    %rax,%rdi
call   1050 <collection_delete@plt>
lea    0xeb9(%rip),%rdi
call   1040 <ctest_assert_pass@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.collection = type { i32 }
@.str = [43 x i8] c"Testing collection for simple new/delete..\00"
define i32 @test_collection_01() {
%1 = alloca %struct.collection*
%2 = alloca i8*
%3 = call %struct.collection* (...) @collection_new()
store %struct.collection* %3, %struct.collection** %1
%4 = load %struct.collection*, %struct.collection** %1
%5 = call i32 @collection_delete(%struct.collection* %4)
store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @ctest_assert_pass(i8* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.collection = type { i32 }
@.str = [43 x i8] c"Testing collection for simple new/delete..\00"
define i32 @test_collection_01() {
%1 = tail call %struct.collection* (...) @collection_new()
%2 = tail call i32 @collection_delete(%struct.collection* %1)
%3 = tail call i32 @ctest_assert_pass(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int charloc(char *str, int loc) { return *(str + (loc - 1)) - '0'; }


x86 assembly (clang, -O0):
<charloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charloc>:
movslq %esi,%rax
movsbl -0x1(%rax,%rdi,1),%eax
add    $0xffffffd0,%eax
ret

LLVM IR (-O0):
define i32 @charloc(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 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 48
ret i32 %12
}

LLVM IR (-O2):
define i32 @charloc(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, -48
ret i32 %8
}
/* Type definitions */
struct cpufreq_affected_cpus {
  int dummy;
};

/* Variables and functions */
struct cpufreq_affected_cpus *sysfs_get_cpu_list(unsigned int, char *);
struct cpufreq_affected_cpus *sysfs_get_freq_related_cpus(unsigned int cpu) {
  return sysfs_get_cpu_list(cpu, "related_cpus");
}


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

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

LLVM IR (-O0):
%struct.cpufreq_affected_cpus = type { i32 }
@.str = [13 x i8] c"related_cpus\00"
define %struct.cpufreq_affected_cpus* @sysfs_get_freq_related_cpus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call %struct.cpufreq_affected_cpus* @sysfs_get_cpu_list(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret %struct.cpufreq_affected_cpus* %4
}

LLVM IR (-O2):
%struct.cpufreq_affected_cpus = type { i32 }
@.str = [13 x i8] c"related_cpus\00"
define %struct.cpufreq_affected_cpus* @sysfs_get_freq_related_cpus(i32 %0) {
%2 = tail call %struct.cpufreq_affected_cpus* @sysfs_get_cpu_list(i32 %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret %struct.cpufreq_affected_cpus* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void HelloWorld(char *pString) { printf("%s\n", pString); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @HelloWorld(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int mystery();
int libcall_string(int uno, const char *dos) {
  if (dos != NULL && dos[0] == 'Z' && dos[1] == 0) {
    return 11;
  } else {
    return mystery() * uno;
  }
}


x86 assembly (clang, -O0):
<libcall_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1157 <libcall_string+0x47>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jne    1157 <libcall_string+0x47>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1157 <libcall_string+0x47>
movl   $0xb,-0x4(%rbp)
jmp    1165 <libcall_string+0x55>
mov    $0x0,%al
call   1030 <mystery@plt>
imul   -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libcall_string>:
push   %rbx
mov    %edi,%ebx
test   %rsi,%rsi
je     1123 <libcall_string+0x13>
cmpb   $0x5a,(%rsi)
jne    1123 <libcall_string+0x13>
cmpb   $0x0,0x1(%rsi)
je     112f <libcall_string+0x1f>
xor    %eax,%eax
call   1030 <mystery@plt>
imul   %ebx,%eax
pop    %rbx
ret
mov    $0xb,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @libcall_string(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 90
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %1, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %7, %4, %2
%12 = tail call i32 (...) @mystery()
%13 = mul nsw i32 %12, %0
br label %14
14: ; preds = %7, %11
%15 = phi i32 [ %13, %11 ], [ 11, %7 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
main() { putchar('6'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @putchar(i8 signext 54)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 54)
ret i32 0
}
void plat_midi_in_get_dev_name(int num, char *s) {
  s[0] = ' ';
  s[1] = 0;
}


x86 assembly (clang, -O0):
<plat_midi_in_get_dev_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<plat_midi_in_get_dev_name>:
movw   $0x20,(%rsi)
ret

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

LLVM IR (-O2):
define void @plat_midi_in_get_dev_name(i32 %0, i8* nocapture writeonly %1) {
store i8 32, i8* %1
%3 = getelementptr inbounds i8, i8* %1, i64 1
store i8 0, i8* %3
ret void
}
void caller_2_2_1_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_1_2_2_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int getpid();
int /*<<< orphan*/ stdout;
__attribute__((constructor)) void sayhello(void) {
  fprintf(stdout, "Hello from [%d]\n", getpid());
}


x86 assembly (clang, -O0):
<sayhello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%edx
lea    0xeb9(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sayhello>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec8(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [17 x i8] c"Hello from [%d]\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @sayhello, i8* null }]
define void @sayhello() {
%1 = load i32, i32* @stdout
%2 = call i32 (...) @getpid()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [17 x i8] c"Hello from [%d]\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @sayhello, i8* null }]
define void @sayhello() {
%1 = load i32, i32* @stdout
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  int y;
  if (!(x == y && y >= 0))
    return 0;
  while (x != 0) {
    x--;
    y--;
    if (x < 0 || y < 0)
      break;
  }
  assert(y == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1135 <main+0x25>
cmpl   $0x0,-0xc(%rbp)
jge    1141 <main+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1198 <main+0x88>
jmp    1146 <main+0x36>
cmpl   $0x0,-0x8(%rbp)
je     1180 <main+0x70>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1176 <main+0x66>
cmpl   $0x0,-0xc(%rbp)
jge    117b <main+0x6b>
jmp    1180 <main+0x70>
jmp    1146 <main+0x36>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7, %0
store i32 0, i32* %1
br label %32
11: ; preds = %7
br label %12
12: ; preds = %26, %11
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = load i32, i32* %2
%17 = add nsw i32 %16, -1
store i32 %17, i32* %2
%18 = load i32, i32* %3
%19 = add nsw i32 %18, -1
store i32 %19, i32* %3
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %15
%23 = load i32, i32* %3
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %22, %15
br label %27
26: ; preds = %22
br label %12
27: ; preds = %25, %12
%28 = load i32, i32* %3
%29 = icmp eq i32 %28, 0
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
store i32 0, i32* %1
br label %32
32: ; preds = %27, %10
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("GNU MAC Changer\n"
         "Usage: macchanger [options] device\n\n"
         "Try `macchanger --help' for more options.\n");
}


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

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

LLVM IR (-O0):
@.str = [95 x i8] c"GNU MAC Changer\0AUsage: macchanger [options] device\0A\0ATry `macchanger --help' for more options.\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [94 x i8] c"GNU MAC Changer\0AUsage: macchanger [options] device\0A\0ATry `macchanger --help' for more options.\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([94 x i8], [94 x i8]* @str, i64 0, i64 0))
ret void
}
void g_child_watch_add() {}


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

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

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

LLVM IR (-O2):
define void @g_child_watch_add() {
ret void
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
size_t write(int, void const *, size_t);
void write_or_die(int fd, const void *buf, size_t count) {
  ssize_t sz = write(fd, buf, count);
  if (sz != count)
    exit(3);
}


x86 assembly (clang, -O0):
<write_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     115f <write_or_die+0x3f>
mov    $0x3,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_or_die>:
push   %rbx
mov    %rdx,%rbx
call   1030 <write@plt>
cmp    %rbx,%rax
jne    1130 <write_or_die+0x10>
pop    %rbx
ret
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @write_or_die(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @write(i32 %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = load i64, i64* %6
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = call i32 @exit(i32 3)
unreachable
17: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @write_or_die(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @write(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @exit(i32 3)
unreachable
8: ; preds = %3
ret void
}
/* Variables and functions */
double _cos(double);
double cos(double angle) { return _cos(angle); }


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

x86 assembly (clang, -O2):
<cos>:
jmp    1030 <_cos@plt>

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

LLVM IR (-O2):
define double @cos(double %0) {
%2 = tail call double @_cos(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ do_exit(char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void assert_fp(const char *name, FILE *fp) {
  fprintf(stderr, "%s -> %p\n", name, fp);
  if (!fp) {
    do_exit(name);
  }
}


x86 assembly (clang, -O0):
<assert_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1161 <assert_fp+0x41>
mov    -0x8(%rbp),%rdi
call   1030 <do_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_fp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1040 <fprintf@plt>
test   %rbx,%rbx
je     1152 <assert_fp+0x32>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <do_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"%s -> %p\0A\00"
define void @assert_fp(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32*, i32** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %6, i32* %7)
%9 = load i32*, i32** %4
%10 = icmp ne i32* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @do_exit(i8* %12)
br label %14
14: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"%s -> %p\0A\00"
define void @assert_fp(i8* %0, i32* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i32* %1)
%5 = icmp eq i32* %1, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @do_exit(i8* %0)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
double DSlater_2S_6S(double, double, double);
double DSlater_6S_2S(double rij, double xii, double xij) {
  return DSlater_2S_6S(rij, xij, xii);
}


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

x86 assembly (clang, -O2):
<DSlater_6S_2S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <DSlater_2S_6S@plt>

LLVM IR (-O0):
define double @DSlater_6S_2S(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = call double @DSlater_2S_6S(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @DSlater_6S_2S(double %0, double %1, double %2) {
%4 = tail call double @DSlater_2S_6S(double %0, double %2, double %1)
ret double %4
}
struct bwb_line *bwb_OPTION_ARITHMETIC_DECIMAL(struct bwb_line *l) {
  bwx_DEBUG(__FUNCTION__);
  return bwb_zline(l);
}


x86 assembly (clang, -O0):
<bwb_OPTION_ARITHMETIC_DECIMAL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <bwx_DEBUG@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <bwb_zline@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwb_OPTION_ARITHMETIC_DECIMAL>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <bwx_DEBUG@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <bwb_zline@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_OPTION_ARITHMETIC_DECIMAL = [30 x i8] c"bwb_OPTION_ARITHMETIC_DECIMAL\00"
define %struct.bwb_line* @bwb_OPTION_ARITHMETIC_DECIMAL(%struct.bwb_line* %0) {
%2 = alloca %struct.bwb_line*
store %struct.bwb_line* %0, %struct.bwb_line** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @__FUNCTION__.bwb_OPTION_ARITHMETIC_DECIMAL, i64 0, i64 0))
%4 = load %struct.bwb_line*, %struct.bwb_line** %2
%5 = call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_zline to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.bwb_line*
ret %struct.bwb_line* %7
}

LLVM IR (-O2):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_OPTION_ARITHMETIC_DECIMAL = [30 x i8] c"bwb_OPTION_ARITHMETIC_DECIMAL\00"
define %struct.bwb_line* @bwb_OPTION_ARITHMETIC_DECIMAL(%struct.bwb_line* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @__FUNCTION__.bwb_OPTION_ARITHMETIC_DECIMAL, i64 0, i64 0))
%3 = tail call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_zline to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %0)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.bwb_line*
ret %struct.bwb_line* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(char const *, int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char const *);
int fputs(const char *s, FILE *fp) { return fwrite(s, 1, strlen(s), fp); }


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
define i32 @fputs(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 i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i32*, i32** %4
%9 = call i32 @fwrite(i8* %5, i32 1, i32 %7, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @fputs(i8* %0, i32* nocapture %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @fwrite(i8* %0, i32 1, i32 %3, i32* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ nanotest_putchar(char);
void nanotest_putnl() { nanotest_putchar('\n'); }


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

x86 assembly (clang, -O2):
<nanotest_putnl>:
mov    $0xa,%edi
jmp    1030 <nanotest_putchar@plt>

LLVM IR (-O0):
define void @nanotest_putnl() {
%1 = call i32 @nanotest_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @nanotest_putnl() {
%1 = tail call i32 @nanotest_putchar(i8 signext 10)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t CRCResultRead(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(0x44030000 + 0x00000C18))));
}


x86 assembly (clang, -O0):
<CRCResultRead>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x44030c18,%eax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRCResultRead>:
mov    %rdi,-0x8(%rsp)
mov    0x44030c18,%rax
44
ret

LLVM IR (-O0):
define i64 @CRCResultRead(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1141050392 to i64*)
ret i64 %3
}

LLVM IR (-O2):
define i64 @CRCResultRead(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1141050392 to i64*)
ret i64 %3
}
int compar(const void *m, const void *n) {
  return -(*((int *)m) - *((int *)n));
}


x86 assembly (clang, -O0):
<compar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
sub    (%rax),%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compar(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xe7() {
  Assert_real((isascii(231) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              1160, ("isascii should be 0 for 0xe7"));
}


x86 assembly (clang, -O0):
<t_isascii_0xe7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe7,%edi
call   1030 <isascii@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x488,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0xe7>:
push   %rax
mov    $0xe7,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x488,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xe7\00"
define void @t_isascii_0xe7() {
%1 = call i64 @isascii(i32 231)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xe7\00"
define void @t_isascii_0xe7() {
%1 = tail call i64 @isascii(i32 231)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\nHello World!\n\n");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"\0AHello World!\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [15 x i8] c"\0AHello World!\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
unsigned long he3_get_bit(unsigned char *data, unsigned long *cur_pos) {
  unsigned long out;
  out = ((unsigned long)(data[(*cur_pos) / 8] >> ((*cur_pos) & 7))) & 1;
  (*cur_pos)++;
  return out;
}


x86 assembly (clang, -O0):
<he3_get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
shr    $0x3,%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
and    $0x7,%rcx
sar    %cl,%eax
cltq
and    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<he3_get_bit>:
mov    (%rsi),%rdx
mov    %rdx,%rax
shr    $0x3,%rax
movzbl (%rdi,%rax,1),%eax
mov    %edx,%ecx
and    $0x7,%cl
shr    %cl,%rax
and    $0x1,%eax
add    $0x1,%rdx
mov    %rdx,(%rsi)
ret

LLVM IR (-O0):
define i64 @he3_get_bit(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i64
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = load i8*, i8** %3
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = udiv i64 %8, 8
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i64*, i64** %4
%14 = load i64, i64* %13
%15 = and i64 %14, 7
%16 = trunc i64 %15 to i32
%17 = ashr i32 %12, %16
%18 = sext i32 %17 to i64
%19 = and i64 %18, 1
store i64 %19, i64* %5
%20 = load i64*, i64** %4
%21 = load i64, i64* %20
%22 = add i64 %21, 1
store i64 %22, i64* %20
%23 = load i64, i64* %5
ret i64 %23
}

LLVM IR (-O2):
define i64 @he3_get_bit(i8* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = lshr i64 %3, 3
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = trunc i64 %3 to i32
%9 = and i32 %8, 7
%10 = lshr i32 %7, %9
%11 = and i32 %10, 1
%12 = zext i32 %11 to i64
%13 = add i64 %3, 1
store i64 %13, i64* %1
ret i64 %12
}
__attribute__((no, noclone)) signed __int128 t101_3add(signed __int128 y) {
  signed __int128 r;
  if (__builtin_add_overflow(
          (signed __int128)((
              (signed __int128)(((unsigned __int128)1 << (16 * 8 - 1)) - 1))),
          y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t101_3add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
add    $0xffffffffffffffff,%rdx
movabs $0x7fffffffffffffff,%rax
ff ff 7f
adc    %rax,%rcx
seto   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1161 <t101_3add+0x51>
jmp    1168 <t101_3add+0x58>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t101_3add>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0xffffffffffffffff,%r14
movabs $0x7fffffffffffffff,%rbx
ff ff 7f
adc    %rsi,%rbx
jno    1131 <t101_3add+0x21>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t101_3add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 170141183460469231731687303715884105727, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t101_3add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %6, i128 170141183460469231731687303715884105727)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ dsortp2yl_(float *, float *, int *, int *, int *, int *);
void cdsortp2yl(float parta[], float partb[], int npic[], int idimp, int nop,
                int ny1) {
  dsortp2yl_(parta, partb, npic, &idimp, &nop, &ny1);
  return;
}


x86 assembly (clang, -O0):
<cdsortp2yl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
lea    -0x24(%rbp),%r9
call   1030 <dsortp2yl_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdsortp2yl>:
sub    $0x18,%rsp
mov    %ecx,0x14(%rsp)
mov    %r8d,0x10(%rsp)
mov    %r9d,0xc(%rsp)
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
call   1030 <dsortp2yl_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @cdsortp2yl(float* %0, float* %1, i32* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca float*
%8 = alloca float*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store float* %0, float** %7
store float* %1, float** %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load float*, float** %7
%14 = load float*, float** %8
%15 = load i32*, i32** %9
%16 = call i32 @dsortp2yl_(float* %13, float* %14, i32* %15, i32* %10, i32* %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @cdsortp2yl(float* %0, float* %1, i32* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %3, i32* %7
store i32 %4, i32* %8
store i32 %5, i32* %9
%10 = call i32 @dsortp2yl_(float* %0, float* %1, i32* %2, i32* %7, i32* %8, i32* %9)
ret void
}
void ff_hevc_put_hevc_pel_pixels12_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels12_8_sse4() {
ret void
}
/* Variables and functions */
char *zcodecom(int /*<<< orphan*/, char *, int, int *);
char *zencode(char *inbuf, int inbuf_len, int *resultbuf_len) {
  return zcodecom(0, inbuf, inbuf_len, resultbuf_len);
}


x86 assembly (clang, -O0):
<zencode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %edi,%edi
call   1030 <zcodecom@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zencode>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <zcodecom@plt>

LLVM IR (-O0):
define i8* @zencode(i8* %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
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i8* @zcodecom(i32 0, i8* %7, i32 %8, i32* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @zencode(i8* %0, i32 %1, i32* %2) {
%4 = tail call i8* @zcodecom(i32 0, i8* %0, i32 %1, i32* %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int ano = 0;
  scanf("%d", &ano);
  printf("%d", 76 - ((ano - 1986) % 76) + ano);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    $0x7c2,%eax
mov    $0x4c,%ecx
cltd
idiv   %ecx
mov    $0x4c,%esi
sub    %edx,%esi
add    -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xecc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    $0xfffff83e,%eax
add    0xc(%rsp),%eax
cltq
imul   $0x6bca1af3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x4c,%eax,%esi
add    $0x80e,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1986
%6 = srem i32 %5, 76
%7 = sub nsw i32 76, %6
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1986
%6 = srem i32 %5, 76
%7 = add i32 %4, 76
%8 = sub i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int udp_socket_close(int s) {
  close(s);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @udp_socket_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}
void gdk_keyboard_grab() {}


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

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

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

LLVM IR (-O2):
define void @gdk_keyboard_grab() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
void main() {
  char s[4] = "abc";
  atoi(s);
}


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

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

LLVM IR (-O0):
@__const.main.s = [4 x i8] c"abc\00"
define void @main() {
%1 = alloca [4 x i8]
%2 = bitcast [4 x i8]* %1 to i8*
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = call i32 @atoi(i8* %3)
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
unsigned int strlength(char *str) {
  unsigned int len = 0;
  while (*str) {
    str++;
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <strlength+0x36>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlength>:
cmpb   $0x0,(%rdi)
je     111c <strlength+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlength+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  int fd = open("fifo", O_WRONLY);
  while (1) {
    write(fd, "p2_hello", 8);
    sleep(2);
  }
  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)
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    0xe9d(%rip),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    115e <main+0x2e>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
lea    0xebc(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%ebx
lea    0xeb3(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [5 x i8] c"fifo\00"
@O_WRONLY = global i32 0
@.str.1 = [9 x i8] c"p2_hello\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 = load i32, i32* @O_WRONLY
%8 = call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %6
br label %9
9: ; preds = %2, %9
%10 = load i32, i32* %6
%11 = call i32 @write(i32 %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%12 = call i32 @sleep(i32 2)
br label %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"fifo\00"
@O_WRONLY = global i32 0
@.str.1 = [9 x i8] c"p2_hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @O_WRONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %5
5: ; preds = %5, %2
%6 = tail call i32 @write(i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%7 = tail call i32 @sleep(i32 2)
br label %5
}
__attribute__((target("avx,sse4.2"))) void foo_used(int i, double d) {}


x86 assembly (clang, -O0):
<foo_used>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
vmovsd %xmm0,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo_used(i32 %0, double %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ PHY_EncryptReq(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ SYS_EncryptConf();
void SYS_EncryptReq(uint8_t *text, uint8_t *key) {
  PHY_EncryptReq(text, key);
  SYS_EncryptConf();
}


x86 assembly (clang, -O0):
<SYS_EncryptReq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <PHY_EncryptReq@plt>
mov    $0x0,%al
call   1030 <SYS_EncryptConf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SYS_EncryptReq>:
push   %rax
call   1040 <PHY_EncryptReq@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <SYS_EncryptConf@plt>

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

LLVM IR (-O2):
define void @SYS_EncryptReq(i32* %0, i32* %1) {
%3 = tail call i32 @PHY_EncryptReq(i32* %0, i32* %1)
%4 = tail call i32 (...) @SYS_EncryptConf()
ret void
}