xunge/DecIR huggingface dataset:
void castlower(str) register char *str;
{
  for (; *str; str++)
    if ((unsigned)*str - 'A' <= 'Z' - 'A')
      *str += 'a' - 'A';
}


x86 assembly (clang, -O0):
<castlower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <castlower+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x41,%eax
cmp    $0x19,%eax
ja     1134 <castlower+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
jmp    1139 <castlower+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <castlower+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<castlower>:
mov    (%rdi),%al
test   %al,%al
je     112d <castlower+0x2d>
add    $0x1,%rdi
jmp    111b <castlower+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112d <castlower+0x2d>
movsbl %al,%ecx
add    $0xffffffbf,%ecx
cmp    $0x19,%ecx
ja     1110 <castlower+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <castlower+0x10>
ret

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

LLVM IR (-O2):
define void @castlower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = add nsw i32 %7, -65
%9 = icmp ult i32 %8, 26
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = add i8 %5, 32
store i8 %11, i8* %6
br label %12
12: ; preds = %4, %10
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ check_policy_common(int, int const);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
void check_policy_written(FILE *fp, const int id) {
  fflush(fp);
  check_policy_common(1, id);
}


x86 assembly (clang, -O0):
<check_policy_written>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
call   1030 <check_policy_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_policy_written>:
push   %rbx
mov    %esi,%ebx
call   1040 <fflush@plt>
mov    $0x1,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <check_policy_common@plt>

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

