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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fread(unsigned char *, unsigned long, int,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned long,
                         int /*<<< orphan*/);
void read_mtd(unsigned char *buffer, FILE *fp, unsigned long offset,
              unsigned long len) {
  fseek(fp, offset, SEEK_SET);
  fread(buffer, len, 1, fp);
}


x86 assembly (clang, -O0):
<read_mtd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_mtd>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %eax,%edx
call   1040 <fseek@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fread@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @read_mtd(i8* %0, i32* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i32*, i32** %6
%10 = load i64, i64* %7
%11 = load i32, i32* @SEEK_SET
%12 = call i32 @fseek(i32* %9, i64 %10, i32 %11)
%13 = load i8*, i8** %5
%14 = load i64, i64* %8
%15 = load i32*, i32** %6
%16 = call i32 @fread(i8* %13, i64 %14, i32 1, i32* %15)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @read_mtd(i8* nocapture %0, i32* nocapture %1, i64 %2, i64 %3) {
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %1, i64 %2, i32 %5)
%7 = tail call i32 @fread(i8* %0, i64 %3, i32 1, i32* %1)
ret void
}
int foo(void) { return 7; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 7
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 7
}
/* Variables and functions */
int *malloc(int);
int *_MALLOC(int a) { return malloc(a); }


x86 assembly (clang, -O0):
<_MALLOC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_MALLOC>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i32* @_MALLOC(i32 %0) {
%2 = tail call i32* @malloc(i32 %0)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned long);
void _m_sleep(unsigned long msec) {
  unsigned long t;
  t = (unsigned long)(msec * 1000);
  usleep(t);
}


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

x86 assembly (clang, -O2):
<_m_sleep>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @_m_sleep(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 %4, 1000
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @usleep(i64 %6)
ret void
}

LLVM IR (-O2):
define void @_m_sleep(i64 %0) {
%2 = mul i64 %0, 1000
%3 = tail call i32 @usleep(i64 %2)
ret void
}
void handle_comma() {}


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

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

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

