xunge/DecIR huggingface dataset:
unsigned long long totTillHere(long long unsigned *arr, long long unsigned n,
                               long long unsigned brr) {
  unsigned long long summer = 0, i;
  summer = (n == 0) ? 0 : (arr[n - 1] + ((n * brr) % 1000000007)) % 1000000007;
  return summer;
}


x86 assembly (clang, -O0):
<totTillHere>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1130 <totTillHere+0x30>
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,-0x30(%rbp)
jmp    116c <totTillHere+0x6c>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    $0x3b9aca07,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x38(%rbp),%rax
add    %rdx,%rax
mov    $0x3b9aca07,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<totTillHere>:
test   %rsi,%rsi
je     1147 <totTillHere+0x47>
mov    %rdx,%rcx
imul   %rsi,%rcx
movabs $0x89705f3112a28fe5,%r8
5f 70 89
mov    %rcx,%rax
mul    %r8
shr    $0x1d,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rcx
add    -0x8(%rdi,%rsi,8),%rcx
mov    %rcx,%rax
mul    %r8
shr    $0x1d,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,%rax
ret
xor    %ecx,%ecx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @totTillHere(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
store i64 0, i64* %7
%9 = load i64, i64* %5
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
br label %24
12: ; preds = %3
%13 = load i64*, i64** %4
%14 = load i64, i64* %5
%15 = sub i64 %14, 1
%16 = getelementptr inbounds i64, i64* %13, i64 %15
%17 = load i64, i64* %16
%18 = load i64, i64* %5
%19 = load i64, i64* %6
%20 = mul i64 %18, %19
%21 = urem i64 %20, 1000000007
%22 = add i64 %17, %21
%23 = urem i64 %22, 1000000007
br label %24
24: ; preds = %12, %11
%25 = phi i64 [ 0, %11 ], [ %23, %12 ]
store i64 %25, i64* %7
%26 = load i64, i64* %7
ret i64 %26
}