LLVM IR (-O2):
define void @check_policy_written(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fflush(i32* %0)
%4 = tail call i32 @check_policy_common(i32 1, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  uint8_t *i_ptr = malloc(0);
  printf("i_ptr= %p\n", i_ptr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"i_ptr= %p\0A\00"
define i32 @main(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* @malloc(i32 0)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"i_ptr= %p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_creds_get_tid(void *c,
                                                                pid_t *tid) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_creds_get_tid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_tid(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_tid(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ shutdown(int, int);
int /*<<< orphan*/ unlink(char *);
int cleanup_socket(int s, char *f) {
  shutdown(s, 2);
  close(s);
  unlink(f);
  return 0;
}


x86 assembly (clang, -O0):
<cleanup_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1040 <shutdown@plt>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_socket>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x2,%esi
call   1040 <shutdown@plt>
mov    %ebp,%edi
call   1050 <close@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cleanup_socket(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 = call i32 @shutdown(i32 %5, i32 2)
%7 = load i32, i32* %3
%8 = call i32 @close(i32 %7)
%9 = load i8*, i8** %4
%10 = call i32 @unlink(i8* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @cleanup_socket(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @shutdown(i32 %0, i32 2)
%4 = tail call i32 @close(i32 %0)
%5 = tail call i32 @unlink(i8* %1)
ret i32 0
}
int foo(int x, int y, int a) {
  int i = x;
  int j = y;
  __builtin_expect(x > y, 1);
  if (x > y) {
    i = a;
    j = i;
  }
  return i * j;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1131 <foo+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edx,%edi
cmovg  %edx,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %2, i32 %0
%6 = select i1 %4, i32 %2, i32 %1
%7 = mul nsw i32 %5, %6
ret i32 %7
}
void g_param_spec_value_array() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_value_array() {
ret void
}
/* Variables and functions */
int bestEstimateOfStDev(float *, int);
int sqrt(int);
double StandardErrorOfMean(float *data, int n) {
  return (double)(bestEstimateOfStDev(data, n) / sqrt(n));
}


x86 assembly (clang, -O0):
<StandardErrorOfMean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <bestEstimateOfStDev@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StandardErrorOfMean>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <bestEstimateOfStDev@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <sqrt@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @StandardErrorOfMean(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%5 = load float*, float** %3
%6 = load i32, i32* %4
%7 = call i32 @bestEstimateOfStDev(float* %5, i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @sqrt(i32 %8)
%10 = sdiv i32 %7, %9
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @StandardErrorOfMean(float* %0, i32 %1) {
%3 = tail call i32 @bestEstimateOfStDev(float* %0, i32 %1)
%4 = tail call i32 @sqrt(i32 %1)
%5 = sdiv i32 %3, %4
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int check_file_exist(char *path) {
  if (access(path, F_OK) != -1) {
    printf("Something\n");
    return EXIT_SUCCESS;
  } else {
    printf("Something NOK\n");
    return EXIT_FAILURE;
  }
}


x86 assembly (clang, -O0):
<check_file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
je     1164 <check_file_exist+0x44>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117c <check_file_exist+0x5c>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_file_exist>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
lea    0xec7(%rip),%rax
lea    0xece(%rip),%rdi
cmove  %rax,%rdi
mov    0x2e8d(%rip),%rbx
cmove  0x2e8d(%rip),%rbx
call   1030 <puts@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_OK = global i32 0
@.str = [11 x i8] c"Something\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.1 = [15 x i8] c"Something NOK\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @check_file_exist(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @F_OK
%6 = call i32 @access(i8* %4, i32 %5)
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_SUCCESS
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@F_OK = global i32 0
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
@str = [14 x i8] c"Something NOK\00"
@str.2 = [10 x i8] c"Something\00"
define i32 @check_file_exist(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
%5 = select i1 %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.2, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = load i32, i32* @EXIT_SUCCESS
%9 = select i1 %4, i32 %7, i32 %8
ret i32 %9
}
void SteamAPI_ISteamMatchmakingServers_ReleaseRequest(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamMatchmakingServers_ReleaseRequest>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmakingServers_ReleaseRequest = [49 x i8] c"SteamAPI_ISteamMatchmakingServers_ReleaseRequest\00"
define void @SteamAPI_ISteamMatchmakingServers_ReleaseRequest(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @__func__.SteamAPI_ISteamMatchmakingServers_ReleaseRequest, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmakingServers_ReleaseRequest = [49 x i8] c"SteamAPI_ISteamMatchmakingServers_ReleaseRequest\00"
define void @SteamAPI_ISteamMatchmakingServers_ReleaseRequest(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @__func__.SteamAPI_ISteamMatchmakingServers_ReleaseRequest, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int *factorial(int *, int, int);
int *malloc(int);
int /*<<< orphan*/ print_fact(int *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  int *arr = malloc(sizeof(int) * 200);
  arr[0] = 1;
  arr = factorial(arr, 200, n);
  print_fact(arr, 200);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x320,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    $0xc8,%esi
call   1030 <factorial@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xc8,%esi
call   1040 <print_fact@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    $0x320,%edi
call   1050 <malloc@plt>
movl   $0x1,(%rax)
mov    0x4(%rsp),%edx
mov    %rax,%rdi
mov    $0xc8,%esi
call   1030 <factorial@plt>
mov    %rax,%rdi
mov    $0xc8,%esi
call   1040 <print_fact@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = call i32* @malloc(i32 800)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 1, i32* %7
%8 = load i32*, i32** %3
%9 = load i32, i32* %2
%10 = call i32* @factorial(i32* %8, i32 200, i32 %9)
store i32* %10, i32** %3
%11 = load i32*, i32** %3
%12 = call i32 @print_fact(i32* %11, i32 200)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32* @malloc(i32 800)
store i32 1, i32* %4
%5 = load i32, i32* %1
%6 = call i32* @factorial(i32* %4, i32 200, i32 %5)
%7 = call i32 @print_fact(i32* %6, i32 200)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_dir_cb(const char *path, int level, void *user_data_) {
  (void)user_data_;
  (void)level;
  printf("%s\n", path);
}


x86 assembly (clang, -O0):
<print_dir_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_dir_cb(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void funkcja(int n, int k, int *q, int *r) {
  *q = (n / k);
  *r = (n % k);
}


x86 assembly (clang, -O0):
<funkcja>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<funkcja>:
mov    %rdx,%r8
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,(%r8)
mov    %edx,(%rcx)
ret

LLVM IR (-O0):
define void @funkcja(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 = sdiv i32 %9, %10
%12 = load i32*, i32** %7
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = srem i32 %13, %14
%16 = load i32*, i32** %8
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @funkcja(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = sdiv i32 %0, %1
store i32 %5, i32* %2
%6 = srem i32 %0, %1
store i32 %6, i32* %3
ret void
}
/* Variables and functions */
char *place_commas_in_double(double);
int strlen(char *);
char *commas_in_money(double d) {
  char *results;
  results = place_commas_in_double(d);
  *(results + strlen(results) - 1) = '\0';
  return results;
}


x86 assembly (clang, -O0):
<commas_in_money>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <place_commas_in_double@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movb   $0x0,-0x1(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commas_in_money>:
push   %rbx
call   1040 <place_commas_in_double@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @commas_in_money(double %0) {
%2 = alloca double
%3 = alloca i8*
store double %0, double* %2
%4 = load double, double* %2
%5 = call i8* @place_commas_in_double(double %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = getelementptr inbounds i8, i8* %10, i64 -1
store i8 0, i8* %11
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @commas_in_money(double %0) {
%2 = tail call i8* @place_commas_in_double(double %0)
%3 = tail call i32 @strlen(i8* %2)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %2, i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 -1
store i8 0, i8* %6
ret i8* %2
}
void my__builtin_va_arg(__builtin_va_list arg0, unsigned long arg1,
                        void *arg2) {
  return;
}


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

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

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

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @my__builtin_va_arg(%struct.__va_list_tag* nocapture %0, i64 %1, i8* nocapture %2) {
ret void
}
void av_channel_layout_extract_channel() {}


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

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

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

LLVM IR (-O2):
define void @av_channel_layout_extract_channel() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_int(char **, int);
void send_float(char **pp, float value) {
  union {
    float f;
    int i;
  } u;
  u.f = value;
  send_int(pp, u.i);
}


x86 assembly (clang, -O0):
<send_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <send_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_float>:
movd   %xmm0,%esi
jmp    1030 <send_int@plt>

LLVM IR (-O0):
%union.anon = type { float }
define void @send_float(i8** %0, float %1) {
%3 = alloca i8**
%4 = alloca float
%5 = alloca %union.anon
store i8** %0, i8*** %3
store float %1, float* %4
%6 = load float, float* %4
%7 = bitcast %union.anon* %5 to float*
store float %6, float* %7
%8 = load i8**, i8*** %3
%9 = bitcast %union.anon* %5 to i32*
%10 = load i32, i32* %9
%11 = call i32 @send_int(i8** %8, i32 %10)
ret void
}

LLVM IR (-O2):
define void @send_float(i8** %0, float %1) {
%3 = bitcast float %1 to i32
%4 = tail call i32 @send_int(i8** %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
scalar_t__ strtol(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
void *wtypeInt_fromString(const char *string) {
  assert(string);
  return (void *)strtol(string, NULL, 0);
}


x86 assembly (clang, -O0):
<wtypeInt_fromString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wtypeInt_fromString>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <strtol@plt>

LLVM IR (-O0):
define i8* @wtypeInt_fromString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = call i64 @strtol(i8* %5, i32* null, i32 0)
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @wtypeInt_fromString(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 0)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ same_screen;
};
typedef TYPE_1__ XPointerMovedEvent;

/* Variables and functions */
int get_XPointerMovedEvent_same_screen(void *_p) {
  return (int)((XPointerMovedEvent *)_p)->same_screen;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XPointerMovedEvent_same_screen(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned int __get_cpsr();
int /*<<< orphan*/ __set_cpsr(unsigned int);
unsigned enableIRQ(void) {
  unsigned _cpsr;
  _cpsr = __get_cpsr();
  __set_cpsr(_cpsr & ~0x00000080);
  return _cpsr;
}


x86 assembly (clang, -O0):
<enableIRQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__get_cpsr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffffff7f,%edi
call   1030 <__set_cpsr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enableIRQ>:
push   %rbx
xor    %eax,%eax
call   1040 <__get_cpsr@plt>
mov    %eax,%ebx
mov    %eax,%edi
and    $0xffffff7f,%edi
call   1030 <__set_cpsr@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @enableIRQ() {
%1 = alloca i32
%2 = call i32 (...) @__get_cpsr()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -129
%5 = call i32 @__set_cpsr(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @enableIRQ() {
%1 = tail call i32 (...) @__get_cpsr()
%2 = and i32 %1, -129
%3 = tail call i32 @__set_cpsr(i32 %2)
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ uint32_t;
typedef scalar_t__ l;
typedef scalar_t__ int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int32_t int16_comparator(const void *l, const void *r) {
  return (int16_t)(uint32_t)(uint64_t)(l) - (int16_t)(uint32_t)(uint64_t)(r);
}


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

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

LLVM IR (-O0):
define i64 @int16_comparator(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 = ptrtoint i8* %5 to i64
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = sub nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @int16_comparator(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub nsw i64 %3, %4
ret i64 %5
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzBinaryFuncConstR_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN_DELAYED(int, int /*<<< orphan*/);
void BrzBinaryFuncConstRPush_ackdown(struct comp *comp, int port) {
  struct BrzBinaryFuncConstR_ *c = (struct BrzBinaryFuncConstR_ *)comp;
  SEND_ACKDOWN_DELAYED(1, 0);
}


x86 assembly (clang, -O0):
<BrzBinaryFuncConstRPush_ackdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzBinaryFuncConstRPush_ackdown>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <SEND_ACKDOWN_DELAYED@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzBinaryFuncConstR_ = type { i32 }
define void @BrzBinaryFuncConstRPush_ackdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzBinaryFuncConstR_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzBinaryFuncConstR_*
store %struct.BrzBinaryFuncConstR_* %7, %struct.BrzBinaryFuncConstR_** %5
%8 = call i32 @SEND_ACKDOWN_DELAYED(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzBinaryFuncConstRPush_ackdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKDOWN_DELAYED(i32 1, i32 0)
ret void
}
double foo(void) { return 42.0; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @foo() {
ret double 4.200000e+01
}

LLVM IR (-O2):
define double @foo() {
ret double 4.200000e+01
}
void handle_SYS(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_SYS(i32 %0) {
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *kernel_name(const char *prefix, const char *name) {
  char *buf = malloc(strlen(prefix) + strlen(name) + 1);
  strcpy(buf, prefix);
  strcat(buf, name);
  return buf;
}


x86 assembly (clang, -O0):
<kernel_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_name>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @kernel_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @kernel_name(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("I am alive!  Beware.\n");
  getchar();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"I am alive! Beware.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"I am alive! Beware.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
void foo777(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo777(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ update_pwm();
void init_pwm(void) { update_pwm(); }


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

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

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

LLVM IR (-O2):
define void @init_pwm() {
%1 = tail call i32 (...) @update_pwm()
ret void
}
double deriv_x(double t, double x, double v) { return v; }


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

x86 assembly (clang, -O2):
<deriv_x>:
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @deriv_x(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
ret double %7
}

LLVM IR (-O2):
define double @deriv_x(double %0, double %1, double returned %2) {
ret double %2
}
/* Variables and functions */
int unlink(char const *);
int sysUnlink(const char *pszPath) { return unlink(pszPath); }


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

x86 assembly (clang, -O2):
<sysUnlink>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @sysUnlink(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
long int gcd(long int num1, long int num2) {
  while (num1 != num2) {
    if (num1 > num2)
      num1 -= num2;
    else
      num2 -= num1;
  }
  return num1;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1150 <gcd+0x50>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    113c <gcd+0x3c>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    114b <gcd+0x4b>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <gcd+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
cmp    %rsi,%rdi
je     112e <gcd+0x2e>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
cmp    %rax,%rsi
mov    $0x0,%edx
cmovl  %rsi,%rdx
mov    %rax,%rdi
cmovl  %rcx,%rdi
sub    %rdx,%rax
sub    %rdi,%rsi
cmp    %rsi,%rax
jne    1110 <gcd+0x10>
ret

LLVM IR (-O0):
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %5
5: ; preds = %21, %2
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %22
9: ; preds = %5
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = icmp sgt i64 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = sub nsw i64 %15, %14
store i64 %16, i64* %3
br label %21
17: ; preds = %9
%18 = load i64, i64* %3
%19 = load i64, i64* %4
%20 = sub nsw i64 %19, %18
store i64 %20, i64* %4
br label %21
21: ; preds = %17, %13
br label %5
22: ; preds = %5
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ %1, %2 ]
%6 = phi i64 [ %9, %4 ], [ %0, %2 ]
%7 = icmp slt i64 %5, %6
%8 = select i1 %7, i64 %5, i64 0
%9 = sub nsw i64 %6, %8
%10 = select i1 %7, i64 0, i64 %6
%11 = sub nsw i64 %5, %10
%12 = icmp eq i64 %9, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i64 [ %0, %2 ], [ %9, %4 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ r4030_delay();
extern unsigned int r4030_read_reg32(unsigned addr) {
  unsigned int ret = *((volatile unsigned int *)addr);
  r4030_delay();
  return ret;
}


x86 assembly (clang, -O0):
<r4030_read_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <r4030_delay@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r4030_read_reg32>:
push   %rbx
mov    %edi,%eax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <r4030_delay@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @r4030_read_reg32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
store i32 %7, i32* %3
%8 = call i32 (...) @r4030_delay()
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @r4030_read_reg32(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = tail call i32 (...) @r4030_delay()
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;
typedef scalar_t__ ui32Base;

/* Variables and functions */
void PWMGenIntTrigDisable(uint32_t ui32Base, uint32_t ui32Gen,
                          uint32_t ui32IntTrig) {
  ;
  ;

  ;
  (*((volatile uint32_t *)(((ui32Base) + (ui32Gen)) + 0x00000004))) &=
      ~(ui32IntTrig);
}


x86 assembly (clang, -O0):
<PWMGenIntTrigDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    %rcx,%rax
mov    0x4(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenIntTrigDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    %rdx,-0x18(%rsp)
mov    -0x18(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
mov    -0x10(%rsp),%rdx
and    %rax,0x4(%rcx,%rdx,1)
ret

LLVM IR (-O0):
define void @PWMGenIntTrigDisable(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store volatile i64 %0, i64* %4
store volatile i64 %1, i64* %5
store volatile i64 %2, i64* %6
%7 = load volatile i64, i64* %6
%8 = xor i64 %7, -1
%9 = load volatile i64, i64* %4
%10 = load volatile i64, i64* %5
%11 = add nsw i64 %9, %10
%12 = add nsw i64 %11, 4
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = and i64 %14, %8
store volatile i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @PWMGenIntTrigDisable(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store volatile i64 %0, i64* %4
store volatile i64 %1, i64* %5
store volatile i64 %2, i64* %6
%7 = load volatile i64, i64* %6
%8 = xor i64 %7, -1
%9 = load volatile i64, i64* %4
%10 = load volatile i64, i64* %5
%11 = add i64 %9, 4
%12 = add i64 %11, %10
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = and i64 %14, %8
store volatile i64 %15, i64* %13
ret void
}
int main() {
  int x = 0, y = 0, N;
  while (1) {
    x = x * -1 + y * y;
    y++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
imul   $0xffffffff,-0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    %ecx,-0x1c(%rbp)
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %0, %5
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, -1
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %7, %10
store i32 %11, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %5
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void isODD(int num) { (num % 2 == 0) ? printf("Even") : printf("Odd"); }


x86 assembly (clang, -O0):
<isODD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1140 <isODD+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    114c <isODD+0x3c>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isODD>:
test   $0x1,%dil
lea    0xee5(%rip),%rax
lea    0xee3(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"Even\00"
@.str.1 = [4 x i8] c"Odd\00"
define void @isODD(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"Even\00"
@.str.1 = [4 x i8] c"Odd\00"
define void @isODD(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
ret void
}
int g_DUMMY_menu_append_button(int menu_id, char *label, int return_id) {
  menu_id = menu_id;
  label = label;
  return_id = return_id;
  return -1;
}


x86 assembly (clang, -O0):
<g_DUMMY_menu_append_button>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_menu_append_button(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
/* Type definitions */
struct tms {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
scalar_t__ sysconf(int /*<<< orphan*/);
long times(struct tms *);
double time_getWallclockSeconds(void) {
  struct tms usage;
  long wallclock = times(&usage);
  return (((double)wallclock) / ((double)sysconf(_SC_CLK_TCK)));
}


x86 assembly (clang, -O0):
<time_getWallclockSeconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <times@plt>
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_getWallclockSeconds>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
call   1030 <times@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
cvtsi2sd %rax,%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tms = type { i32 }
@_SC_CLK_TCK = global i32 0
define double @time_getWallclockSeconds() {
%1 = alloca %struct.tms
%2 = alloca i64
%3 = call i64 @times(%struct.tms* %1)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = sitofp i64 %4 to double
%6 = load i32, i32* @_SC_CLK_TCK
%7 = call i64 @sysconf(i32 %6)
%8 = sitofp i64 %7 to double
%9 = fdiv double %5, %8
ret double %9
}

LLVM IR (-O2):
%struct.tms = type { i32 }
@_SC_CLK_TCK = global i32 0
define double @time_getWallclockSeconds() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i64 @times(%struct.tms* %1)
%4 = sitofp i64 %3 to double
%5 = load i32, i32* @_SC_CLK_TCK
%6 = tail call i64 @sysconf(i32 %5)
%7 = sitofp i64 %6 to double
%8 = fdiv double %4, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int usage(const char *me) {
  printf("Usage: %s <input> <output> [<bufsize]\n", me);
  return 1;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: %s <input> <output> [<bufsize]\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}

LLVM IR (-O2):
@.str = [39 x i8] c"Usage: %s <input> <output> [<bufsize]\0A\00"
define i32 @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}