LLVM IR (-O2):
define void @handle_comma() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ setup_parent(char *, int, char **);
int main(int argc, char *argv[]) {
  setup_parent("mq", argc, argv);
  return EXIT_SUCCESS;
}


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    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xecc(%rip),%rdi
call   1030 <setup_parent@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
call   1030 <setup_parent@plt>
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"mq\00"
@EXIT_SUCCESS = global i32 0
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 i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @setup_parent(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6, i8** %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"mq\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @setup_parent(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0, i8** %1)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
int g_me(int a, int b) { return a >= b; }


x86 assembly (clang, -O0):
<g_me>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_me>:
xor    %eax,%eax
cmp    %esi,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @g_me(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 = icmp sge i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @g_me(i32 %0, i32 %1) {
%3 = icmp sge i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void swap_np(struct rbnode **x, struct rbnode **y) {
  struct rbnode *t = *x;
  *x = *y;
  *y = t;
}


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

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

LLVM IR (-O0):
%struct.rbnode = type opaque
define void @swap_np(%struct.rbnode** %0, %struct.rbnode** %1) {
%3 = alloca %struct.rbnode**
%4 = alloca %struct.rbnode**
%5 = alloca %struct.rbnode*
store %struct.rbnode** %0, %struct.rbnode*** %3
store %struct.rbnode** %1, %struct.rbnode*** %4
%6 = load %struct.rbnode**, %struct.rbnode*** %3
%7 = load %struct.rbnode*, %struct.rbnode** %6
store %struct.rbnode* %7, %struct.rbnode** %5
%8 = load %struct.rbnode**, %struct.rbnode*** %4
%9 = load %struct.rbnode*, %struct.rbnode** %8
%10 = load %struct.rbnode**, %struct.rbnode*** %3
store %struct.rbnode* %9, %struct.rbnode** %10
%11 = load %struct.rbnode*, %struct.rbnode** %5
%12 = load %struct.rbnode**, %struct.rbnode*** %4
store %struct.rbnode* %11, %struct.rbnode** %12
ret void
}

LLVM IR (-O2):
%struct.rbnode = type opaque
define void @swap_np(%struct.rbnode** nocapture %0, %struct.rbnode** nocapture %1) {
%3 = load %struct.rbnode*, %struct.rbnode** %0
%4 = load %struct.rbnode*, %struct.rbnode** %1
store %struct.rbnode* %4, %struct.rbnode** %0
store %struct.rbnode* %3, %struct.rbnode** %1
ret void
}
/* Variables and functions */
scalar_t__ cos(double);
int /*<<< orphan*/ link_failure_cos();
void test_cos(double d) {
  if (cos(d) != cos(d))
    link_failure_cos();
}


x86 assembly (clang, -O0):
<test_cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_cos+0x3c>
mov    $0x0,%al
call   1030 <link_failure_cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cos>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
cmp    %rax,%rbx
jne    1149 <test_cos+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_cos@plt>

LLVM IR (-O0):
define void @test_cos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @cos(double %3)
%5 = load double, double* %2
%6 = call i64 @cos(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_cos()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_cos(double %0) {
%2 = tail call i64 @cos(double %0)
%3 = tail call i64 @cos(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_cos()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void dump_lspci(void) { system("lspci -v 2> /dev/null > lspci.txt"); }


x86 assembly (clang, -O0):
<dump_lspci>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"lspci -v 2> /dev/null > lspci.txt\00"
define void @dump_lspci() {
%1 = call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"lspci -v 2> /dev/null > lspci.txt\00"
define void @dump_lspci() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *calloc(int, unsigned int);
int /*<<< orphan*/ dl_protect_insert(int /*<<< orphan*/, char *);
int /*<<< orphan*/ get_dl_protect();
unsigned int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, unsigned int);
void protect_name(const char *name) {
  char *savName;
  unsigned size;
  size = strlen(name);
  savName = calloc(sizeof(char), size + 1);
  strncpy(savName, name, size);
  dl_protect_insert(get_dl_protect(), savName);
}


x86 assembly (clang, -O0):
<protect_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    $0x1,%edi
call   1060 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <strncpy@plt>
mov    $0x0,%al
call   1070 <get_dl_protect@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <dl_protect_insert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protect_name>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1050 <strlen@plt>
mov    %eax,%ebx
lea    0x1(%rbx),%esi
mov    $0x1,%edi
call   1060 <calloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <strncpy@plt>
xor    %eax,%eax
call   1070 <get_dl_protect@plt>
mov    %eax,%edi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <dl_protect_insert@plt>

LLVM IR (-O0):
define void @protect_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = add i32 %7, 1
%9 = call i8* @calloc(i32 1, i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = load i32, i32* %4
%13 = call i32 @strncpy(i8* %10, i8* %11, i32 %12)
%14 = call i32 (...) @get_dl_protect()
%15 = load i8*, i8** %3
%16 = call i32 @dl_protect_insert(i32 %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @protect_name(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add i32 %2, 1
%4 = tail call i8* @calloc(i32 1, i32 %3)
%5 = tail call i32 @strncpy(i8* %4, i8* %0, i32 %2)
%6 = tail call i32 (...) @get_dl_protect()
%7 = tail call i32 @dl_protect_insert(i32 %6, i8* %4)
ret void
}
int finalsymb(char symb) {
  switch (symb) {
  case '.':
  case '!':
  case '?':
    return 1;
    break;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<finalsymb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x21,%eax
je     1141 <finalsymb+0x41>
jmp    111f <finalsymb+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2e,%eax
je     1141 <finalsymb+0x41>
jmp    1130 <finalsymb+0x30>
mov    -0xc(%rbp),%eax
sub    $0x3f,%eax
jne    114d <finalsymb+0x4d>
jmp    1141 <finalsymb+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1154 <finalsymb+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<finalsymb>:
cmp    $0x3f,%edi
ja     111d <finalsymb+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x8000400200000000,%rdx
bt     %rcx,%rdx
jae    111d <finalsymb+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @finalsymb(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 46, label %6
i32 33, label %6
i32 63, label %6
]
6: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @finalsymb(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 46, label %4
i32 33, label %4
i32 63, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fft_bench();
int main(int argc, char *argv[]) {
  fft_bench();
  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    $0x0,%al
call   1030 <fft_bench@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <fft_bench@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @fft_bench()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fft_bench()
ret i32 0
}
/* Variables and functions */
int geteuid();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("Effective uid: %d\n", geteuid());
  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    $0x0,%al
call   1040 <geteuid@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
xor    %eax,%eax
call   1040 <geteuid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Effective uid: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @geteuid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int ERR;
int getch();
void consoleif_handle_input() {
  int c;
  if ((c = getch()) != ERR) {
  }
}


x86 assembly (clang, -O0):
<consoleif_handle_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getch@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ebf(%rip),%rcx
cmp    (%rcx),%eax
je     1136 <consoleif_handle_input+0x26>
jmp    1136 <consoleif_handle_input+0x26>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@ERR = global i32 0
define void @consoleif_handle_input() {
%1 = alloca i32
%2 = call i32 (...) @getch()
store i32 %2, i32* %1
%3 = load i32, i32* @ERR
%4 = icmp ne i32 %2, %3
br i1 %4, label %5, label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@ERR = global i32 0
define void @consoleif_handle_input() {
%1 = tail call i32 (...) @getch()
ret void
}
void BN_lshift(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_lshift() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void mbc_none_write_8(uint16_t addr, uint8_t v) { return; }


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

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

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

LLVM IR (-O2):
define void @mbc_none_write_8(i32 %0, i32 %1) {
ret void
}
void to_uns_short_store(__float128 a, unsigned short *p) {
  *p = (unsigned short)a;
}


x86 assembly (clang, -O0):
<to_uns_short_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movaps -0x10(%rbp),%xmm0
call   1130 <__fixtfsi>
mov    %ax,%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret
nopl   0x0(%rax)

x86 assembly (clang, -O2):
<to_uns_short_store>:
push   %rbx
mov    %rdi,%rbx
call   1110 <__fixtfsi>
mov    %ax,(%rbx)
pop    %rbx
ret
xchg   %ax,%ax

LLVM IR (-O0):
define void @to_uns_short_store(fp128 %0, i16* %1) {
%3 = alloca fp128
%4 = alloca i16*
store fp128 %0, fp128* %3
store i16* %1, i16** %4
%5 = load fp128, fp128* %3
%6 = fptoui fp128 %5 to i16
%7 = load i16*, i16** %4
store i16 %6, i16* %7
ret void
}

LLVM IR (-O2):
define void @to_uns_short_store(fp128 %0, i16* nocapture writeonly %1) {
%3 = fptoui fp128 %0 to i16
store i16 %3, i16* %1
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ f(int **);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int *i;
  f(&i);
  printf("i=%i", *i);
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"i=%i\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = call i32 @f(i32** %1)
%4 = load i32*, i32** %1
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned int hostnum2subnet(uint32_t num) {
  unsigned int ret = 32;
  while (num != 1) {
    num >>= 1;
    ret--;
  }
  return ret;
}


x86 assembly (clang, -O0):
<hostnum2subnet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     112f <hostnum2subnet+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <hostnum2subnet+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hostnum2subnet>:
mov    $0x20,%eax
cmp    $0x1,%edi
je     111a <hostnum2subnet+0x1a>
mov    $0x20,%eax
nop
sar    %edi
add    $0xffffffff,%eax
cmp    $0x1,%edi
jne    1110 <hostnum2subnet+0x10>
ret

LLVM IR (-O0):
define i32 @hostnum2subnet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 32, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = ashr i32 %8, 1
store i32 %9, i32* %2
%10 = load i32, i32* %3
%11 = add i32 %10, -1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @hostnum2subnet(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 32, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add i32 %4, -1
%8 = icmp eq i32 %6, 1
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 32, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ write_spi_register(int, int);
void spi_write_data(int data) { write_spi_register(0x68, data); }


x86 assembly (clang, -O0):
<spi_write_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x68,%edi
call   1030 <write_spi_register@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_write_data>:
mov    %edi,%esi
mov    $0x68,%edi
jmp    1030 <write_spi_register@plt>

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

LLVM IR (-O2):
define void @spi_write_data(i32 %0) {
%2 = tail call i32 @write_spi_register(i32 104, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int open(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
int open_fb(const char *dev) {
  int fd = -1;
  fd = open(dev, O_RDWR);
  if (fd == -1) {
    printf("Error opening device %s : %s\n", dev, strerror(errno));
    exit(-1);
  }
  return fd;
}


x86 assembly (clang, -O0):
<open_fb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    11a5 <open_fb+0x65>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_fb>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     1159 <open_fb+0x19>
pop    %rbx
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe92(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@.str = [30 x i8] c"Error opening device %s : %s\0A\00"
@errno = global i32 0
define i32 @open_fb(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 -1, i32* %3
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = load i32, i32* @errno
%12 = call i8* @strerror(i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %12)
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@.str = [30 x i8] c"Error opening device %s : %s\0A\00"
@errno = global i32 0
define i32 @open_fb(i8* %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %7)
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *my_strcat(char *dst, char *src) {
  char *newstr = (char *)malloc(strlen(dst) + strlen(src) + 1);
  strcpy(newstr, dst);
  strcat(newstr, src);
  free(dst);
  return newstr;
}


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

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

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

LLVM IR (-O2):
define i8* @my_strcat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @strcpy(i8* %8, i8* %0)
%10 = tail call i32 @strcat(i8* %8, i8* %1)
%11 = tail call i32 @free(i8* %0)
ret i8* %8
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void UART9BitAddrSet(uint32_t ui32Base, uint8_t ui8Addr, uint8_t ui8Mask) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x000000A4))) = ui8Addr << 0;
  (*((volatile uint32_t *)(ui32Base + 0x000000A8))) = ui8Mask << 0;
}


x86 assembly (clang, -O0):
<UART9BitAddrSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
shl    $0x0,%ecx
mov    -0x4(%rbp),%eax
add    $0xa4,%eax
cltq
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x0,%ecx
mov    -0x4(%rbp),%eax
add    $0xa8,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART9BitAddrSet>:
movslq %edi,%rax
mov    %esi,0xa4(%rax)
mov    %edx,0xa8(%rax)
ret

LLVM IR (-O0):
define void @UART9BitAddrSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = shl i32 %7, 0
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 164
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %8, i32* %12
%13 = load i32, i32* %6
%14 = shl i32 %13, 0
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 168
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 %14, i32* %18
ret void
}

LLVM IR (-O2):
define void @UART9BitAddrSet(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 164
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 %1, i32* %6
%7 = add nsw i32 %0, 168
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %2, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x3e() {
  Assert_real((isalnum(62) == 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_isalnum.c",
              315, ("isalnum should be 0 for >"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x3e>:
push   %rax
mov    $0x3e,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x13b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for >\00"
define void @t_isalnum_0x3e() {
%1 = call i64 @isalnum(i32 62)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 315, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for >\00"
define void @t_isalnum_0x3e() {
%1 = tail call i64 @isalnum(i32 62)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 315, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void av_d2str() {}


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

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

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

LLVM IR (-O2):
define void @av_d2str() {
ret void
}
double dist1(const double left1, const double right1, const double left2,
             const double right2) {
  if (right1 < left2)
    return left2 - right1;
  else if (right2 < left1)
    return left1 - right2;
  return 0.0;
}


x86 assembly (clang, -O0):
<dist1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1140 <dist1+0x40>
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1175 <dist1+0x75>
movsd  -0x28(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1168 <dist1+0x68>
movsd  -0x10(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1175 <dist1+0x75>
jmp    116d <dist1+0x6d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist1>:
ucomisd %xmm1,%xmm2
jbe    110f <dist1+0xf>
subsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret
xorpd  %xmm2,%xmm2
ucomisd %xmm3,%xmm0
jbe    1121 <dist1+0x21>
subsd  %xmm3,%xmm0
movapd %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dist1(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%10 = load double, double* %7
%11 = load double, double* %8
%12 = fcmp olt double %10, %11
br i1 %12, label %13, label %17
13: ; preds = %4
%14 = load double, double* %8
%15 = load double, double* %7
%16 = fsub double %14, %15
store double %16, double* %5
br label %27
17: ; preds = %4
%18 = load double, double* %9
%19 = load double, double* %6
%20 = fcmp olt double %18, %19
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load double, double* %6
%23 = load double, double* %9
%24 = fsub double %22, %23
store double %24, double* %5
br label %27
25: ; preds = %17
br label %26
26: ; preds = %25
store double 0.000000e+00, double* %5
br label %27
27: ; preds = %26, %21, %13
%28 = load double, double* %5
ret double %28
}

LLVM IR (-O2):
define double @dist1(double %0, double %1, double %2, double %3) {
%5 = fcmp olt double %1, %2
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = fsub double %2, %1
br label %12
8: ; preds = %4
%9 = fcmp olt double %3, %0
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = fsub double %0, %3
br label %12
12: ; preds = %8, %10, %6
%13 = phi double [ %7, %6 ], [ %11, %10 ], [ 0.000000e+00, %8 ]
ret double %13
}
int arch_irqs_disabled_flags(unsigned long flags) { return flags == 0; }


x86 assembly (clang, -O0):
<arch_irqs_disabled_flags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @arch_irqs_disabled_flags(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
double *idx(double *a, int x, int y, int sx, int sy) { return &a[x * sy + y]; }


x86 assembly (clang, -O0):
<idx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
imul   -0x18(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idx>:
imul   %r8d,%esi
add    %edx,%esi
movslq %esi,%rax
lea    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define double* @idx(double* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store double* %0, double** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load double*, double** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %10
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %8
%16 = add nsw i32 %14, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %11, i64 %17
ret double* %18
}

LLVM IR (-O2):
define double* @idx(double* readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = mul nsw i32 %4, %1
%7 = add nsw i32 %6, %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds double, double* %0, i64 %8
ret double* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printHeader() {
  printf("------------------------------------\n");
  printf("        smbusb_m37512flasher\n");
  printf("------------------------------------\n");
}


x86 assembly (clang, -O0):
<printHeader>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHeader>:
push   %rbx
lea    0xf05(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str.2 = [29 x i8] c" smbusb_m37512flasher\00"
@str.3 = [37 x i8] c"------------------------------------\00"
define void @printHeader() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CanHongYuJin_bind();
int /*<<< orphan*/ FeiLong_bind();
int /*<<< orphan*/ KuangFeng_bind();
int /*<<< orphan*/ LiPoQianJun_bind();
int /*<<< orphan*/ LiuHeQiangFa_bind();
int /*<<< orphan*/ SheXingQiangFa_bind();
void PQ_Ability_init() {
  CanHongYuJin_bind();
  FeiLong_bind();
  KuangFeng_bind();
  LiPoQianJun_bind();
  LiuHeQiangFa_bind();
  SheXingQiangFa_bind();
}


x86 assembly (clang, -O0):
<PQ_Ability_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <CanHongYuJin_bind@plt>
mov    $0x0,%al
call   1080 <FeiLong_bind@plt>
mov    $0x0,%al
call   1040 <KuangFeng_bind@plt>
mov    $0x0,%al
call   1070 <LiPoQianJun_bind@plt>
mov    $0x0,%al
call   1050 <LiuHeQiangFa_bind@plt>
mov    $0x0,%al
call   1030 <SheXingQiangFa_bind@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PQ_Ability_init>:
push   %rax
xor    %eax,%eax
call   1060 <CanHongYuJin_bind@plt>
xor    %eax,%eax
call   1080 <FeiLong_bind@plt>
xor    %eax,%eax
call   1040 <KuangFeng_bind@plt>
xor    %eax,%eax
call   1070 <LiPoQianJun_bind@plt>
xor    %eax,%eax
call   1050 <LiuHeQiangFa_bind@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <SheXingQiangFa_bind@plt>

LLVM IR (-O0):
define void @PQ_Ability_init() {
%1 = call i32 (...) @CanHongYuJin_bind()
%2 = call i32 (...) @FeiLong_bind()
%3 = call i32 (...) @KuangFeng_bind()
%4 = call i32 (...) @LiPoQianJun_bind()
%5 = call i32 (...) @LiuHeQiangFa_bind()
%6 = call i32 (...) @SheXingQiangFa_bind()
ret void
}

LLVM IR (-O2):
define void @PQ_Ability_init() {
%1 = tail call i32 (...) @CanHongYuJin_bind()
%2 = tail call i32 (...) @FeiLong_bind()
%3 = tail call i32 (...) @KuangFeng_bind()
%4 = tail call i32 (...) @LiPoQianJun_bind()
%5 = tail call i32 (...) @LiuHeQiangFa_bind()
%6 = tail call i32 (...) @SheXingQiangFa_bind()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_sub(int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_regr_op();
void arm_sub_regr() { arm_arith_sub(arm_data_regr_op()); }


x86 assembly (clang, -O0):
<arm_sub_regr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arm_data_regr_op@plt>
mov    %eax,%edi
call   1030 <arm_arith_sub@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_sub_regr>:
push   %rax
xor    %eax,%eax
call   1040 <arm_data_regr_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_arith_sub@plt>

LLVM IR (-O0):
define void @arm_sub_regr() {
%1 = call i32 (...) @arm_data_regr_op()
%2 = call i32 @arm_arith_sub(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_sub_regr() {
%1 = tail call i32 (...) @arm_data_regr_op()
%2 = tail call i32 @arm_arith_sub(i32 %1)
ret void
}
/* Variables and functions */
int close(int);
int slp_sockclose(int sock) { return close(sock); }


x86 assembly (clang, -O0):
<slp_sockclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slp_sockclose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @slp_sockclose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void gtk_cell_view_get_displayed_row() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_view_get_displayed_row() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ ksft_print_msg(char *, int /*<<< orphan*/, int, char *);
void exit_usage(char **argv) {
  ksft_print_msg("%d[%u] "
                 "Usage: %s [nr_process]"
                 "\n",
                 getpid(), 1875, argv[0]);
  exit(1);
}


x86 assembly (clang, -O0):
<exit_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
lea    0xead(%rip),%rdi
mov    $0x753,%edx
call   1040 <ksft_print_msg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<exit_usage>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    (%rbx),%rcx
lea    0xebb(%rip),%rdi
mov    %eax,%esi
mov    $0x753,%edx
call   1040 <ksft_print_msg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"%d[%u] Usage: %s [nr_process]\0A\00"
define void @exit_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (...) @getpid()
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @ksft_print_msg(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3, i32 1875, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"%d[%u] Usage: %s [nr_process]\0A\00"
define void @exit_usage(i8** nocapture %0) {
%2 = tail call i32 (...) @getpid()
%3 = load i8*, i8** %0
%4 = tail call i32 @ksft_print_msg(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1875, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Sys_Error(char *);
long read(int, void *, long);
void SafeRead(int handle, void *buffer, long count) {
  if (read(handle, buffer, count) != count)
    Sys_Error("Q603: File read failure");
}


x86 assembly (clang, -O0):
<SafeRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <read@plt>
cmp    -0x18(%rbp),%rax
je     1159 <SafeRead+0x39>
lea    0xeac(%rip),%rdi
call   1030 <Sys_Error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SafeRead>:
push   %rbx
mov    %rdx,%rbx
call   1040 <read@plt>
cmp    %rbx,%rax
jne    1130 <SafeRead+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
pop    %rbx
jmp    1030 <Sys_Error@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Q603: File read failure\00"
define void @SafeRead(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @read(i32 %7, i8* %8, i64 %9)
%11 = load i64, i64* %6
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @Sys_Error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Q603: File read failure\00"
define void @SafeRead(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @read(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @Sys_Error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
void __attribute__((warning("curl_easy_setopt expects a char buffer of "
                            "CURL_ERROR_SIZE as argument for this option")))
__attribute__((unused)) __attribute__((no))
_curl_easy_setopt_err_error_buffer(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_error_buffer() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}