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

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void heartbeat(struct event_loop *loop, int id, void *data) {
  printf("heartbeat every 1000ms\n");
}


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

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

LLVM IR (-O0):
%struct.event_loop = type { i32 }
@.str = [24 x i8] c"heartbeat every 1000ms\0A\00"
define void @heartbeat(%struct.event_loop* %0, i32 %1, i8* %2) {
%4 = alloca %struct.event_loop*
%5 = alloca i32
%6 = alloca i8*
store %struct.event_loop* %0, %struct.event_loop** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.event_loop = type { i32 }
@str = [23 x i8] c"heartbeat every 1000ms\00"
define void @heartbeat(%struct.event_loop* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CX4_immediate_reg(int /*<<< orphan*/);
void CX4_op5e(void) { CX4_immediate_reg(0); }


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

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

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

LLVM IR (-O2):
define void @CX4_op5e() {
%1 = tail call i32 @CX4_immediate_reg(i32 0)
ret void
}
char to_upper(char c) { return (char)(c - 32); }


x86 assembly (clang, -O0):
<to_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_upper>:
lea    -0x20(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @to_upper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 32
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @to_upper(i8 signext %0) {
%2 = add i8 %0, -32
ret i8 %2
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int32_t prv_equal_str_fn(const char *a, const char *b) {
  return strcmp(a, b) ? 0 : -1;
}


x86 assembly (clang, -O0):
<prv_equal_str_fn>:
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>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_equal_str_fn>:
push   %rax
call   1030 <strcmp@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @prv_equal_str_fn(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
ret i32 %10
}

LLVM IR (-O2):
define i32 @prv_equal_str_fn(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ path;

/* Variables and functions */
int EACCES;
int errno;
int /*<<< orphan*/ swap_path(char *, int);
scalar_t__ unlink(char *);
int swap_delete(void) {
  char path[256];
  if (!swap_path(path, sizeof(path)))
    return EACCES;
  return (unlink(path) ? errno : 0);
}


x86 assembly (clang, -O0):
<swap_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1040 <swap_path@plt>
cmp    $0x0,%eax
jne    1156 <swap_delete+0x36>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1196 <swap_delete+0x76>
lea    -0x110(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     1180 <swap_delete+0x60>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x114(%rbp)
jmp    118d <swap_delete+0x6d>
xor    %eax,%eax
mov    %eax,-0x114(%rbp)
jmp    118d <swap_delete+0x6d>
mov    -0x114(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_delete>:
sub    $0x108,%rsp
mov    %rsp,%rdi
mov    $0x100,%esi
call   1040 <swap_path@plt>
test   %eax,%eax
je     1153 <swap_delete+0x33>
mov    %rsp,%rdi
call   1030 <unlink@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     115c <swap_delete+0x3c>
mov    0x2e87(%rip),%rax
jmp    115a <swap_delete+0x3a>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
@EACCES = global i32 0
@errno = global i32 0
define i32 @swap_delete() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @swap_path(i8* %3, i32 256)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = load i32, i32* @EACCES
store i32 %7, i32* %1
br label %17
8: ; preds = %0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%10 = call i64 @unlink(i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = load i32, i32* @errno
br label %15
14: ; preds = %8
br label %15
15: ; preds = %14, %12
%16 = phi i32 [ %13, %12 ], [ 0, %14 ]
store i32 %16, i32* %1
br label %17
17: ; preds = %15, %6
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@EACCES = global i32 0
@errno = global i32 0
define i32 @swap_delete() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @swap_path(i8* %2, i32 256)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* @EACCES
br label %12
7: ; preds = %0
%8 = call i64 @unlink(i8* %2)
%9 = icmp eq i64 %8, 0
%10 = load i32, i32* @errno
%11 = select i1 %9, i32 0, i32 %10
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %11, %7 ], [ %6, %5 ]
ret i32 %13
}
void g_DUMMY_menu_destroy_buttonbar_children(int win_id) { win_id = win_id; }


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

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

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

LLVM IR (-O2):
define void @g_DUMMY_menu_destroy_buttonbar_children(i32 %0) {
ret void
}
char *hash_plugin_summary(void) {
  return ("drupal7 \tDrupal >=7 hashes plugin");
}


x86 assembly (clang, -O0):
<hash_plugin_summary>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_summary>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [34 x i8] c"drupal7 \09Drupal >=7 hashes plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [34 x i8] c"drupal7 \09Drupal >=7 hashes plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void space(int reg) {
  int i;
  for (i = 0; i < reg; i++)
    printf("  ");
}


x86 assembly (clang, -O0):
<space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <space+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <space+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <space+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <space+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @space(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int partion(int *, int, int);
void quick_sort(int arr[], int p, int q) {
  int j;
  if (p < q) {
    j = partion(arr, p, q);
    quick_sort(arr, p, j - 1);
    quick_sort(arr, j + 1, q);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partion@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partion@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partion(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t UARTModemControlGet(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x4000D000);
  return ((*((volatile uint32_t *)(ui32Base + 0x00000030))) &
          (0x00000800 | 0x00000400));
}


x86 assembly (clang, -O0):
<UARTModemControlGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x4000d000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%eax
and    $0xc00,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemControlGet>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x4000d000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rcx
mov    $0xc00,%eax
and    0x30(%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @UARTModemControlGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073795072
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 48
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 3072
ret i32 %12
}

LLVM IR (-O2):
define i32 @UARTModemControlGet(i32 %0) {
%2 = icmp eq i32 %0, 1073795072
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 48
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 3072
ret i32 %9
}
void timer_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @timer_deinit() {
ret void
}
bar(foo, a) int (**foo)();
{
  (foo)[1] = bar;
  foo[a](1);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ec6(%rip),%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    $0x1,%edi
mov    $0x0,%al
call   *(%rcx,%rdx,8)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    0x2ed9(%rip),%rax
mov    %rax,0x8(%rdi)
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
mov    $0x1,%edi
xor    %eax,%eax
jmp    *%rcx

LLVM IR (-O0):
define i32 @bar(i32 (...)** %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32 (...)**
%5 = alloca i32
store i32 (...)** %0, i32 (...)*** %4
store i32 %1, i32* %5
%6 = load i32 (...)**, i32 (...)*** %4
%7 = getelementptr inbounds i32 (...)*, i32 (...)** %6, i64 1
store i32 (...)* bitcast (i32 (i32 (...)**, i32)* @bar to i32 (...)*), i32 (...)** %7
%8 = load i32 (...)**, i32 (...)*** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32 (...)*, i32 (...)** %8, i64 %10
%12 = load i32 (...)*, i32 (...)** %11
%13 = bitcast i32 (...)* %12 to i32 (i32, ...)*
%14 = call i32 (i32, ...) %13(i32 1)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @bar(i32 (...)** nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32 (...)*, i32 (...)** %0, i64 1
store i32 (...)* bitcast (i32 (i32 (...)**, i32)* @bar to i32 (...)*), i32 (...)** %3
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32 (...)*, i32 (...)** %0, i64 %4
%6 = bitcast i32 (...)** %5 to i32 (i32, ...)**
%7 = load i32 (i32, ...)*, i32 (i32, ...)** %6
%8 = tail call i32 (i32, ...) %7(i32 1)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ mem_invalidate_range(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mem_writeb_phys_dma(int /*<<< orphan*/, int /*<<< orphan*/);
void _dma_write(uint32_t addr, uint8_t val) {
  mem_writeb_phys_dma(addr, val);
  mem_invalidate_range(addr, addr);
}


x86 assembly (clang, -O0):
<_dma_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <mem_writeb_phys_dma@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <mem_invalidate_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dma_write>:
push   %rbx
mov    %edi,%ebx
call   1040 <mem_writeb_phys_dma@plt>
mov    %ebx,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <mem_invalidate_range@plt>

LLVM IR (-O0):
define void @_dma_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @mem_writeb_phys_dma(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @mem_invalidate_range(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @_dma_write(i32 %0, i32 %1) {
%3 = tail call i32 @mem_writeb_phys_dma(i32 %0, i32 %1)
%4 = tail call i32 @mem_invalidate_range(i32 %0, i32 %0)
ret void
}
unsigned int u_to_lower(unsigned int u) {
  if (u < 'A')
    return u;
  if (u <= 'Z')
    return u + 'a' - 'A';
  return u;
}


x86 assembly (clang, -O0):
<u_to_lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jae    111c <u_to_lower+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113d <u_to_lower+0x3d>
cmpl   $0x5a,-0x8(%rbp)
ja     1137 <u_to_lower+0x37>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <u_to_lower+0x3d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_to_lower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @u_to_lower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 65
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %17
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp ule i32 %9, 90
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add i32 %12, 97
%14 = sub i32 %13, 65
store i32 %14, i32* %2
br label %17
15: ; preds = %8
%16 = load i32, i32* %3
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %11, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @u_to_lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ generate_states();
int /*<<< orphan*/ set_derives();
int /*<<< orphan*/ set_nullable();
lr0() {
  set_derives();
  set_nullable();
  generate_states();
}


x86 assembly (clang, -O0):
<lr0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <set_derives@plt>
mov    $0x0,%al
call   1050 <set_nullable@plt>
mov    $0x0,%al
call   1030 <generate_states@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lr0>:
push   %rax
xor    %eax,%eax
call   1040 <set_derives@plt>
xor    %eax,%eax
call   1050 <set_nullable@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <generate_states@plt>

LLVM IR (-O0):
define i32 @lr0() {
%1 = alloca i32
%2 = call i32 (...) @set_derives()
%3 = call i32 (...) @set_nullable()
%4 = call i32 (...) @generate_states()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @lr0() {
%1 = tail call i32 (...) @set_derives()
%2 = tail call i32 (...) @set_nullable()
%3 = tail call i32 (...) @generate_states()
ret i32 undef
}
/* Variables and functions */
int modulo(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a, b;
  int p;
  printf("%d\n", modulo(a, b, p));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @modulo(i32 undef, i32 undef, i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ tpi_read();
int /*<<< orphan*/ tpi_write(int);
uint8_t tpi_sld(void) {
  tpi_write((0x20));
  return tpi_read();
}


x86 assembly (clang, -O0):
<tpi_sld>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1040 <tpi_write@plt>
mov    $0x0,%al
call   1030 <tpi_read@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tpi_sld>:
push   %rax
mov    $0x20,%edi
call   1040 <tpi_write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <tpi_read@plt>

LLVM IR (-O0):
define i32 @tpi_sld() {
%1 = call i32 @tpi_write(i32 32)
%2 = call i32 (...) @tpi_read()
ret i32 %2
}

LLVM IR (-O2):
define i32 @tpi_sld() {
%1 = tail call i32 @tpi_write(i32 32)
%2 = tail call i32 (...) @tpi_read()
ret i32 %2
}
/* Type definitions */
struct tms {
  scalar_t__ tms_utime;
};

/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
double sysconf(int /*<<< orphan*/);
int /*<<< orphan*/ times(struct tms *);
void give_time(long *time) {
  struct tms timeend;
  double t1;
  times(&timeend);
  t1 = (double)(timeend.tms_utime) / sysconf(_SC_CLK_TCK);
  *time = t1 * 1000;
}


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

x86 assembly (clang, -O2):
<give_time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
call   1030 <times@plt>
cvtsi2sdq 0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
mulsd  0xea3(%rip),%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tms = type { i64 }
@_SC_CLK_TCK = global i32 0
define void @give_time(i64* %0) {
%2 = alloca i64*
%3 = alloca %struct.tms
%4 = alloca double
store i64* %0, i64** %2
%5 = call i32 @times(%struct.tms* %3)
%6 = getelementptr inbounds %struct.tms, %struct.tms* %3, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = load i32, i32* @_SC_CLK_TCK
%10 = call double @sysconf(i32 %9)
%11 = fdiv double %8, %10
store double %11, double* %4
%12 = load double, double* %4
%13 = fmul double %12, 1.000000e+03
%14 = fptosi double %13 to i64
%15 = load i64*, i64** %2
store i64 %14, i64* %15
ret void
}

LLVM IR (-O2):
%struct.tms = type { i64 }
@_SC_CLK_TCK = global i32 0
define void @give_time(i64* nocapture writeonly %0) {
%2 = alloca %struct.tms
%3 = bitcast %struct.tms* %2 to i8*
%4 = call i32 @times(%struct.tms* %2)
%5 = getelementptr inbounds %struct.tms, %struct.tms* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = load i32, i32* @_SC_CLK_TCK
%9 = tail call double @sysconf(i32 %8)
%10 = fdiv double %7, %9
%11 = fmul double %10, 1.000000e+03
%12 = fptosi double %11 to i64
store i64 %12, i64* %0
ret void
}
/* Variables and functions */
int ocfs2_find_next_bit_clear(void *, int, int /*<<< orphan*/);
int ocfs2_find_first_bit_clear(void *addr, int size) {
  return ocfs2_find_next_bit_clear(addr, size, 0);
}


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

x86 assembly (clang, -O2):
<ocfs2_find_first_bit_clear>:
xor    %edx,%edx
jmp    1030 <ocfs2_find_next_bit_clear@plt>

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

LLVM IR (-O2):
define i32 @ocfs2_find_first_bit_clear(i8* %0, i32 %1) {
%3 = tail call i32 @ocfs2_find_next_bit_clear(i8* %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SetNonBlocking(int);
int /*<<< orphan*/ d_log(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int new_socket_unix(void) {
  int sfd;
  if ((sfd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
    d_log("socket()");
    return -1;
  }
  SetNonBlocking(sfd);
  return sfd;
}


x86 assembly (clang, -O0):
<new_socket_unix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    1175 <new_socket_unix+0x45>
lea    0xe9c(%rip),%rdi
call   1030 <d_log@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <new_socket_unix+0x53>
mov    -0x8(%rbp),%edi
call   1040 <SetNonBlocking@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_socket_unix>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     115a <new_socket_unix+0x2a>
mov    %ebx,%edi
call   1040 <SetNonBlocking@plt>
jmp    1166 <new_socket_unix+0x36>
lea    0xe9f(%rip),%rdi
call   1030 <d_log@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [9 x i8] c"socket()\00"
define i32 @new_socket_unix() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @AF_UNIX
%4 = load i32, i32* @SOCK_STREAM
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
store i32 %5, i32* %2
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @d_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %13
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @SetNonBlocking(i32 %10)
%12 = load i32, i32* %2
store i32 %12, i32* %1
br label %13
13: ; preds = %9, %7
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [9 x i8] c"socket()\00"
define i32 @new_socket_unix() {
%1 = load i32, i32* @AF_UNIX
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @d_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = tail call i32 @SetNonBlocking(i32 %3)
br label %9
9: ; preds = %7, %5
ret i32 %3
}
/* Variables and functions */
char *strstr(char const *, char *);
int strtol(char *, char **, int);
int __attribute__((visibility("hidden"))) get_array_size(const char *tag) {
  char *p, *tail;
  if ((p = strstr(tag, "arraySize=\"")))
    return strtol(p + 11, &tail, 10);
  else
    return 0;
}


x86 assembly (clang, -O0):
<get_array_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1168 <get_array_size+0x48>
mov    -0x18(%rbp),%rdi
add    $0xb,%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x4(%rbp)
jmp    116f <get_array_size+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_array_size>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     1148 <get_array_size+0x28>
add    $0xb,%rax
mov    %rsp,%rsi
mov    %rax,%rdi
mov    $0xa,%edx
call   1030 <strtol@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"arraySize=\22\00"
define hidden i32 @get_array_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @strstr(i8* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 11
%12 = call i32 @strtol(i8* %11, i8** %5, i32 10)
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [12 x i8] c"arraySize=\22\00"
define hidden i32 @get_array_size(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %4, i64 11
%8 = call i32 @strtol(i8* %7, i8** %2, i32 10)
br label %9
9: ; preds = %1, %6
%10 = phi i32 [ %8, %6 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void teste(char texto[10]) { strcpy(texto, "Ponteiro"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"Ponteiro\00"
define void @teste(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct memfile_st {
  int dummy;
};

/* Variables and functions */
int write_memframe_data(struct memfile_st *, char *, int);
int write_memframe_info(struct memfile_st *, int, int);
int write_memframe(struct memfile_st *mf, char *frdata, int frdata_size,
                   int f_compressed) {
  int n;
  n = write_memframe_info(mf, frdata_size, f_compressed);
  if (n != -1)
    n = write_memframe_data(mf, frdata, frdata_size);
  return (n);
}


x86 assembly (clang, -O0):
<write_memframe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <write_memframe_info@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
je     1165 <write_memframe+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <write_memframe_data@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_memframe>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%esi
mov    %ecx,%edx
call   1030 <write_memframe_info@plt>
cmp    $0xffffffff,%eax
je     114b <write_memframe+0x2b>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <write_memframe_data@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.memfile_st = type { i32 }
define i32 @write_memframe(%struct.memfile_st* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.memfile_st*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.memfile_st* %0, %struct.memfile_st** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load %struct.memfile_st*, %struct.memfile_st** %5
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @write_memframe_info(%struct.memfile_st* %10, i32 %11, i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp ne i32 %14, -1
br i1 %15, label %16, label %21
16: ; preds = %4
%17 = load %struct.memfile_st*, %struct.memfile_st** %5
%18 = load i8*, i8** %6
%19 = load i32, i32* %7
%20 = call i32 @write_memframe_data(%struct.memfile_st* %17, i8* %18, i32 %19)
store i32 %20, i32* %9
br label %21
21: ; preds = %16, %4
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
%struct.memfile_st = type { i32 }
define i32 @write_memframe(%struct.memfile_st* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @write_memframe_info(%struct.memfile_st* %0, i32 %2, i32 %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @write_memframe_data(%struct.memfile_st* %0, i8* %1, i32 %2)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %8, %7 ], [ -1, %4 ]
ret i32 %10
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_tablefunc_project(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_tablefunc_project() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_tablefunc_project() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
int tiger_not(int i) { return (i == 0) ? 1 : 0; }


x86 assembly (clang, -O0):
<tiger_not>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tiger_not>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @tiger_not(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void f3(float a, ...) {
  __builtin_va_list ap;
  __builtin_va_start(ap, a);
  __builtin_va_start(ap, (a));
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
test   %al,%al
je     112f <f3+0x2f>
movaps %xmm1,-0x90(%rbp)
movaps %xmm2,-0x80(%rbp)
movaps %xmm3,-0x70(%rbp)
movaps %xmm4,-0x60(%rbp)
movaps %xmm5,-0x50(%rbp)
movaps %xmm6,-0x40(%rbp)
movaps %xmm7,-0x30(%rbp)
mov    %r9,-0xa8(%rbp)
mov    %r8,-0xb0(%rbp)
mov    %rcx,-0xb8(%rbp)
mov    %rdx,-0xc0(%rbp)
mov    %rsi,-0xc8(%rbp)
mov    %rdi,-0xd0(%rbp)
movss  %xmm0,-0x4(%rbp)
lea    -0xd0(%rbp),%rcx
mov    %rcx,-0x10(%rbp)
lea    0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x40,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
movl   $0x40,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
sub    $0x48,%rsp
mov    %rdi,-0x80(%rsp)
mov    %rsi,-0x78(%rsp)
mov    %rdx,-0x70(%rsp)
mov    %rcx,-0x68(%rsp)
mov    %r8,-0x60(%rsp)
mov    %r9,-0x58(%rsp)
test   %al,%al
je     1148 <f3+0x48>
movaps %xmm1,-0x40(%rsp)
movaps %xmm2,-0x30(%rsp)
movaps %xmm3,-0x20(%rsp)
movaps %xmm4,-0x10(%rsp)
movaps %xmm5,(%rsp)
movaps %xmm6,0x10(%rsp)
movaps %xmm7,0x20(%rsp)
add    $0x48,%rsp
ret

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @f3(float %0, ...) {
%2 = alloca float
%3 = alloca [1 x %struct.__va_list_tag]
store float %0, float* %2
%4 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%5 = bitcast %struct.__va_list_tag* %4 to i8*
%6 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%7 = bitcast %struct.__va_list_tag* %6 to i8*
ret void
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @f3(float %0, ...) {
%2 = alloca [1 x %struct.__va_list_tag]
%3 = bitcast [1 x %struct.__va_list_tag]* %2 to i8*
ret void
}
void debug_print_int(const char *desc, unsigned long long addr) {}


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

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

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

LLVM IR (-O2):
define void @debug_print_int(i8* nocapture %0, i64 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void __error__(char *pcFilename, uint32_t ui32Line) {
  while (true)
    ;
}


x86 assembly (clang, -O0):
<__error__>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
jmp    110b <__error__+0xb>

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

LLVM IR (-O0):
define void @__error__(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2, %5
br label %5
}

LLVM IR (-O2):
define void @__error__(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %2, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int n = 0;
  printf("Enter the number /n");
  scanf("%d", &n);
  if (n < 0) {
    printf("\n It is a ngeative number");
  } else {
    printf("\n It is a positive number");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    116d <main+0x4d>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    1179 <main+0x59>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xec5(%rip),%rax
lea    0xed8(%rip),%rdi
cmovs  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter the number /n\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"\0A It is a ngeative number\00"
@.str.3 = [26 x i8] c"\0A It is a positive number\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter the number /n\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"\0A It is a ngeative number\00"
@.str.3 = [26 x i8] c"\0A It is a positive number\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int __udivsi3(int, int);
uint32_t __umodsi3(uint32_t a, uint32_t b) { return a - __udivsi3(a, b) * b; }


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

x86 assembly (clang, -O2):
<__umodsi3>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <__udivsi3@plt>
imul   %ebx,%eax
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__umodsi3(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* %3
%7 = load i32, i32* %4
%8 = call i32 @__udivsi3(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = sub nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @__umodsi3(i32 %0, i32 %1) {
%3 = tail call i32 @__udivsi3(i32 %0, i32 %1)
%4 = mul nsw i32 %3, %1
%5 = sub nsw i32 %0, %4
ret i32 %5
}
int isspace(int c) { return c == ' ' || c == '\t' || c == '\r' || c == '\n'; }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <isspace+0x3e>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <isspace+0x3e>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <isspace+0x3e>
cmpl   $0xa,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
ja     111d <isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002200,%rdx
bt     %rcx,%rdx
jae    111d <isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xa,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
double gsw_sp_from_sr(double sr) {
  double res;
  res = 0.995306702338459e0 * sr;
  if (res > 1e10)
    res = 9e15;
  return (res);
}


x86 assembly (clang, -O0):
<gsw_sp_from_sr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    113f <gsw_sp_from_sr+0x3f>
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_sp_from_sr>:
mulsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
cmpltsd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm2
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @gsw_sp_from_sr(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 0x3FEFD98D710110B2, %4
store double %5, double* %3
%6 = load double, double* %3
%7 = fcmp ogt double %6, 1.000000e+10
br i1 %7, label %8, label %9
8: ; preds = %1
store double 9.000000e+15, double* %3
br label %9
9: ; preds = %8, %1
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @gsw_sp_from_sr(double %0) {
%2 = fmul double %0, 0x3FEFD98D710110B2
%3 = fcmp ogt double %2, 1.000000e+10
%4 = select i1 %3, double 9.000000e+15, double %2
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ affiche(int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int valeur1;
  int valeur2;
  valeur1 = 1000;
  valeur2 = 2000;
  printf("Début du programme\n");
  affiche(valeur1, valeur2);
  printf("Fin du programme\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
movl   $0x7d0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <affiche@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@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>
mov    $0x3e8,%edi
mov    $0x7d0,%esi
call   1040 <affiche@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"D\C3\A9but du programme\0A\00"
@.str.1 = [18 x i8] c"Fin du programme\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1000, i32* %2
store i32 2000, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @affiche(i32 %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"D\C3\A9but du programme\00"
@str.2 = [17 x i8] c"Fin du programme\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @affiche(i32 1000, i32 2000)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}