xunge/DecIR huggingface dataset:
const char *skip_spaces(const char *s) {
  while (*s && *s == ' ') {
    s++;
  }
  return s;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <skip_spaces+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skip_spaces+0x3d>
jmp    114e <skip_spaces+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_spaces+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
je     1110 <skip_spaces+0x10>
ret

LLVM IR (-O0):
define i8* @skip_spaces(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 32
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @skip_spaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
int main(int argc, char *argv[]) { return (999); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3e7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x3e7,%eax
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
ret i32 999
}

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

/* Variables and functions */
int /*<<< orphan*/ assert(struct ll *);
int /*<<< orphan*/ ll_free(struct ll *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void assertFree(struct ll *list) {
  assert(list);
  printf("Making sure we can free the list...");
  ll_free(list, NULL);
  printf("OK\n");
}


x86 assembly (clang, -O0):
<assertFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert@plt>
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <ll_free@plt>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertFree>:
push   %rbx
mov    %rdi,%rbx
call   1060 <assert@plt>
lea    0xeb0(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <ll_free@plt>
lea    0xebe(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.ll = type { i32 }
@.str = [36 x i8] c"Making sure we can free the list...\00"
@.str.1 = [4 x i8] c"OK\0A\00"
define void @assertFree(%struct.ll* %0) {
%2 = alloca %struct.ll*
store %struct.ll* %0, %struct.ll** %2
%3 = load %struct.ll*, %struct.ll** %2
%4 = call i32 @assert(%struct.ll* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = load %struct.ll*, %struct.ll** %2
%7 = call i32 @ll_free(%struct.ll* %6, i32* null)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ll = type { i32 }
@.str = [36 x i8] c"Making sure we can free the list...\00"
@str = [3 x i8] c"OK\00"
define void @assertFree(%struct.ll* %0) {
%2 = tail call i32 @assert(%struct.ll* %0)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @ll_free(%struct.ll* %0, i32* null)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int, char *);
int read(int /*<<< orphan*/, char *, int);
int main() {
  char buffer[1024];
  int nbc;
  nbc = read(0, buffer, 1024);
  buffer[nbc] = 0;
  printf("PID:%d . J'ai lu %s\n", getpid(), buffer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x400(%rbp),%rsi
xor    %edi,%edi
mov    $0x400,%edx
call   1050 <read@plt>
mov    %eax,-0x404(%rbp)
movslq -0x404(%rbp),%rax
movb   $0x0,-0x400(%rbp,%rax,1)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    -0x400(%rbp),%rdx
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1050 <read@plt>
cltq
movb   $0x0,(%rsp,%rax,1)
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"PID:%d . J'ai lu %s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = call i32 @read(i32 0, i8* %3, i32 1024)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %6
store i8 0, i8* %7
%8 = call i32 (...) @getpid()
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"PID:%d . J'ai lu %s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 1024)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %4
store i8 0, i8* %5
%6 = tail call i32 (...) @getpid()
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pifacecad_lcd_send_command(int);
void pifacecad_lcd_move_right(void) {
  pifacecad_lcd_send_command(0x10 | 0x08 | 0x04);
}


x86 assembly (clang, -O0):
<pifacecad_lcd_move_right>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c,%edi
call   1030 <pifacecad_lcd_send_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pifacecad_lcd_move_right>:
mov    $0x1c,%edi
jmp    1030 <pifacecad_lcd_send_command@plt>

LLVM IR (-O0):
define void @pifacecad_lcd_move_right() {
%1 = call i32 @pifacecad_lcd_send_command(i32 28)
ret void
}

LLVM IR (-O2):
define void @pifacecad_lcd_move_right() {
%1 = tail call i32 @pifacecad_lcd_send_command(i32 28)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void print_perror(const char *msg) { perror(msg); }


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

x86 assembly (clang, -O2):
<print_perror>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @print_perror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
int is_device_pointer(const void *ptr) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @is_device_pointer(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ gui_chat_init();
int /*<<< orphan*/ gui_color_pre_init();
void gui_main_pre_init(int *argc, char **argv[]) {
  (void)argc;
  (void)argv;
  gui_color_pre_init();
  gui_chat_init();
}


x86 assembly (clang, -O0):
<gui_main_pre_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <gui_color_pre_init@plt>
mov    $0x0,%al
call   1030 <gui_chat_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gui_main_pre_init(i32* %0, i8*** %1) {
%3 = alloca i32*
%4 = alloca i8***
store i32* %0, i32** %3
store i8*** %1, i8**** %4
%5 = load i32*, i32** %3
%6 = load i8***, i8**** %4
%7 = call i32 (...) @gui_color_pre_init()
%8 = call i32 (...) @gui_chat_init()
ret void
}

LLVM IR (-O2):
define void @gui_main_pre_init(i32* nocapture readnone %0, i8*** nocapture readnone %1) {
%3 = tail call i32 (...) @gui_color_pre_init()
%4 = tail call i32 (...) @gui_chat_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *);
void *malloc(size_t);
void *checked_malloc(size_t size) {
  void *ret = malloc(size);
  if (!ret && size)
    fail("Could not allocate memory: call to malloc failed.");
  return ret;
}


x86 assembly (clang, -O0):
<checked_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <checked_malloc+0x3b>
cmpq   $0x0,-0x8(%rbp)
je     115b <checked_malloc+0x3b>
lea    0xeaa(%rip),%rdi
call   1030 <fail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <checked_malloc+0x25>
test   %r14,%r14
jne    1145 <checked_malloc+0x25>
lea    0xec0(%rip),%rdi
call   1030 <fail@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Could not allocate memory: call to malloc failed.\00"
define i8* @checked_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @fail(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [50 x i8] c"Could not allocate memory: call to malloc failed.\00"
define noalias i8* @checked_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @fail(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %2
}
int recursiveMinmum(int array[], int size) {
  int temp;
  if (size == 1) {
    return array[0];
  } else {
    temp = recursiveMinmum(array + 1, size - 1);
    if (temp > array[0]) {
      return array[0];
    } else
      return temp;
  }
}


x86 assembly (clang, -O0):
<recursiveMinmum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1137 <recursiveMinmum+0x27>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <recursiveMinmum+0x60>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1030 <recursiveMinmum@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    116a <recursiveMinmum+0x5a>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <recursiveMinmum+0x60>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursiveMinmum>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x1,%esi
jne    111d <recursiveMinmum+0xd>
mov    (%rbx),%eax
pop    %rbx
ret
lea    0x4(%rbx),%rdi
add    $0xffffffff,%esi
call   1030 <recursiveMinmum@plt>
mov    (%rbx),%ecx
cmp    %ecx,%eax
cmovg  %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @recursiveMinmum(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
store i32 %12, i32* %3
br label %30
13: ; preds = %2
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %5
%17 = sub nsw i32 %16, 1
%18 = call i32 @recursiveMinmum(i32* %15, i32 %17)
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = load i32*, i32** %4
%21 = getelementptr inbounds i32, i32* %20, i64 0
%22 = load i32, i32* %21
%23 = icmp sgt i32 %19, %22
br i1 %23, label %24, label %28
24: ; preds = %13
%25 = load i32*, i32** %4
%26 = getelementptr inbounds i32, i32* %25, i64 0
%27 = load i32, i32* %26
store i32 %27, i32* %3
br label %30
28: ; preds = %13
%29 = load i32, i32* %6
store i32 %29, i32* %3
br label %30
30: ; preds = %28, %24, %9
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @recursiveMinmum(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* %0
br label %6
6: ; preds = %4, %8
%7 = phi i32 [ %14, %8 ], [ %5, %4 ]
ret i32 %7
8: ; preds = %2
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = add nsw i32 %1, -1
%11 = tail call i32 @recursiveMinmum(i32* %9, i32 %10)
%12 = load i32, i32* %0
%13 = icmp sgt i32 %11, %12
%14 = select i1 %13, i32 %12, i32 %11
br label %6
}
int intel_connector_debugfs_add(struct drm_connector *connector) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.drm_connector = type opaque
define i32 @intel_connector_debugfs_add(%struct.drm_connector* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ perror(char const *);
int exit_on_error(const char *s) {
  perror(s);
  abort();
  return -1;
}


x86 assembly (clang, -O0):
<exit_on_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<exit_on_error>:
push   %rax
call   1040 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @exit_on_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @exit_on_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 (...) @abort()
unreachable
}
long arch_iscall(long xt) { return (*(long *)xt) == 0xe8909090; }


x86 assembly (clang, -O0):
<arch_iscall>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xe8909090,%ecx
cmp    %rcx,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_iscall>:
mov    $0xe8909090,%ecx
xor    %eax,%eax
cmp    %rcx,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i64 @arch_iscall(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 3901788304
%7 = zext i1 %6 to i32
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @arch_iscall(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 3901788304
%5 = zext i1 %4 to i64
ret i64 %5
}
/* Variables and functions */
double sqrt(double);
double distance(double x1, double y1, double x2, double y2) {
  double dx = x2 - x1;
  double dy = y2 - y1;
  double dsquared = dx * dx + dy * dy;
  double result = sqrt(dsquared);
  return result;
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
subsd  %xmm0,%xmm2
subsd  %xmm1,%xmm3
mulsd  %xmm3,%xmm3
mulsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1136 <distance+0x26>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
ret
movapd %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @distance(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%13 = load double, double* %7
%14 = load double, double* %5
%15 = fsub double %13, %14
store double %15, double* %9
%16 = load double, double* %8
%17 = load double, double* %6
%18 = fsub double %16, %17
store double %18, double* %10
%19 = load double, double* %9
%20 = load double, double* %9
%21 = load double, double* %10
%22 = load double, double* %10
%23 = fmul double %21, %22
%24 = call double @llvm.fmuladd.f64(double %19, double %20, double %23)
store double %24, double* %11
%25 = load double, double* %11
%26 = call double @sqrt(double %25)
store double %26, double* %12
%27 = load double, double* %12
ret double %27
}

LLVM IR (-O2):
define double @distance(double %0, double %1, double %2, double %3) {
%5 = fsub double %2, %0
%6 = fsub double %3, %1
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
%9 = tail call double @sqrt(double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ ACMP3_DriverIRQHandler();
__attribute__((weak)) void ACMP3_IRQHandler(void) { ACMP3_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @ACMP3_IRQHandler() {
%1 = call i32 (...) @ACMP3_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @ACMP3_IRQHandler() {
%1 = tail call i32 (...) @ACMP3_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printMessageFor(int);
int /*<<< orphan*/ printf(char *, ...);
void manageNonFatalError(int code, char *message) {
  printf("\x1B[31m"
         "ERROR CODE [%d]: ",
         code);
  printMessageFor(code);
  printf("\n\t%s\n\n"
         "\x1B[0m",
         message);
  return;
}


x86 assembly (clang, -O0):
<manageNonFatalError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <printMessageFor@plt>
mov    -0x10(%rbp),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manageNonFatalError>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
call   1030 <printMessageFor@plt>
lea    0xed1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\1B[31mERROR CODE [%d]: \00"
@.str.1 = [11 x i8] c"\0A\09%s\0A\0A\1B[0m\00"
define void @manageNonFatalError(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @printMessageFor(i32 %7)
%9 = load i8*, i8** %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\1B[31mERROR CODE [%d]: \00"
@.str.1 = [11 x i8] c"\0A\09%s\0A\0A\1B[0m\00"
define void @manageNonFatalError(i32 %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @printMessageFor(i32 %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ assert(size_t);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *qd_malloc(size_t size) {
  assert(size);
  void *ptr = malloc(size);
  if (!ptr) {
    perror("qd_malloc");
    abort();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<qd_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1180 <qd_malloc+0x40>
lea    0xe8c(%rip),%rdi
call   1060 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_malloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1158 <qd_malloc+0x18>
pop    %rbx
ret
lea    0xea1(%rip),%rdi
call   1060 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"qd_malloc\00"
define noalias i8* @qd_malloc(i64 %0) {
%2 = tail call i32 @assert(i64 %0)
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %3
}
/* Variables and functions */
char const *weak_s1();
const char *sibcall_weak_s1(void) { return weak_s1(); }


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

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

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

LLVM IR (-O2):
define i8* @sibcall_weak_s1() {
%1 = tail call i8* (...) @weak_s1()
ret i8* %1
}
int execute_fstatfs64() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_fstatfs64() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ can_rx(int);
void CAN2_RX0_IRQHandler() { can_rx(1); }


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

x86 assembly (clang, -O2):
<CAN2_RX0_IRQHandler>:
mov    $0x1,%edi
jmp    1030 <can_rx@plt>

LLVM IR (-O0):
define void @CAN2_RX0_IRQHandler() {
%1 = call i32 @can_rx(i32 1)
ret void
}

LLVM IR (-O2):
define void @CAN2_RX0_IRQHandler() {
%1 = tail call i32 @can_rx(i32 1)
ret void
}
void cpu65c02_op_adc_sbc_correct_cycles(struct cpu65x02 *cpu) {}


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

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

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

LLVM IR (-O2):
%struct.cpu65x02 = type opaque
define void @cpu65c02_op_adc_sbc_correct_cycles(%struct.cpu65x02* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char buffer[16];
  printf("String please: ");
  scanf("%s", buffer);
  printf("Thanks for the \"%s\"!\n", buffer);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"String please: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [22 x i8] c"Thanks for the \22%s\22!\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"String please: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [22 x i8] c"Thanks for the \22%s\22!\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int mus_read(int, int, int, int, int **);
int read_sound(int fd, int beg, int end, int chans, int **bufs) {
  return (mus_read(fd, beg, end, chans, bufs));
}


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

x86 assembly (clang, -O2):
<read_sound>:
jmp    1030 <mus_read@plt>

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

LLVM IR (-O2):
define i32 @read_sound(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4) {
%6 = tail call i32 @mus_read(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4)
ret i32 %6
}
const char *rcsid(const char *p) {
  return rcsid(
      p = "@(#)$File: cdf.c,v 1.26 2009/05/02 20:06:55 christos Exp $");
}


x86 assembly (clang, -O0):
<rcsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <rcsid@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [59 x i8] c"@(#)$File: cdf.c,v 1.26 2009/05/02 20:06:55 christos Exp $\00"
define i8* @rcsid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @rcsid(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @rcsid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void initSound() { return; }


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

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

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

LLVM IR (-O2):
define void @initSound() {
ret void
}
/* Variables and functions */
int WEXITSTATUS(int);
int octave_wexitstatus_wrapper(int status) { return WEXITSTATUS(status); }


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

x86 assembly (clang, -O2):
<octave_wexitstatus_wrapper>:
jmp    1030 <WEXITSTATUS@plt>

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

LLVM IR (-O2):
define i32 @octave_wexitstatus_wrapper(i32 %0) {
%2 = tail call i32 @WEXITSTATUS(i32 %0)
ret i32 %2
}
/* Variables and functions */
int f279(int *);
int f280(int *p) { return f279(p); }


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

x86 assembly (clang, -O2):
<f280>:
jmp    1030 <f279@plt>

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

LLVM IR (-O2):
define i32 @f280(i32* %0) {
%2 = tail call i32 @f279(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, char *, int /*<<< orphan*/ *);
void execlp_test() { execlp("ls", "ls", "-la", "/tmp", NULL); }


x86 assembly (clang, -O0):
<execlp_test>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rsi
lea    0xee1(%rip),%rdx
lea    0xede(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    %rsi,%rdi
call   1030 <execlp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<execlp_test>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rdx
lea    0xee2(%rip),%rcx
mov    %rdi,%rsi
xor    %r8d,%r8d
jmp    1030 <execlp@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [4 x i8] c"-la\00"
@.str.2 = [5 x i8] c"/tmp\00"
define void @execlp_test() {
%1 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [4 x i8] c"-la\00"
@.str.2 = [5 x i8] c"/tmp\00"
define void @execlp_test() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void check_pthread(int rc) {
  if (rc) {
    fprintf(stderr, "ERROR; return code from pthread_create() is %d\n", rc);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<check_pthread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1157 <check_pthread+0x37>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pthread>:
test   %edi,%edi
jne    1125 <check_pthread+0x5>
ret
push   %rax
mov    %edi,%edx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"ERROR; return code from pthread_create() is %d\0A\00"
define void @check_pthread(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i32, i32* %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"ERROR; return code from pthread_create() is %d\0A\00"
define void @check_pthread(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version() { printf("nine v0.01 by Robert Seaton\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"nine v0.01 by Robert Seaton\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"nine v0.01 by Robert Seaton\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *roadmap_driver_strdup(const char *text) {
  if (text == NULL)
    return NULL;
  return strdup(text);
}


x86 assembly (clang, -O0):
<roadmap_driver_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <roadmap_driver_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <roadmap_driver_strdup+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_driver_strdup>:
test   %rdi,%rdi
je     111a <roadmap_driver_strdup+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @roadmap_driver_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @roadmap_driver_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ _do_log(char *, int, char *, char *);
int main(int argc, char **argv) {
  _do_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/itmm/waelzer/refs/heads/master/"
          "2.1-logging/main.c",
          10,
          ""
          "all is %s",
          "ok");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0xa,%esi
lea    0xf5a(%rip),%rdx
lea    0xf5d(%rip),%rcx
call   1030 <_do_log@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xf6d(%rip),%rdx
lea    0xf70(%rip),%rcx
mov    $0xa,%esi
call   1030 <_do_log@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/itmm/waelzer/refs/heads/master/2.1-logging/main.c\00"
@.str.1 = [10 x i8] c"all is %s\00"
@.str.2 = [3 x i8] c"ok\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @_do_log(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/itmm/waelzer/refs/heads/master/2.1-logging/main.c\00"
@.str.1 = [10 x i8] c"all is %s\00"
@.str.2 = [3 x i8] c"ok\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @_do_log(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EA_AY_IX_32();
int /*<<< orphan*/ m68ki_jump(int /*<<< orphan*/);
void m68k_op_jmp_32_ix(void) { m68ki_jump(EA_AY_IX_32()); }


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

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

LLVM IR (-O0):
define void @m68k_op_jmp_32_ix() {
%1 = call i32 (...) @EA_AY_IX_32()
%2 = call i32 @m68ki_jump(i32 %1)
ret void
}

LLVM IR (-O2):
define void @m68k_op_jmp_32_ix() {
%1 = tail call i32 (...) @EA_AY_IX_32()
%2 = tail call i32 @m68ki_jump(i32 %1)
ret void
}
int fastfloor(const float x) { return x > 0 ? (int)x : (int)x - 1; }


x86 assembly (clang, -O0):
<fastfloor>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1127 <fastfloor+0x27>
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <fastfloor+0x32>
cvttss2si -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastfloor>:
xorps  %xmm1,%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
setbe  %cl
cvttss2si %xmm0,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fastfloor(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fptosi float %6 to i32
br label %12
8: ; preds = %1
%9 = load float, float* %2
%10 = fptosi float %9 to i32
%11 = sub nsw i32 %10, 1
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ %11, %8 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @fastfloor(float %0) {
%2 = fcmp ule float %0, 0.000000e+00
%3 = fptosi float %0 to i32
%4 = sext i1 %2 to i32
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, ...);
void copyright() {
  printf("\n%s v.%s (%s)\n", "SimpleTextReplace", "0.2", "Mar 16 2022");
  printf("(c)2012 by %s\n\n", "Stephan Laukien");
}


x86 assembly (clang, -O0):
<copyright>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xef8(%rip),%rdx
lea    0xef5(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    0xefc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyright>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef0(%rip),%rsi
lea    0xefb(%rip),%rdx
lea    0xef8(%rip),%rcx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    0xeff(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\0A%s v.%s (%s)\0A\00"
@.str.1 = [18 x i8] c"SimpleTextReplace\00"
@.str.2 = [4 x i8] c"0.2\00"
@.str.3 = [12 x i8] c"Mar 16 2022\00"
@.str.4 = [16 x i8] c"(c)2012 by %s\0A\0A\00"
@.str.5 = [16 x i8] c"Stephan Laukien\00"
define void @copyright() {
%1 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%2 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0A%s v.%s (%s)\0A\00"
@.str.1 = [18 x i8] c"SimpleTextReplace\00"
@.str.2 = [4 x i8] c"0.2\00"
@.str.3 = [12 x i8] c"Mar 16 2022\00"
@.str.4 = [16 x i8] c"(c)2012 by %s\0A\0A\00"
@.str.5 = [16 x i8] c"Stephan Laukien\00"
define void @copyright() {
%1 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ add_sentence(int *, int /*<<< orphan*/ *, int *, int);
void gen_st_trip_milage(uint8_t *b, uint32_t *buflen) {
  uint8_t sentence[] = {0x21, 0xF2, 0x00, 0x06, 0x04};
  add_sentence(b, buflen, sentence, 5);
}


x86 assembly (clang, -O0):
<gen_st_trip_milage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x5,%ecx
call   1030 <add_sentence@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_st_trip_milage>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x5,%ecx
call   1030 <add_sentence@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.gen_st_trip_milage.sentence = [5 x i32] [i32 33, i32 242, i32 0, i32 6, i32 4]
define void @gen_st_trip_milage(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [5 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = bitcast [5 x i32]* %5 to i8*
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
%10 = call i32 @add_sentence(i32* %7, i32* %8, i32* %9, i32 5)
ret void
}

LLVM IR (-O2):
@__const.gen_st_trip_milage.sentence = [5 x i32] [i32 33, i32 242, i32 0, i32 6, i32 4]
define void @gen_st_trip_milage(i32* %0, i32* %1) {
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %3 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%6 = call i32 @add_sentence(i32* %0, i32* %1, i32* %5, i32 5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ISSUING_DIST_POINT;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ ISSUING_DIST_POINT_it;
ISSUING_DIST_POINT *d2i_ISSUING_DIST_POINT(ISSUING_DIST_POINT **a,
                                           const unsigned char **in, long len) {
  return (ISSUING_DIST_POINT *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                             &ISSUING_DIST_POINT_it);
}


x86 assembly (clang, -O0):
<d2i_ISSUING_DIST_POINT>:
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
mov    0x2ea9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_ISSUING_DIST_POINT>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@ISSUING_DIST_POINT_it = global i32 0
define i32* @d2i_ISSUING_DIST_POINT(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 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @ISSUING_DIST_POINT_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@ISSUING_DIST_POINT_it = global i32 0
define i32* @d2i_ISSUING_DIST_POINT(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @ISSUING_DIST_POINT_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
float log(float);
float gp2d12GetCentimerDistanceForTension(float milliVolt) {
  return -40.0f * log(milliVolt) + 300.65f;
}


x86 assembly (clang, -O0):
<gp2d12GetCentimerDistanceForTension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log@plt>
movss  0xed1(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xec9(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gp2d12GetCentimerDistanceForTension>:
push   %rax
call   1030 <log@plt>
mulss  0xee2(%rip),%xmm0
addss  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @gp2d12GetCentimerDistanceForTension(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @log(float %3)
%5 = call float @llvm.fmuladd.f32(float -4.000000e+01, float %4, float 0x4072CA6660000000)
ret float %5
}

LLVM IR (-O2):
define float @gp2d12GetCentimerDistanceForTension(float %0) {
%2 = tail call float @log(float %0)
%3 = tail call float @llvm.fmuladd.f32(float %2, float -4.000000e+01, float 0x4072CA6660000000)
ret float %3
}