xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ ptr;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, size_t);
int main(void) {
  int n = 10;
  int *ptr = &n;
  size_t ptr_size = sizeof(ptr);
  printf("sizeof(ptr): %zu byte\n", ptr_size);
  printf("sizeof(ptr): %u byte\n", ptr_size);
  printf("sizeof(ptr): %lu byte\n", ptr_size);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x8,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"sizeof(ptr): %zu byte\0A\00"
@.str.1 = [22 x i8] c"sizeof(ptr): %u byte\0A\00"
@.str.2 = [23 x i8] c"sizeof(ptr): %lu byte\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i64
store i32 0, i32* %1
store i32 10, i32* %2
store i32* %2, i32** %3
store i64 8, i64* %4
%5 = load i64, i64* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = load i64, i64* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i64 %7)
%9 = load i64, i64* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i64 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@.str = [23 x i8] c"sizeof(ptr): %zu byte\0A\00"
@.str.1 = [22 x i8] c"sizeof(ptr): %u byte\0A\00"
@.str.2 = [23 x i8] c"sizeof(ptr): %lu byte\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i64 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i64 8)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
int is_fadump_active(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_fadump_active() {
ret i32 0
}
double test_creal(_Complex double x) { return __builtin_creal(x); }


x86 assembly (clang, -O0):
<test_creal>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @test_creal(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%9 = load double, double* %8
ret double %7
}

LLVM IR (-O2):
define double @test_creal(double returned %0, double %1) {
ret double %0
}
int fun1363() { return 1363; }


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

x86 assembly (clang, -O2):
<fun1363>:
mov    $0x553,%eax
ret

LLVM IR (-O0):
define i32 @fun1363() {
ret i32 1363
}

LLVM IR (-O2):
define i32 @fun1363() {
ret i32 1363
}
/* Variables and functions */
long double __qasin(long double);
long double __q_asin(long double *arg) { return (__qasin(*arg)); }


x86 assembly (clang, -O0):
<__q_asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qasin@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__q_asin>:
sub    $0x18,%rsp
fldt   (%rdi)
fstpt  (%rsp)
call   1030 <__qasin@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define x86_fp80 @__q_asin(x86_fp80* nocapture %0) {
%2 = load x86_fp80, x86_fp80* %0
%3 = tail call x86_fp80 @__qasin(x86_fp80 %2)
ret x86_fp80 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ rol(scalar_t__, int);
void Round(uint32_t *a, uint32_t b, uint32_t *c, uint32_t d, uint32_t e,
           uint32_t f, uint32_t x, uint32_t k, int r) {
  *a = rol(*a + f + x + k, r) + e;
  *c = rol(*c, 10);
}


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

x86 assembly (clang, -O2):
<Round>:
push   %r15
push   %r14
push   %rbx
mov    %r8,%r14
mov    %rdx,%r15
mov    %rdi,%rbx
mov    0x30(%rsp),%esi
add    0x20(%rsp),%r9
add    0x28(%rsp),%r9
add    (%rdi),%r9
mov    %r9,%rdi
call   1030 <rol@plt>
add    %r14,%rax
mov    %rax,(%rbx)
mov    (%r15),%rdi
mov    $0xa,%esi
call   1030 <rol@plt>
mov    %rax,(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Round(i64* %0, i64 %1, i64* %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i32 %8) {
%10 = alloca i64*
%11 = alloca i64
%12 = alloca i64*
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i32
store i64* %0, i64** %10
store i64 %1, i64* %11
store i64* %2, i64** %12
store i64 %3, i64* %13
store i64 %4, i64* %14
store i64 %5, i64* %15
store i64 %6, i64* %16
store i64 %7, i64* %17
store i32 %8, i32* %18
%19 = load i64*, i64** %10
%20 = load i64, i64* %19
%21 = load i64, i64* %15
%22 = add nsw i64 %20, %21
%23 = load i64, i64* %16
%24 = add nsw i64 %22, %23
%25 = load i64, i64* %17
%26 = add nsw i64 %24, %25
%27 = load i32, i32* %18
%28 = call i64 @rol(i64 %26, i32 %27)
%29 = load i64, i64* %14
%30 = add nsw i64 %28, %29
%31 = load i64*, i64** %10
store i64 %30, i64* %31
%32 = load i64*, i64** %12
%33 = load i64, i64* %32
%34 = call i64 @rol(i64 %33, i32 10)
%35 = load i64*, i64** %12
store i64 %34, i64* %35
ret void
}

LLVM IR (-O2):
define void @Round(i64* nocapture %0, i64 %1, i64* nocapture %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i32 %8) {
%10 = load i64, i64* %0
%11 = add i64 %6, %5
%12 = add i64 %11, %7
%13 = add i64 %12, %10
%14 = tail call i64 @rol(i64 %13, i32 %8)
%15 = add nsw i64 %14, %4
store i64 %15, i64* %0
%16 = load i64, i64* %2
%17 = tail call i64 @rol(i64 %16, i32 10)
store i64 %17, i64* %2
ret void
}
/* Variables and functions */
size_t strlen(char const *);
int ne_path_has_trailing_slash(const char *uri) {
  size_t len = strlen(uri);
  return ((len > 0) && (uri[len - 1] == '/'));
}


x86 assembly (clang, -O0):
<ne_path_has_trailing_slash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jbe    1152 <ne_path_has_trailing_slash+0x42>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_path_has_trailing_slash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     112d <ne_path_has_trailing_slash+0x1d>
mov    %rax,%rcx
xor    %eax,%eax
cmpb   $0x2f,-0x1(%rcx,%rbx,1)
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ne_path_has_trailing_slash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp ugt i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i64, i64* %3
%11 = sub i64 %10, 1
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 47
br label %16
16: ; preds = %8, %1
%17 = phi i1 [ false, %1 ], [ %15, %8 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @ne_path_has_trailing_slash(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 47
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ g(int);
int /*<<< orphan*/ h(int);
void main(int i) {
  f(1);
  g(1);
  h(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <f@plt>
mov    $0x1,%edi
call   1050 <g@plt>
mov    $0x1,%edi
call   1030 <h@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <f@plt>
mov    $0x1,%edi
call   1050 <g@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <h@plt>

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @f(i32 1)
%4 = call i32 @g(i32 1)
%5 = call i32 @h(i32 1)
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 @f(i32 1)
%3 = tail call i32 @g(i32 1)
%4 = tail call i32 @h(i32 1)
ret void
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
wchar_t test10(void) { return L'\e'; }


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

x86 assembly (clang, -O2):
<test10>:
mov    $0x1b,%eax
ret

LLVM IR (-O0):
define i32 @test10() {
ret i32 27
}

LLVM IR (-O2):
define i32 @test10() {
ret i32 27
}
/* Variables and functions */
int /*<<< orphan*/ merge_sort(int *, int /*<<< orphan*/, int /*<<< orphan*/);
void test_empty() {
  int array[] = {};
  merge_sort(array, 0, 0);
}


x86 assembly (clang, -O0):
<test_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <merge_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_empty>:
push   %rax
lea    0x4(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <merge_sort@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_empty() {
%1 = alloca [0 x i32]
%2 = bitcast [0 x i32]* %1 to i8*
%3 = getelementptr inbounds [0 x i32], [0 x i32]* %1, i64 0, i64 0
%4 = call i32 @merge_sort(i32* %3, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @test_empty() {
%1 = alloca [0 x i32]
%2 = bitcast [0 x i32]* %1 to i8*
%3 = getelementptr inbounds [0 x i32], [0 x i32]* %1, i64 0, i64 0
%4 = call i32 @merge_sort(i32* %3, i32 0, i32 0)
ret void
}
void g_timeout_source_new() {}


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

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

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

LLVM IR (-O2):
define void @g_timeout_source_new() {
ret void
}
/* Variables and functions */
int foo(int);
int function(int argc, char **argv) {
  int val;
  val = foo(13);
  return val;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xd,%edi
call   1030 <foo@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
mov    $0xd,%edi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @function(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 13)
ret i32 %3
}
/* Variables and functions */
int libc_fexecve(int, char *const *, char *const *);
int /*<<< orphan*/ watch_log(char *, int);
int fexecve(int fd, char *const *argv, char *const *envp) {
  watch_log("exec %d\n", fd);
  return libc_fexecve(fd, argv, envp);
}


x86 assembly (clang, -O0):
<fexecve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <watch_log@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <libc_fexecve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fexecve>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
mov    %ebp,%esi
call   1030 <watch_log@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <libc_fexecve@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"exec %d\0A\00"
define i32 @fexecve(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i32, i32* %4
%8 = call i32 @watch_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = load i8**, i8*** %6
%12 = call i32 @libc_fexecve(i32 %9, i8** %10, i8** %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [9 x i8] c"exec %d\0A\00"
define i32 @fexecve(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 @watch_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 @libc_fexecve(i32 %0, i8** %1, i8** %2)
ret i32 %5
}
/* Variables and functions */
int strcmp(char const *, char const *);
int generic_header_cmp(const char *s1, const char *s2) {
  return strcmp(s1, s2);
}


x86 assembly (clang, -O0):
<generic_header_cmp>:
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   1030 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_header_cmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @generic_header_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_read_random_coefficient_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(97, a, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<celcon_read_random_coefficient_system>:
mov    $0x61,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @celcon_read_random_coefficient_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 97, i32* undef, i32* undef, double* undef)
ret i32 %1
}
unsigned int stringToInt(char *key) {
  int number = 0;
  while (*key)
    number += *key++;
  return number;
}


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

x86 assembly (clang, -O2):
<stringToInt>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <stringToInt+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <stringToInt+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @stringToInt(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 %15
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = load i32, i32* %3
%14 = add nsw i32 %13, %12
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @stringToInt(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = add nsw i32 %6, %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %14
}
/* Variables and functions */
int labs(long);
long randm(int);
long expr_armor_add_def(long lev) { return (randm(labs(lev) / 20 + 1)); }


x86 assembly (clang, -O0):
<expr_armor_add_def>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <labs@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x1,%edi
call   1040 <randm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expr_armor_add_def>:
push   %rax
call   1030 <labs@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
sar    $0x23,%rcx
shr    $0x3f,%rax
lea    (%rcx,%rax,1),%edi
add    $0x1,%edi
pop    %rax
jmp    1040 <randm@plt>

LLVM IR (-O0):
define i64 @expr_armor_add_def(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @labs(i64 %3)
%5 = sdiv i32 %4, 20
%6 = add nsw i32 %5, 1
%7 = call i64 @randm(i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @expr_armor_add_def(i64 %0) {
%2 = tail call i32 @labs(i64 %0)
%3 = sdiv i32 %2, 20
%4 = add nsw i32 %3, 1
%5 = tail call i64 @randm(i32 %4)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int /*<<< orphan*/ foo(int);
void test() {
  foo(1);
  foo(2);
  bar(3);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <foo@plt>
mov    $0x2,%edi
call   1040 <foo@plt>
mov    $0x3,%edi
call   1030 <bar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x1,%edi
call   1040 <foo@plt>
mov    $0x2,%edi
call   1040 <foo@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @test() {
%1 = call i32 @foo(i32 1)
%2 = call i32 @foo(i32 2)
%3 = call i32 @bar(i32 3)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @foo(i32 1)
%2 = tail call i32 @foo(i32 2)
%3 = tail call i32 @bar(i32 3)
ret void
}
__attribute__((no, noclone)) short foo3(short arg) {
  short ret = -1;
  if (arg + 1 < ((!0) ? -(1 << (sizeof(short) * 8 - 1)) : 0) + 1 ||
      arg + 1 > 100)
    return ret;
  arg = arg + -1;
  ret = (char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0xffff,-0x6(%rbp)
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0xffff8001,%eax
jl     1133 <foo3+0x33>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x64,%eax
jle    1140 <foo3+0x40>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    115e <foo3+0x5e>
movswl -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movsbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
lea    -0x1(%rdi),%ecx
cmp    $0x64,%di
mov    $0xffff,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @foo3(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 -1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = icmp slt i32 %7, -32767
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i16, i16* %3
%11 = sext i16 %10 to i32
%12 = add nsw i32 %11, 1
%13 = icmp sgt i32 %12, 100
br i1 %13, label %14, label %16
14: ; preds = %9, %1
%15 = load i16, i16* %4
store i16 %15, i16* %2
br label %25
16: ; preds = %9
%17 = load i16, i16* %3
%18 = sext i16 %17 to i32
%19 = add nsw i32 %18, -1
%20 = trunc i32 %19 to i16
store i16 %20, i16* %3
%21 = load i16, i16* %3
%22 = trunc i16 %21 to i8
%23 = sext i8 %22 to i16
store i16 %23, i16* %4
%24 = load i16, i16* %3
store i16 %24, i16* %2
br label %25
25: ; preds = %16, %14
%26 = load i16, i16* %2
ret i16 %26
}

LLVM IR (-O2):
define signext i16 @foo3(i16 signext %0) {
%2 = icmp sgt i16 %0, 99
%3 = add i16 %0, -1
%4 = select i1 %2, i16 -1, i16 %3
ret i16 %4
}
/* Type definitions */
struct flock {
  scalar_t__ l_len;
  scalar_t__ l_start;
  int /*<<< orphan*/ l_whence;
  int /*<<< orphan*/ l_type;
};

/* Variables and functions */
int /*<<< orphan*/ F_SETLK;
int /*<<< orphan*/ F_UNLCK;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, struct flock *);
void my_unlock(int fd) {
  struct flock lock;
  lock.l_type = F_UNLCK;
  lock.l_whence = SEEK_SET;
  lock.l_start = 0;
  lock.l_len = 0;
  fcntl(fd, F_SETLK, &lock);
  return;
}


x86 assembly (clang, -O0):
<my_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_unlock>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <fcntl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i64, i64, i32, i32 }
@F_UNLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLK = global i32 0
define void @my_unlock(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.flock
store i32 %0, i32* %2
%4 = load i32, i32* @F_UNLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 3
store i32 %4, i32* %5
%6 = load i32, i32* @SEEK_SET
%7 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 2
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 1
store i64 0, i64* %8
%9 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 0
store i64 0, i64* %9
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETLK
%12 = call i32 @fcntl(i32 %10, i32 %11, %struct.flock* %3)
ret void
}

LLVM IR (-O2):
%struct.flock = type { i64, i64, i32, i32 }
@F_UNLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLK = global i32 0
define void @my_unlock(i32 %0) {
%2 = alloca %struct.flock
%3 = bitcast %struct.flock* %2 to i8*
%4 = load i32, i32* @F_UNLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 3
store i32 %4, i32* %5
%6 = load i32, i32* @SEEK_SET
%7 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 2
store i32 %6, i32* %7
%8 = bitcast %struct.flock* %2 to i8*
%9 = load i32, i32* @F_SETLK
%10 = call i32 @fcntl(i32 %0, i32 %9, %struct.flock* %2)
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
char *http_header_strip(char *content) {
  return strstr(content, "\r\n\r\n") + 4;
}


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

x86 assembly (clang, -O2):
<http_header_strip>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
add    $0x4,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0D\0A\0D\0A\00"
define i8* @http_header_strip(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %2, i64 4
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *);
void *malloc(size_t);
void *h2o_mem_alloc(size_t sz) {
  void *p = malloc(sz);
  if (p == NULL)
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/cubicdaiya/h2o/refs/heads/"
               "master/include/h2o/memory.h"
               ":"
               "330"
               ":"
               "no memory");
  return p;
}


x86 assembly (clang, -O0):
<h2o_mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <h2o_mem_alloc+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <h2o_mem_alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cubicdaiya/h2o/refs/heads/master/include/h2o/memory.h:330:no memory\00"
define i8* @h2o_mem_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @h2o__fatal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cubicdaiya/h2o/refs/heads/master/include/h2o/memory.h:330:no memory\00"
define noalias i8* @h2o_mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int test_imm_9Euint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x9E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Euint64_midword_reg>:
test   $0x9e0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Euint64_midword_reg(i64 %0) {
%2 = and i64 %0, 10354688
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int comp_ascend(const void *s1, const void *s2) {
  double *ss1, *ss2;
  ss1 = (double *)s1;
  ss2 = (double *)s2;
  if ((ss1)[0] > (ss2)[0]) {
    return -1;
  } else if ((ss1)[0] < (ss2)[0]) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<comp_ascend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    113e <comp_ascend+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <comp_ascend+0x70>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1164 <comp_ascend+0x64>
movl   $0x1,-0x4(%rbp)
jmp    1170 <comp_ascend+0x70>
jmp    1169 <comp_ascend+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_ascend>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comp_ascend(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = load double*, double** %7
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = fcmp ogt double %14, %17
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 -1, i32* %3
br label %31
20: ; preds = %2
%21 = load double*, double** %6
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = load double*, double** %7
%25 = getelementptr inbounds double, double* %24, i64 0
%26 = load double, double* %25
%27 = fcmp olt double %23, %26
br i1 %27, label %28, label %29
28: ; preds = %20
store i32 1, i32* %3
br label %31
29: ; preds = %20
br label %30
30: ; preds = %29
store i32 0, i32* %3
br label %31
31: ; preds = %30, %28, %19
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @comp_ascend(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = fcmp olt double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int test_imm_AFuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xAF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AFuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 175
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int execute_recvmsg() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_recvmsg() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%i\n", sizeof(long long));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int strlen(char const *);
int ModelicaStrings_length(const char *string) { return strlen(string); }


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

x86 assembly (clang, -O2):
<ModelicaStrings_length>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @ModelicaStrings_length(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ console_write(char *, int);
void console_crlf(void) { console_write("\r\n", 2); }


x86 assembly (clang, -O0):
<console_crlf>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
call   1030 <console_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_crlf>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <console_write@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @console_crlf() {
%1 = tail call i32 @console_write(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
int puts(s)
char const *s;
{
  char c;
  while ((c = *s++) != '\0')
    putchar(c);
  return (putchar('\n'));
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     114c <puts+0x3c>
movsbl -0x9(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1135 <puts+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
mov    $0xa,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
ret i32 %13
}
/* Variables and functions */
int send(int, void *, int, int /*<<< orphan*/);
int su_tcp_send(int fd, void *buf, int len) { return send(fd, buf, len, 0); }


x86 assembly (clang, -O0):
<su_tcp_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<su_tcp_send>:
xor    %ecx,%ecx
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define i32 @su_tcp_send(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
int main(void) {
  short a;
  char b;
  int c;
  c = b + a;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsbl -0x7(%rbp),%eax
movswl -0x6(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
movswl -0x6(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i8
%4 = alloca i32
store i32 0, i32* %1
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = add nsw i32 %6, %8
store i32 %9, i32* %4
%10 = load i16, i16* %2
%11 = sext i16 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char);
char *getstring(char ch) {
  char *mystr = "";
  while (ch != '"') {
    strcat(mystr, ch);
  }
  return mystr;
}


x86 assembly (clang, -O0):
<getstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x22,%eax
je     1148 <getstring+0x38>
mov    -0x10(%rbp),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strcat@plt>
jmp    1129 <getstring+0x19>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getstring>:
push   %r14
push   %rbx
push   %rax
cmp    $0x22,%dil
jne    1129 <getstring+0x19>
lea    0xedf(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
movsbl %dil,%ebx
lea    0xecc(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <strcat@plt>
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <strcat@plt>
jmp    1140 <getstring+0x30>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @getstring(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %4
4: ; preds = %8, %1
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 34
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = load i8, i8* %2
%11 = call i32 @strcat(i8* %9, i8 signext %10)
br label %4
12: ; preds = %4
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @getstring(i8 signext %0) {
%2 = icmp eq i8 %0, 34
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @strcat(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %5
5: ; preds = %5, %3
%6 = tail call i32 @strcat(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %5
7: ; preds = %1
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct timeval {
  long member_0;
  long member_1;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int serial_port_char_avail(int fd) {
  struct timeval tv = {0L, 25000L};
  fd_set fds;
  FD_ZERO(&fds);
  FD_SET(fd, &fds);
  return select(fd + 1, &fds, NULL, NULL, &tv);
}


x86 assembly (clang, -O0):
<serial_port_char_avail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   1050 <FD_SET@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
lea    -0x1c(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rdx
call   1040 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_port_char_avail>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edi,%ebx
movups 0xec0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1030 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
add    $0x1,%ebx
lea    0x10(%rsp),%r8
mov    %ebx,%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <select@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@__const.serial_port_char_avail.tv = %struct.timeval { i64 0, i64 25000 }
define i32 @serial_port_char_avail(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
%4 = alloca i32
store i32 %0, i32* %2
%5 = bitcast %struct.timeval* %3 to i8*
%6 = call i32 @FD_ZERO(i32* %4)
%7 = load i32, i32* %2
%8 = call i32 @FD_SET(i32 %7, i32* %4)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
%11 = call i32 @select(i32 %10, i32* %4, i32* null, i32* null, %struct.timeval* %3)
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@__const.serial_port_char_avail.tv = %struct.timeval { i64 0, i64 25000 }
define i32 @serial_port_char_avail(i32 %0) {
%2 = alloca %struct.timeval
%3 = alloca i32
%4 = bitcast %struct.timeval* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @FD_ZERO(i32* %3)
%7 = call i32 @FD_SET(i32 %0, i32* %3)
%8 = add nsw i32 %0, 1
%9 = call i32 @select(i32 %8, i32* %3, i32* null, i32* null, %struct.timeval* %2)
ret i32 %9
}
/* Variables and functions */
char *lltoa(long long, char *, int);
char *ltoa(long value, char *result, int base) {
  return lltoa((long long)value, result, base);
}


x86 assembly (clang, -O0):
<ltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <lltoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltoa>:
jmp    1030 <lltoa@plt>

LLVM IR (-O0):
define i8* @ltoa(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i8* @lltoa(i64 %7, i8* %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @ltoa(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @lltoa(i64 %0, i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
void *memset(void *, char, int);
void *os_memset(void *ptr, char c, int len) { return memset(ptr, c, len); }


x86 assembly (clang, -O0):
<os_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%edx
movsbl %al,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_memset>:
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @os_memset(i8* %0, i8 signext %1, i32 %2) {
%4 = tail call i8* @memset(i8* %0, i8 signext %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ m68ki_push_16(unsigned int);
int /*<<< orphan*/ m68ki_push_32(unsigned int);
void m68ki_stack_frame_0001(unsigned int pc, unsigned int sr,
                            unsigned int vector) {
  m68ki_push_16(0x1000 | (vector << 2));
  m68ki_push_32(pc);
  m68ki_push_16(sr);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
shl    $0x2,%edi
or     $0x1000,%edi
call   1040 <m68ki_push_16@plt>
mov    -0x4(%rbp),%edi
call   1030 <m68ki_push_32@plt>
mov    -0x8(%rbp),%edi
call   1040 <m68ki_push_16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x0(,%rdx,4),%edi
or     $0x1000,%edi
call   1040 <m68ki_push_16@plt>
mov    %ebp,%edi
call   1030 <m68ki_push_32@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <m68ki_push_16@plt>

LLVM IR (-O0):
define void @m68ki_stack_frame_0001(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = shl i32 %7, 2
%9 = or i32 4096, %8
%10 = call i32 @m68ki_push_16(i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @m68ki_push_32(i32 %11)
%13 = load i32, i32* %5
%14 = call i32 @m68ki_push_16(i32 %13)
ret void
}

LLVM IR (-O2):
define void @m68ki_stack_frame_0001(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = or i32 %4, 4096
%6 = tail call i32 @m68ki_push_16(i32 %5)
%7 = tail call i32 @m68ki_push_32(i32 %0)
%8 = tail call i32 @m68ki_push_16(i32 %1)
ret void
}