LLVM IR (-O2):
define i64 @totTillHere(i64* nocapture %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = add i64 %1, -1
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = load i64, i64* %7
%9 = mul i64 %2, %1
%10 = urem i64 %9, 1000000007
%11 = add i64 %8, %10
%12 = urem i64 %11, 1000000007
br label %13
13: ; preds = %3, %5
%14 = phi i64 [ %12, %5 ], [ 0, %3 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ Qsort(int *, int /*<<< orphan*/, int);
void quickSort(int A[], int N) { Qsort(A, 0, N - 1); }


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

x86 assembly (clang, -O2):
<quickSort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <Qsort@plt>

LLVM IR (-O0):
define void @quickSort(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 = sub nsw i32 %6, 1
%8 = call i32 @Qsort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @Qsort(i32* %0, i32 0, i32 %3)
ret void
}
void t1() {
  int a[2][3];
  int *p = a;
  *p = 1;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/array.c",
          9, 1, *p);
  ;
}


x86 assembly (clang, -O0):
<t1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
lea    0xec9(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <fexpect@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1>:
lea    0xee9(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %eax,%eax
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/array.c\00"
define void @t1() {
%1 = alloca [2 x [3 x i32]]
%2 = alloca i32*
%3 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 0
%4 = bitcast [3 x i32]* %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
store i32 1, i32* %5
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 9, i32 1, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/array.c\00"
define void @t1() {
%1 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 9, i32 1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flow1(int);
void *THREAD_D_main(void *arg) {
  flow1(10000);
  return NULL;
}


x86 assembly (clang, -O0):
<THREAD_D_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2710,%edi
call   1030 <flow1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @THREAD_D_main(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @flow1(i32 10000)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @THREAD_D_main(i8* nocapture readnone %0) {
%2 = tail call i32 @flow1(i32 10000)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void err_syntax20_error(const char *s) { printf("%s\n", s); }


x86 assembly (clang, -O0):
<err_syntax20_error>:
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):
<err_syntax20_error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @err_syntax20_error(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 @err_syntax20_error(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
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
reuseaddr_ports_exhausted_reusable_same_euid(struct __test_metadata *);
void wrapper_reuseaddr_ports_exhausted_reusable_same_euid(
    struct __test_metadata *_metadata,
    struct __fixture_variant_metadata *variant) {
  reuseaddr_ports_exhausted_reusable_same_euid(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_reuseaddr_ports_exhausted_reusable_same_euid>:
jmp    1030 <reuseaddr_ports_exhausted_reusable_same_euid@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_reuseaddr_ports_exhausted_reusable_same_euid(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @reuseaddr_ports_exhausted_reusable_same_euid(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_reuseaddr_ports_exhausted_reusable_same_euid(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @reuseaddr_ports_exhausted_reusable_same_euid(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int gAnd(int, int);
int gAnd4Way(int a, int b, int c, int d) {
  return gAnd(gAnd(a, b), gAnd(c, d));
}


x86 assembly (clang, -O0):
<gAnd4Way>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gAnd@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <gAnd@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <gAnd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gAnd4Way>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
call   1030 <gAnd@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <gAnd@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <gAnd@plt>

LLVM IR (-O0):
define i32 @gAnd4Way(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @gAnd(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @gAnd(i32 %12, i32 %13)
%15 = call i32 @gAnd(i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @gAnd4Way(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @gAnd(i32 %0, i32 %1)
%6 = tail call i32 @gAnd(i32 %2, i32 %3)
%7 = tail call i32 @gAnd(i32 %5, i32 %6)
ret i32 %7
}
/* Variables and functions */
int ap_get_single_string_command(int, int, char *, int);
int ap_get_title(int session, char *str) {
  return (ap_get_single_string_command(session, 0xcc1f, str, 256));
}


x86 assembly (clang, -O0):
<ap_get_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0xcc1f,%esi
mov    $0x100,%ecx
call   1030 <ap_get_single_string_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_get_title>:
mov    %rsi,%rdx
mov    $0xcc1f,%esi
mov    $0x100,%ecx
jmp    1030 <ap_get_single_string_command@plt>

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

LLVM IR (-O2):
define i32 @ap_get_title(i32 %0, i8* %1) {
%3 = tail call i32 @ap_get_single_string_command(i32 %0, i32 52255, i8* %1, i32 256)
ret i32 %3
}
void function_empty_state() {}


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

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

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

LLVM IR (-O2):
define void @function_empty_state() {
ret void
}
/* Variables and functions */
int color_eqn(int, int, int, int, int, int);
int g_cyg_cymg_yeg(int entrycyg, int entrycymg, int entryyeg, int entryyemg) {
  return color_eqn(74, entrycyg, 13, entryyeg, -46, entrycymg);
}


x86 assembly (clang, -O0):
<g_cyg_cymg_yeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%r9d
mov    $0x4a,%edi
mov    $0xd,%edx
mov    $0xffffffd2,%r8d
call   1030 <color_eqn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_cyg_cymg_yeg>:
mov    %edx,%ecx
mov    %esi,%r9d
mov    %edi,%esi
mov    $0x4a,%edi
mov    $0xd,%edx
mov    $0xffffffd2,%r8d
jmp    1030 <color_eqn@plt>

LLVM IR (-O0):
define i32 @g_cyg_cymg_yeg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = call i32 @color_eqn(i32 74, i32 %9, i32 13, i32 %10, i32 -46, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @g_cyg_cymg_yeg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @color_eqn(i32 74, i32 %0, i32 13, i32 %2, i32 -46, i32 %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n;
  for (n = 2; n < 60; n = n + 13)
    printf("%d \n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x3c,-0x8(%rbp)
jge    114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xd,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1c,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x29,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x36,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 15)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 28)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 41)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 54)
ret i32 0
}
/* Variables and functions */
scalar_t__ is_alnum(char);
int isopchar(char c) { return is_alnum(c) || c == ',' || c == '.'; }


x86 assembly (clang, -O0):
<isopchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <is_alnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1158 <isopchar+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2c,%ecx
mov    %al,-0x2(%rbp)
je     1158 <isopchar+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x2e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isopchar>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_alnum@plt>
test   %rax,%rax
setne  %al
and    $0xfd,%bl
cmp    $0x2c,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isopchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @is_alnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 44
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 46
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isopchar(i8 signext %0) {
%2 = tail call i64 @is_alnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = and i8 %0, -3
%5 = icmp eq i8 %4, 44
%6 = or i1 %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}
void thaw_processes(void) {}


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

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

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

LLVM IR (-O2):
define void @thaw_processes() {
ret void
}
/* Variables and functions */
float wrnoise_2d_fancy(float, float, int, int /*<<< orphan*/,
                       int /*<<< orphan*/, float *, float *, int);
float fancier_worley_noise(float x, float y) {
  float dontcare;
  return wrnoise_2d_fancy(x, y, 117, 0, 0, &dontcare, &dontcare, 0x00000002);
}


x86 assembly (clang, -O0):
<fancier_worley_noise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mov    $0x75,%edi
xor    %edx,%edx
lea    -0xc(%rbp),%r8
mov    $0x2,%r9d
mov    %edx,%esi
mov    %r8,%rcx
call   1030 <wrnoise_2d_fancy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fancier_worley_noise>:
push   %rax
lea    0x4(%rsp),%rcx
mov    $0x75,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    %rcx,%r8
mov    $0x2,%r9d
call   1030 <wrnoise_2d_fancy@plt>
pop    %rax
ret

LLVM IR (-O0):
define float @fancier_worley_noise(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call float @wrnoise_2d_fancy(float %6, float %7, i32 117, i32 0, i32 0, float* %5, float* %5, i32 2)
ret float %8
}

LLVM IR (-O2):
define float @fancier_worley_noise(float %0, float %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = call float @wrnoise_2d_fancy(float %0, float %1, i32 117, i32 0, i32 0, float* %3, float* %3, i32 2)
ret float %5
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c))
    return (c - 'A') + 'a';
  else
    return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113e <tolower+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <tolower+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isupper(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 65
%10 = add nsw i32 %9, 97
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
size_t st_strlen(const char *str) {
  const char *keep;
  keep = str;
  if (str) {
    while (*str != '\0')
      ++str;
  }
  return ((size_t)(str - keep));
}


x86 assembly (clang, -O0):
<st_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <st_strlen+0x46>
jmp    1120 <st_strlen+0x20>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <st_strlen+0x41>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <st_strlen+0x20>
jmp    1146 <st_strlen+0x46>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_strlen>:
test   %rdi,%rdi
je     1121 <st_strlen+0x21>
lea    -0x1(%rdi),%rcx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rcx)
mov    %rax,%rcx
jne    1110 <st_strlen+0x10>
sub    %rdi,%rax
ret
xor    %eax,%eax
sub    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @st_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %7, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ]
%10 = ptrtoint i8* %9 to i64
%11 = ptrtoint i8* %0 to i64
%12 = sub i64 %10, %11
ret i64 %12
}
/* Variables and functions */
double fabs(double);
double pow(double, double);
double mass(double sma, double period) {
  double m;
  double m_numerator;
  double m_denominator;
  m_numerator = 4 * pow(3.14159265358979323846, 2.0) * pow(fabs(sma), 3.0);
  m_denominator = 6.67408E-11 * pow(fabs(period), 2.0);
  m = m_numerator / m_denominator;
  return m;
}


x86 assembly (clang, -O0):
<mass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xef6(%rip),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xed6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xed9(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xead(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xeab(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xe77(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe5f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mass>:
push   %rax
movsd  %xmm1,(%rsp)
andpd  0xee2(%rip),%xmm0
movsd  0xeea(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee5(%rip),%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mass(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
%8 = call double @pow(double 0x400921FB54442D18, double 2.000000e+00)
%9 = fmul double 4.000000e+00, %8
%10 = load double, double* %3
%11 = call double @llvm.fabs.f64(double %10)
%12 = call double @pow(double %11, double 3.000000e+00)
%13 = fmul double %9, %12
store double %13, double* %6
%14 = load double, double* %4
%15 = call double @llvm.fabs.f64(double %14)
%16 = call double @pow(double %15, double 2.000000e+00)
%17 = fmul double 6.674080e-11, %16
store double %17, double* %7
%18 = load double, double* %6
%19 = load double, double* %7
%20 = fdiv double %18, %19
store double %20, double* %5
%21 = load double, double* %5
ret double %21
}

LLVM IR (-O2):
define double @mass(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %0)
%4 = tail call double @pow(double %3, double 3.000000e+00)
%5 = fmul double %4, 0x4043BD3CC9BE45DE
%6 = fmul double %1, %1
%7 = fmul double %6, 6.674080e-11
%8 = fdiv double %5, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x43_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x43_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x43_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x43_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x43_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
void ftest3(struct Data1 *ptr0) {}


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

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

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

LLVM IR (-O2):
%struct.Data1 = type opaque
define void @ftest3(%struct.Data1* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ creer_serveur(int);
int /*<<< orphan*/ initialiser_signaux();
int main(void) {
  initialiser_signaux();
  creer_serveur(8888);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initialiser_signaux@plt>
mov    $0x22b8,%edi
call   1040 <creer_serveur@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initialiser_signaux()
%3 = call i32 @creer_serveur(i32 8888)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialiser_signaux()
%2 = tail call i32 @creer_serveur(i32 8888)
ret i32 0
}
/* Variables and functions */
void *realloc(void *, size_t);
void *__attribute__((malloc)) stringTreeRealloc_(void *ptr, size_t size) {
  return realloc(ptr, size);
}


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

x86 assembly (clang, -O2):
<stringTreeRealloc_>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @stringTreeRealloc_(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ event;
};
struct TYPE_4__ {
  TYPE_1__ xdestroywindow;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xdestroywindow_event(void *_p) {
  return (unsigned long)((XEvent *)_p)->xdestroywindow.event;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xdestroywindow_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xdestroywindow_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void SysCtlADCSpeedSet(unsigned long ulSpeed) {

  ;
  (*((volatile unsigned long *)(0x400FE100))) =
      (((*((volatile unsigned long *)(0x400FE100))) & ~(0x00000F00)) | ulSpeed);
  (*((volatile unsigned long *)(0x400FE110))) =
      (((*((volatile unsigned long *)(0x400FE110))) & ~(0x00000F00)) | ulSpeed);
}


x86 assembly (clang, -O0):
<SysCtlADCSpeedSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400fe100,%eax
mov    (%rax),%rcx
and    $0xfffffffffffff0ff,%rcx
or     -0x8(%rbp),%rcx
mov    $0x400fe100,%eax
mov    %rcx,(%rax)
mov    $0x400fe110,%eax
mov    (%rax),%rcx
and    $0xfffffffffffff0ff,%rcx
or     -0x8(%rbp),%rcx
mov    $0x400fe110,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlADCSpeedSet>:
mov    $0xfffffffffffff0ff,%rax
mov    0x400fe100,%rcx
40
and    %rax,%rcx
or     %rdi,%rcx
mov    %rcx,0x400fe100
40
and    0x400fe110,%rax
40
or     %rdi,%rax
mov    %rax,0x400fe110
40
ret

LLVM IR (-O0):
define void @SysCtlADCSpeedSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%4 = and i64 %3, -3841
%5 = load i64, i64* %2
%6 = or i64 %4, %5
store volatile i64 %6, i64* inttoptr (i64 1074782464 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1074782480 to i64*)
%8 = and i64 %7, -3841
%9 = load i64, i64* %2
%10 = or i64 %8, %9
store volatile i64 %10, i64* inttoptr (i64 1074782480 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlADCSpeedSet(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%3 = and i64 %2, -3841
%4 = or i64 %3, %0
store volatile i64 %4, i64* inttoptr (i64 1074782464 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1074782480 to i64*)
%6 = and i64 %5, -3841
%7 = or i64 %6, %0
store volatile i64 %7, i64* inttoptr (i64 1074782480 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SetScl(int);
int /*<<< orphan*/ SetSda(int);
void I2CBusNotBusy(void) {
  SetScl(1);
  SetSda(1);
}


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

x86 assembly (clang, -O2):
<I2CBusNotBusy>:
push   %rax
mov    $0x1,%edi
call   1040 <SetScl@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <SetSda@plt>

LLVM IR (-O0):
define void @I2CBusNotBusy() {
%1 = call i32 @SetScl(i32 1)
%2 = call i32 @SetSda(i32 1)
ret void
}

LLVM IR (-O2):
define void @I2CBusNotBusy() {
%1 = tail call i32 @SetScl(i32 1)
%2 = tail call i32 @SetSda(i32 1)
ret void
}
int writemask_xyz(const int writemask) { return (writemask == 0x7); }


x86 assembly (clang, -O0):
<writemask_xyz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<writemask_xyz>:
xor    %eax,%eax
cmp    $0x7,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @writemask_xyz(i32 %0) {
%2 = icmp eq i32 %0, 7
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void command_Free(int argc, char **argv) {
  while (argc) {
    free(*argv);
    argc--;
    argv++;
  }
}


x86 assembly (clang, -O0):
<command_Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114f <command_Free+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    111f <command_Free+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_Free>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
je     1142 <command_Free+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <command_Free+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @command_Free(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i8** [ %10, %4 ], [ %1, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = load i8*, i8** %5
%8 = tail call i32 @free(i8* %7)
%9 = add nsw i32 %6, -1
%10 = getelementptr inbounds i8*, i8** %5, i64 1
%11 = icmp eq i32 %9, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ done();
int /*<<< orphan*/ while1();
void main(void) {
  while1();
  done();
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @while1()
%2 = call i32 (...) @done()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @while1()
%2 = tail call i32 (...) @done()
ret void
}
void main() {
  struct types {
    int arr[7];
  } obj;
  obj.arr[0] = 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.types = type { [7 x i32] }
define void @main() {
%1 = alloca %struct.types
%2 = getelementptr inbounds %struct.types, %struct.types* %1, i32 0, i32 0
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
store i32 1, i32* %3
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t EndianConvert(uint32_t n) {
  unsigned char *np = (unsigned char *)&n;
  return ((uint32_t)np[0] << 24) | ((uint32_t)np[1] << 16) |
         ((uint32_t)np[2] << 8) | (uint32_t)np[3];
}


x86 assembly (clang, -O0):
<EndianConvert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EndianConvert>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @EndianConvert(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 24
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %9, %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = or i32 %15, %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = or i32 %21, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @EndianConvert(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int get_child_num(int cpus) { return cpus; }


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

x86 assembly (clang, -O2):
<get_child_num>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @get_child_num(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int strcmp(char *, char *);
int compareFunc(const void *first, const void *second) {
  return strcmp((char *)first, (char *)second);
}


x86 assembly (clang, -O0):
<compareFunc>:
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):
<compareFunc>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compareFunc(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 @compareFunc(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t SysCtlADCSpeedGet(void) {
  return ((*((volatile uint32_t *)(0x400FE100))) & (0x00000C00 | 0x00000300));
}


x86 assembly (clang, -O0):
<SysCtlADCSpeedGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe100,%eax
mov    (%rax),%eax
and    $0xf00,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlADCSpeedGet>:
mov    $0xf00,%eax
and    0x400fe100,%eax
ret

LLVM IR (-O0):
define i32 @SysCtlADCSpeedGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074782464 to i32*)
%2 = and i32 %1, 3840
ret i32 %2
}

LLVM IR (-O2):
define i32 @SysCtlADCSpeedGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074782464 to i32*)
%2 = and i32 %1, 3840
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void get_iter_error(int *p_iter, int *p_error) {
  printf("\nEnter the Criterion Error <0-100>: ");
  scanf("%d", p_error);
  printf("Enter the number of maximum iteration: ");
  scanf("%d", p_iter);
}


x86 assembly (clang, -O0):
<get_iter_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xede(%rip),%rdi
call   1040 <scanf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_iter_error>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"\0AEnter the Criterion Error <0-100>: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [40 x i8] c"Enter the number of maximum iteration: \00"
define void @get_iter_error(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %4
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %3
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"\0AEnter the Criterion Error <0-100>: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [40 x i8] c"Enter the number of maximum iteration: \00"
define void @get_iter_error(i32* %0, i32* %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cginclw(int a) { ngen("%s\t%d(%%rbp)", "incq", a); }


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

x86 assembly (clang, -O2):
<cginclw>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\09%d(%%rbp)\00"
@.str.1 = [5 x i8] c"incq\00"
define void @cginclw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09%d(%%rbp)\00"
@.str.1 = [5 x i8] c"incq\00"
define void @cginclw(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int _fwrite(unsigned char *, int, int /*<<< orphan*/ *);
int fputc(int c, FILE *f) {
  unsigned char ch = c;
  return _fwrite(&ch, 1, f) == 1 ? ch : EOF;
}


x86 assembly (clang, -O0):
<fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x11(%rbp),%rdi
mov    $0x1,%esi
call   1030 <_fwrite@plt>
cmp    $0x1,%eax
jne    114c <fputc+0x3c>
movzbl -0x11(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1158 <fputc+0x48>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc>:
push   %rax
mov    %rsi,%rdx
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <_fwrite@plt>
cmp    $0x1,%eax
je     1138 <fputc+0x28>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
movzbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @fputc(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load i32*, i32** %4
%9 = call i32 @_fwrite(i8* %5, i32 1, i32* %8)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
br label %16
14: ; preds = %2
%15 = load i32, i32* @EOF
br label %16
16: ; preds = %14, %11
%17 = phi i32 [ %13, %11 ], [ %15, %14 ]
ret i32 %17
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fputc(i32 %0, i32* %1) {
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = call i32 @_fwrite(i8* %3, i32 1, i32* %1)
%6 = icmp eq i32 %5, 1
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = load i32, i32* @EOF
%10 = select i1 %6, i32 %8, i32 %9
ret i32 %10
}
void test_builtin_types_compatible_p(unsigned long i) {
  __emit_expression_range(0, f(i) + __builtin_types_compatible_p(long, int));
  __emit_expression_range(0, __builtin_types_compatible_p(long, int) + f(i));
}


x86 assembly (clang, -O0):
<test_builtin_types_compatible_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%esi
add    $0x0,%esi
xor    %edi,%edi
mov    $0x0,%al
call   1040 <__emit_expression_range@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%esi
add    $0x0,%esi
xor    %edi,%edi
mov    $0x0,%al
call   1040 <__emit_expression_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_types_compatible_p>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <f@plt>
xor    %edi,%edi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <__emit_expression_range@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <f@plt>
xor    %edi,%edi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_builtin_types_compatible_p(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 (i64, ...) bitcast (i32 (...)* @f to i32 (i64, ...)*)(i64 %3)
%5 = add nsw i32 %4, 0
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i32, ...)*)(i32 0, i32 %5)
%7 = load i64, i64* %2
%8 = call i32 (i64, ...) bitcast (i32 (...)* @f to i32 (i64, ...)*)(i64 %7)
%9 = add nsw i32 0, %8
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i32, ...)*)(i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @test_builtin_types_compatible_p(i64 %0) {
%2 = tail call i32 (i64, ...) bitcast (i32 (...)* @f to i32 (i64, ...)*)(i64 %0)
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i32, ...)*)(i32 0, i32 %2)
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @f to i32 (i64, ...)*)(i64 %0)
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i32, ...)*)(i32 0, i32 %4)
ret void
}
int kvmppc_get_cap_safe_cache(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kvmppc_get_cap_safe_cache() {
ret i32 0
}