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

/* Variables and functions */
int strncmp(char const *, char *, int);
int hasPrefix(const char *str, char *prefix) {
  return strncmp(str, prefix, sizeof(prefix) - 1);
}


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

x86 assembly (clang, -O2):
<hasPrefix>:
mov    $0x7,%edx
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @hasPrefix(i8* %0, i8* %1) {
%3 = tail call i32 @strncmp(i8* %0, i8* %1, i32 7)
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int callback_test(void *arg) {
  int *tmp_count = (int *)arg;
  *tmp_count = *tmp_count + 1;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<callback_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback_test>:
addl   $0x1,(%rdi)
mov    0x2ed6(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @callback_test(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
int of_graph_get_endpoint_count(const struct device_node *np) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device_node = type opaque
define i32 @of_graph_get_endpoint_count(%struct.device_node* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _memory_deallocate(void *);
void rpfree(void *ptr) { _memory_deallocate(ptr); }


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

x86 assembly (clang, -O2):
<rpfree>:
jmp    1030 <_memory_deallocate@plt>

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

LLVM IR (-O2):
define void @rpfree(i8* %0) {
%2 = tail call i32 @_memory_deallocate(i8* %0)
ret void
}
int _eml_parse822_is_htab(char c) { return c == '\t'; }


x86 assembly (clang, -O0):
<_eml_parse822_is_htab>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eml_parse822_is_htab>:
xor    %eax,%eax
cmp    $0x9,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @_eml_parse822_is_htab(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 9
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @_eml_parse822_is_htab(i8 signext %0) {
%2 = icmp eq i8 %0, 9
%3 = zext i1 %2 to i32
ret i32 %3
}
long bar_long(void) { return __real__(foo_long(2L - 3Li)); }


x86 assembly (clang, -O0):
<bar_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x2,-0x10(%rbp)
movq   $0xfffffffffffffffd,-0x8(%rbp)
ff
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <foo_long@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_long>:
push   %rax
mov    $0x2,%edi
mov    $0xfffffffffffffffd,%rsi
xor    %eax,%eax
call   1030 <foo_long@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @bar_long() {
%1 = alloca { i64, i64 }
%2 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %1, i32 0, i32 0
%3 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %1, i32 0, i32 1
store i64 2, i64* %2
store i64 -3, i64* %3
%4 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = call i32 (i64, i64, ...) bitcast (i32 (...)* @foo_long to i32 (i64, i64, ...)*)(i64 %5, i64 %7)
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @bar_long() {
%1 = tail call i32 (i64, i64, ...) bitcast (i32 (...)* @foo_long to i32 (i64, i64, ...)*)(i64 2, i64 -3)
%2 = sext i32 %1 to i64
ret i64 %2
}
void setnewconf(void) {}


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

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

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

LLVM IR (-O2):
define void @setnewconf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x74() {
  Assert_real((isxdigit(116) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              585, ("isxdigit should be 0 for t"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x74>:
push   %rax
mov    $0x74,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x249,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for t\00"
define void @t_isxdigit_0x74() {
%1 = tail call i64 @isxdigit(i32 116)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 585, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle6() { kprintf("ISR %d.\n", 6); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle6() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle6() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ caller2();
void par_caller2() { caller2(); }


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

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

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

LLVM IR (-O2):
define void @par_caller2() {
%1 = tail call i32 (...) @caller2()
ret void
}
int putchar(int txdata) {
  while ((*(volatile unsigned char *)0x0071) & 0x08) {
  }
  (*(volatile unsigned char *)0x0074) = txdata;
  while ((*(volatile unsigned char *)0x0071) & 0x04) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x71,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1122 <putchar+0x22>
jmp    1107 <putchar+0x7>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x74,%eax
mov    %cl,(%rax)
mov    $0x71,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1149 <putchar+0x49>
jmp    112e <putchar+0x2e>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
testb  $0x8,0x71
08
jne    1100 <putchar>
mov    %dil,0x74
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
testb  $0x4,0x71
04
jne    1120 <putchar+0x20>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i8, i8* inttoptr (i64 113 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = trunc i32 %10 to i8
store volatile i8 %11, i8* inttoptr (i64 116 to i8*)
br label %12
12: ; preds = %17, %9
%13 = load volatile i8, i8* inttoptr (i64 113 to i8*)
%14 = zext i8 %13 to i32
%15 = and i32 %14, 4
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
br label %12
18: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i8, i8* inttoptr (i64 113 to i8*)
%4 = and i8 %3, 8
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = trunc i32 %0 to i8
store volatile i8 %7, i8* inttoptr (i64 116 to i8*)
br label %8
8: ; preds = %8, %6
%9 = load volatile i8, i8* inttoptr (i64 113 to i8*)
%10 = and i8 %9, 4
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %8
12: ; preds = %8
ret i32 0
}
/* Type definitions */
struct timer_list {
  int dummy;
};
struct lock_class_key {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ init_timer_key(struct timer_list *, char const *,
                                  struct lock_class_key *);
__attribute__((always_)) void
init_timer_on_stack_key(struct timer_list *timer, const char *name,
                        struct lock_class_key *key) {
  init_timer_key(timer, name, key);
}


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

x86 assembly (clang, -O2):
<init_timer_on_stack_key>:
jmp    1030 <init_timer_key@plt>

LLVM IR (-O0):
%struct.timer_list = type { i32 }
%struct.lock_class_key = type { i32 }
define void @init_timer_on_stack_key(%struct.timer_list* %0, i8* %1, %struct.lock_class_key* %2) {
%4 = alloca %struct.timer_list*
%5 = alloca i8*
%6 = alloca %struct.lock_class_key*
store %struct.timer_list* %0, %struct.timer_list** %4
store i8* %1, i8** %5
store %struct.lock_class_key* %2, %struct.lock_class_key** %6
%7 = load %struct.timer_list*, %struct.timer_list** %4
%8 = load i8*, i8** %5
%9 = load %struct.lock_class_key*, %struct.lock_class_key** %6
%10 = call i32 @init_timer_key(%struct.timer_list* %7, i8* %8, %struct.lock_class_key* %9)
ret void
}

LLVM IR (-O2):
%struct.timer_list = type { i32 }
%struct.lock_class_key = type { i32 }
define void @init_timer_on_stack_key(%struct.timer_list* %0, i8* %1, %struct.lock_class_key* %2) {
%4 = tail call i32 @init_timer_key(%struct.timer_list* %0, i8* %1, %struct.lock_class_key* %2)
ret void
}
void module_exit(int ret) {}


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

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

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

LLVM IR (-O2):
define void @module_exit(i32 %0) {
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *s) {
  size_t l = strlen(s) + 1;
  char *p = malloc(l);
  if (p)
    memcpy(p, s, l);
  return p;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1177 <strdup+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = load i64, i64* %3
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
br label %18
18: ; preds = %13, %1
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pci_get_vendor(unsigned char bus, unsigned char dev, int func) {
  printf("pci_get_vendor: generic function call\n");
  return 0;
}


x86 assembly (clang, -O0):
<pci_get_vendor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"pci_get_vendor: generic function call\0A\00"
define i32 @pci_get_vendor(i8 zeroext %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
store i8 %0, i8* %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [38 x i8] c"pci_get_vendor: generic function call\00"
define i32 @pci_get_vendor(i8 zeroext %0, i8 zeroext %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void endconv(void *data) {}


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

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

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

LLVM IR (-O2):
define void @endconv(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void waitforuser(char *message) {
  char buf[10];
  printf("%s", message);
  fflush(stdout);
  fgets(buf, 9, stdin);
}


x86 assembly (clang, -O0):
<waitforuser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    -0x12(%rbp),%rdi
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    $0x9,%esi
call   1040 <fgets@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitforuser>:
sub    $0x18,%rsp
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
lea    0xe(%rsp),%rdi
mov    $0x9,%esi
call   1040 <fgets@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdout = global i32 0
@stdin = global i32 0
define void @waitforuser(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %3, i32 9, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int x, y;
  scanf("%d%d", &x, &y);
  printf("%d", x > y ? x : y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    115a <main+0x3a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <main+0x40>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe98(%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
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%esi
cmp    %esi,%eax
cmovg  %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load i32, i32* %2
br label %12
10: ; preds = %0
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %6, %7
%9 = select i1 %8, i32 %6, i32 %7
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
double floor(double);
double mod(double a, double N) { return a - N * floor(a / N); }


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @mod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
%10 = call double @llvm.floor.f64(double %9)
%11 = fneg double %6
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double %5)
ret double %12
}

LLVM IR (-O2):
define double @mod(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @llvm.floor.f64(double %3)
%5 = fneg double %1
%6 = tail call double @llvm.fmuladd.f64(double %5, double %4, double %0)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ mr1calccoulomb_set_tree_param(double, double, int, int, int,
                                                 int);
void(mr1calccoulomb_set_tree_param__)(double *eps, double *theta, int *ncrit,
                                      int *node_div_crit, int *me_order,
                                      int *test_id) {
  mr1calccoulomb_set_tree_param(*eps, *theta, *ncrit, *node_div_crit, *me_order,
                                *test_id);
}


x86 assembly (clang, -O0):
<mr1calccoulomb_set_tree_param__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rax
mov    (%rax),%edx
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
call   1030 <mr1calccoulomb_set_tree_param@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mr1calccoulomb_set_tree_param__>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    (%rdx),%edi
mov    (%rcx),%esi
mov    (%r8),%edx
mov    (%r9),%ecx
jmp    1030 <mr1calccoulomb_set_tree_param@plt>

LLVM IR (-O0):
define void @mr1calccoulomb_set_tree_param__(double* %0, double* %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store double* %0, double** %7
store double* %1, double** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load double*, double** %7
%14 = load double, double* %13
%15 = load double*, double** %8
%16 = load double, double* %15
%17 = load i32*, i32** %9
%18 = load i32, i32* %17
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
%21 = load i32*, i32** %11
%22 = load i32, i32* %21
%23 = load i32*, i32** %12
%24 = load i32, i32* %23
%25 = call i32 @mr1calccoulomb_set_tree_param(double %14, double %16, i32 %18, i32 %20, i32 %22, i32 %24)
ret void
}

LLVM IR (-O2):
define void @mr1calccoulomb_set_tree_param__(double* nocapture %0, double* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5) {
%7 = load double, double* %0
%8 = load double, double* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = tail call i32 @mr1calccoulomb_set_tree_param(double %7, double %8, i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}
/* Variables and functions */
scalar_t__ isalpha(int);
bool is_variable(int chr) { return isalpha(chr) || chr == '_'; }


x86 assembly (clang, -O0):
<is_variable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <is_variable+0x2f>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_variable>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_variable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 95
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_variable(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int printUsage(char *exe) {
  printf("Binpack - AFLB format\n"
         "Usage:\n"
         "%s num_bindata out_filename\n",
         exe);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<printUsage>:
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    0x2ead(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [58 x i8] c"Binpack - AFLB format\0AUsage:\0A%s num_bindata out_filename\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@.str = [58 x i8] c"Binpack - AFLB format\0AUsage:\0A%s num_bindata out_filename\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("argv[1] = [%s]\n", argv[1]);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"argv[1] = [%s]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
unsigned constant_time_lt(unsigned a, unsigned b) {
  a -= b;
  return ((unsigned)((int)(a) >> (sizeof(int) * 8 - 1)));
}


x86 assembly (clang, -O0):
<constant_time_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<constant_time_lt>:
mov    %edi,%eax
sub    %esi,%eax
sar    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @constant_time_lt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = ashr i32 %8, 31
ret i32 %9
}

LLVM IR (-O2):
define i32 @constant_time_lt(i32 %0, i32 %1) {
%3 = sub i32 %0, %1
%4 = ashr i32 %3, 31
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void set_bit_reg8(volatile uint8_t *reg, uint8_t bit) {
  (*(volatile unsigned int *)(((((uint32_t)reg & 0xF0000000) + 0x02000000 +
                                (((uint32_t)reg & 0xFFFFF) << 5) +
                                (bit << 2))))) = 0x1;
}


x86 assembly (clang, -O0):
<set_bit_reg8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0xf0000000,%eax
add    $0x2000000,%eax
mov    -0x8(%rbp),%rcx
and    $0xfffff,%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit_reg8>:
mov    %edi,%eax
and    $0xf0000000,%eax
shl    $0x5,%edi
and    $0x1ffffe0,%edi
or     %eax,%edi
lea    (%rdi,%rsi,4),%eax
add    $0x2000000,%eax
movl   $0x1,(%rax)
ret

LLVM IR (-O0):
define void @set_bit_reg8(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 = ptrtoint i32* %5 to i32
%7 = and i32 %6, -268435456
%8 = add i32 %7, 33554432
%9 = load i32*, i32** %3
%10 = ptrtoint i32* %9 to i32
%11 = and i32 %10, 1048575
%12 = shl i32 %11, 5
%13 = add i32 %8, %12
%14 = load i32, i32* %4
%15 = shl i32 %14, 2
%16 = add i32 %13, %15
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 1, i32* %18
ret void
}

LLVM IR (-O2):
define void @set_bit_reg8(i32* %0, i32 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = trunc i64 %3 to i32
%5 = and i32 %4, -268435456
%6 = shl i32 %4, 5
%7 = and i32 %6, 33554400
%8 = or i32 %5, %7
%9 = shl i32 %1, 2
%10 = add i32 %9, 33554432
%11 = add i32 %10, %8
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 1, i32* %13
ret void
}
int get_num_rzFaces(int Nr, int Nz, int dim) {
  if (dim == 1)
    return ((Nr - 1) * Nz);
  else
    return ((Nz - 1) * Nr);
}


x86 assembly (clang, -O0):
<get_num_rzFaces>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    1129 <get_num_rzFaces+0x29>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <get_num_rzFaces+0x36>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_rzFaces>:
lea    -0x1(%rdi),%ecx
imul   %esi,%ecx
lea    -0x1(%rsi),%eax
imul   %edi,%eax
cmp    $0x1,%edx
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_num_rzFaces(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 1
%5 = add nsw i32 %0, -1
%6 = mul nsw i32 %5, %1
%7 = add nsw i32 %1, -1
%8 = mul nsw i32 %7, %0
%9 = select i1 %4, i32 %6, i32 %8
ret i32 %9
}
int GifIAbs(int i) { return i < 0 ? -i : i; }


x86 assembly (clang, -O0):
<GifIAbs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <GifIAbs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <GifIAbs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @GifIAbs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @GifIAbs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int sdi_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sdi_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int qtde_impar(int *, int);
int main() {
  int vetor[10] = {8, 2, 1, 4, 5, 3, 7, 2, 9, 0};
  printf("%i\n", qtde_impar(vetor, 10));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <qtde_impar@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <qtde_impar@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.vetor = [10 x i32] [i32 8, i32 2, i32 1, i32 4, i32 5, i32 3, i32 7, i32 2, i32 9, i32 0]
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @qtde_impar(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.vetor = [10 x i32] [i32 8, i32 2, i32 1, i32 4, i32 5, i32 3, i32 7, i32 2, i32 9, i32 0]
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @qtde_impar(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
unsigned int wps_pin_checksum(unsigned int pin) {
  unsigned int accum = 0;
  while (pin) {
    accum += pin % 10;
    pin /= 10;
    accum += 3 * (pin % 10);
    pin /= 10;
  }
  return (accum % 10);
}


x86 assembly (clang, -O0):
<wps_pin_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1162 <wps_pin_checksum+0x62>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
imul   $0x3,%edx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <wps_pin_checksum+0xe>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wps_pin_checksum>:
xor    %eax,%eax
test   %edi,%edi
je     1167 <wps_pin_checksum+0x67>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
mov    %edi,%edx
imul   $0x51eb851f,%rdx,%rsi
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%ecx
lea    (%rcx,%rcx,4),%r9d
mov    %edi,%ecx
sub    %r9d,%ecx
add    %eax,%ecx
mov    %rdx,%rax
imul   %r8,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edx
lea    (%rdx,%rdx,2),%eax
add    %ecx,%eax
shr    $0x25,%rsi
cmp    $0x63,%edi
mov    %esi,%edi
ja     1110 <wps_pin_checksum+0x10>
mov    %eax,%ecx
mov    $0xcccccccd,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @wps_pin_checksum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %16, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ 0, %1 ]
%5 = phi i32 [ %12, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = add i32 %4, %6
%8 = udiv i32 %5, 10
%9 = urem i32 %8, 10
%10 = mul nuw nsw i32 %9, 3
%11 = add i32 %7, %10
%12 = udiv i32 %5, 100
%13 = icmp ult i32 %5, 100
br i1 %13, label %14, label %3
14: ; preds = %3
%15 = urem i32 %11, 10
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *ft_itoa(int);
int /*<<< orphan*/ ft_putstr_fd(char *, int);
void ft_putnbr_fd(int n, int fd) {
  char *nbr;
  nbr = ft_itoa(n);
  ft_putstr_fd(nbr, fd);
  free(nbr);
}


x86 assembly (clang, -O0):
<ft_putnbr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ft_itoa@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <ft_putstr_fd@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1040 <ft_itoa@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <ft_putstr_fd@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ft_putnbr_fd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i8* @ft_itoa(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = call i32 @ft_putstr_fd(i8* %8, i32 %9)
%11 = load i8*, i8** %5
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @ft_putnbr_fd(i32 %0, i32 %1) {
%3 = tail call i8* @ft_itoa(i32 %0)
%4 = tail call i32 @ft_putstr_fd(i8* %3, i32 %1)
%5 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int smack_set_rule_ex(char const *, char const *, char const *,
                      int /*<<< orphan*/);
int smack_set_rule(const char *subject, const char *object,
                   const char *access) {
  return smack_set_rule_ex(subject, object, access, 0);
}


x86 assembly (clang, -O0):
<smack_set_rule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <smack_set_rule_ex@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @smack_set_rule(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @smack_set_rule_ex(i8* %0, i8* %1, i8* %2, i32 0)
ret i32 %4
}
void increment(int x) { x = x + 1; }


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

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

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

LLVM IR (-O2):
define void @increment(i32 %0) {
ret void
}
int sqt(float n) {
  float x = n, y = 1;
  while (x - y > 0.00001) {
    x = (x + y) / 2;
    y = n / x;
  }
  return x;
}


x86 assembly (clang, -O0):
<sqt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xee5(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    116f <sqt+0x6f>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  0xeb2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1120 <sqt+0x20>
cvttss2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqt>:
movss  0xef8(%rip),%xmm1
addss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
ucomisd 0xef8(%rip),%xmm1
jbe    1165 <sqt+0x65>
movss  0xee2(%rip),%xmm4
movss  0xede(%rip),%xmm2
movsd  0xede(%rip),%xmm3
movaps %xmm0,%xmm1
cs nopw 0x0(%rax,%rax,1)
nop
addss  %xmm4,%xmm1
mulss  %xmm2,%xmm1
movaps %xmm0,%xmm4
divss  %xmm1,%xmm4
movaps %xmm1,%xmm5
subss  %xmm4,%xmm5
cvtss2sd %xmm5,%xmm5
ucomisd %xmm3,%xmm5
ja     1140 <sqt+0x40>
cvttss2si %xmm1,%eax
ret
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @sqt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = load float, float* %2
store float %5, float* %3
store float 1.000000e+00, float* %4
br label %6
6: ; preds = %12, %1
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = fpext float %9 to double
%11 = fcmp ogt double %10, 1.000000e-05
br i1 %11, label %12, label %20
12: ; preds = %6
%13 = load float, float* %3
%14 = load float, float* %4
%15 = fadd float %13, %14
%16 = fdiv float %15, 2.000000e+00
store float %16, float* %3
%17 = load float, float* %2
%18 = load float, float* %3
%19 = fdiv float %17, %18
store float %19, float* %4
br label %6
20: ; preds = %6
%21 = load float, float* %3
%22 = fptosi float %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @sqt(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = fpext float %2 to double
%4 = fcmp ogt double %3, 1.000000e-05
br i1 %4, label %5, label %14
5: ; preds = %1, %5
%6 = phi float [ %10, %5 ], [ 1.000000e+00, %1 ]
%7 = phi float [ %9, %5 ], [ %0, %1 ]
%8 = fadd float %7, %6
%9 = fmul float %8, 5.000000e-01
%10 = fdiv float %0, %9
%11 = fsub float %9, %10
%12 = fpext float %11 to double
%13 = fcmp ogt double %12, 1.000000e-05
br i1 %13, label %5, label %14
14: ; preds = %5, %1
%15 = phi float [ %0, %1 ], [ %9, %5 ]
%16 = fptosi float %15 to i32
ret i32 %16
}
int reassemble_12(int as12) {
  return (((as12 & 0x800) >> 11) | ((as12 & 0x400) >> 8) |
          ((as12 & 0x3ff) << 3));
}


x86 assembly (clang, -O0):
<reassemble_12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x800,%eax
sar    $0xb,%eax
mov    -0x4(%rbp),%ecx
and    $0x400,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x3ff,%ecx
shl    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reassemble_12>:
mov    %edi,%eax
shr    $0xb,%eax
and    $0x1,%eax
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0x4,%ecx
or     %eax,%ecx
and    $0x3ff,%edi
lea    (%rcx,%rdi,8),%eax
ret

LLVM IR (-O0):
define i32 @reassemble_12(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 2048
%5 = ashr i32 %4, 11
%6 = load i32, i32* %2
%7 = and i32 %6, 1024
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 1023
%12 = shl i32 %11, 3
%13 = or i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @reassemble_12(i32 %0) {
%2 = lshr i32 %0, 11
%3 = and i32 %2, 1
%4 = lshr i32 %0, 8
%5 = and i32 %4, 4
%6 = or i32 %3, %5
%7 = shl i32 %0, 3
%8 = and i32 %7, 8184
%9 = or i32 %6, %8
ret i32 %9
}
/* Variables and functions */
int svz_check_sockets_poll();
int svz_check_sockets(void) { return svz_check_sockets_poll(); }


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

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

LLVM IR (-O0):
define i32 @svz_check_sockets() {
%1 = call i32 (...) @svz_check_sockets_poll()
ret i32 %1
}

LLVM IR (-O2):
define i32 @svz_check_sockets() {
%1 = tail call i32 (...) @svz_check_sockets_poll()
ret i32 %1
}
void RTTimeProgramSecTS(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeProgramSecTS() {
ret void
}