xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(size_t);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strdup(const char *s) {
  char *ns = NULL;
  if (s) {
    size_t len = strlen(s) + 1;
    ns = malloc(len);
    if (ns)
      strncpy(ns, s, len);
  }
  return ns;
}


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

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1168 <strdup+0x38>
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1168 <strdup+0x38>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
jmp    116a <strdup+0x3a>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = tail call i8* @malloc(i64 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @strncpy(i8* %7, i8* %0, i64 %6)
br label %11
11: ; preds = %3, %9, %1
%12 = phi i8* [ null, %1 ], [ %7, %9 ], [ null, %3 ]
ret i8* %12
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_move_epi64(int /*<<< orphan*/);
__m128i t3(__m128i a) { return _mm_move_epi64(a); }


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

x86 assembly (clang, -O2):
<t3>:
jmp    1030 <_mm_move_epi64@plt>

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

LLVM IR (-O2):
define i32 @t3(i32 %0) {
%2 = tail call i32 @_mm_move_epi64(i32 %0)
ret i32 %2
}
void term_restore(int fd, const struct termios *tcattr) {}


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

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

LLVM IR (-O0):
%struct.termios = type opaque
define void @term_restore(i32 %0, %struct.termios* %1) {
%3 = alloca i32
%4 = alloca %struct.termios*
store i32 %0, i32* %3
store %struct.termios* %1, %struct.termios** %4
ret void
}

LLVM IR (-O2):
%struct.termios = type opaque
define void @term_restore(i32 %0, %struct.termios* nocapture %1) {
ret void
}
void table(int rows, int cols) {}


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

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

LLVM IR (-O0):
define void @table(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 @table(i32 %0, i32 %1) {
ret void
}
void exchange(int *a, int x, int y) {
  int temp = a[x];
  a[x] = a[y];
  a[y] = temp;
}


x86 assembly (clang, -O0):
<exchange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exchange>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @exchange(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @exchange(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(unsigned int, unsigned int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *xcalloc(unsigned nmemb, unsigned size) {
  void *result = calloc(nmemb, size);
  if (!result) {
    fprintf(stderr, "Out of memory\n");
    exit(EXIT_FAILURE);
  }
  return result;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117b <xcalloc+0x4b>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <xcalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xcalloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i8* @calloc(i32 %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xcalloc(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
void gui_hide(void) {}


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

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

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

LLVM IR (-O2):
define void @gui_hide() {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void stub1(int, char *, int);
void *km_calloc_(size_t n, size_t size, void (*onerr)(int, char *, int),
                 char *file, int line) {
  void *ret = calloc(n, size);
  if (ret == NULL) {
    (*onerr)(1, file, line);
    return NULL;
  } else {
    return ret;
  }
}


x86 assembly (clang, -O0):
<km_calloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1167 <km_calloc_+0x57>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    $0x1,%edi
call   *%rax
movq   $0x0,-0x8(%rbp)
jmp    116f <km_calloc_+0x5f>
mov    -0x38(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<km_calloc_>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %rcx,%rbp
mov    %rdx,%r15
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113b <km_calloc_+0x2b>
mov    $0x1,%edi
mov    %rbp,%rsi
mov    %r14d,%edx
call   *%r15
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @km_calloc_(i64 %0, i64 %1, void (i32, i8*, i32)* nocapture %2, i8* %3, i32 %4) {
%6 = tail call i8* @calloc(i64 %0, i64 %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %5
tail call void %2(i32 1, i8* %3, i32 %4)
br label %9
9: ; preds = %5, %8
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ CBUF_Empty();
int /*<<< orphan*/ UART_WriteString(int /*<<< orphan*/, char *);
int COMMAND_CAN_SerialNumber(void) {
  if (!CBUF_Empty())
    return -1;
  UART_WriteString(0, "0000");
  return 0;
}


x86 assembly (clang, -O0):
<COMMAND_CAN_SerialNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <CBUF_Empty@plt>
cmp    $0x0,%eax
jne    1144 <COMMAND_CAN_SerialNumber+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <COMMAND_CAN_SerialNumber+0x39>
xor    %edi,%edi
lea    0xeb3(%rip),%rsi
call   1040 <UART_WriteString@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COMMAND_CAN_SerialNumber>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <CBUF_Empty@plt>
test   %eax,%eax
je     113e <COMMAND_CAN_SerialNumber+0x1e>
lea    0xecb(%rip),%rsi
xor    %edi,%edi
call   1040 <UART_WriteString@plt>
jmp    1143 <COMMAND_CAN_SerialNumber+0x23>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"0000\00"
define i32 @COMMAND_CAN_SerialNumber() {
%1 = alloca i32
%2 = call i32 (...) @CBUF_Empty()
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
store i32 -1, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 @UART_WriteString(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"0000\00"
define i32 @COMMAND_CAN_SerialNumber() {
%1 = tail call i32 (...) @CBUF_Empty()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @UART_WriteString(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Variables and functions */
long sum(int);
long main() {
  long i = sum(8);
  return i;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x8,%edi
jmp    1030 <sum@plt>

LLVM IR (-O0):
define i64 @main() {
%1 = alloca i64
%2 = call i64 @sum(i32 8)
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @main() {
%1 = tail call i64 @sum(i32 8)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void _term(int sig, void *ud) {
  (void)ud;
  printf("term sig:%d\n", sig);
  exit(0);
}


x86 assembly (clang, -O0):
<_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_term>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"term sig:%d\0A\00"
define void @_term(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"term sig:%d\0A\00"
define void @_term(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int c() { return 34; }


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

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

LLVM IR (-O0):
define i32 @c() {
ret i32 34
}

LLVM IR (-O2):
define i32 @c() {
ret i32 34
}
/* Variables and functions */
scalar_t__ json_malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *json_strdup(const char *str) {
  size_t len;
  char *copy;
  len = strlen(str) + 1;
  if (!(copy = (char *)json_malloc(len)))
    return 0;
  memcpy(copy, str, len);
  return copy;
}


x86 assembly (clang, -O0):
<json_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <json_malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1172 <json_strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    118b <json_strdup+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <json_malloc@plt>
test   %rax,%rax
je     1163 <json_strdup+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    1165 <json_strdup+0x35>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @json_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @json_malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
br label %10
10: ; preds = %1, %8
%11 = phi i8* [ %6, %8 ], [ null, %1 ]
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ do_EnterNotify(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void do_LeaveNotify(FILE *out_f, XEvent *eventp) {
  do_EnterNotify(out_f, eventp);
}


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

x86 assembly (clang, -O2):
<do_LeaveNotify>:
jmp    1030 <do_EnterNotify@plt>

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

LLVM IR (-O2):
define void @do_LeaveNotify(i32* %0, i32* %1) {
%3 = tail call i32 @do_EnterNotify(i32* %0, i32* %1)
ret void
}
int cmp_lt_ushort(const void *p, const void *q) {
  const unsigned short a = *(const unsigned short *)p;
  const unsigned short b = *(const unsigned short *)q;
  do {
    if (a > b)
      return +1;
    if (b > a)
      return -1;
    return 0;
  } while (0);
}


x86 assembly (clang, -O0):
<cmp_lt_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1a(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1c(%rbp)
movzwl -0x1a(%rbp),%eax
movzwl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jle    113e <cmp_lt_ushort+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1161 <cmp_lt_ushort+0x61>
movzwl -0x1c(%rbp),%eax
movzwl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jle    115a <cmp_lt_ushort+0x5a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <cmp_lt_ushort+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_lt_ushort>:
movzwl (%rdi),%eax
movzwl (%rsi),%ecx
cmp    %cx,%ax
sbb    %edx,%edx
cmp    %cx,%ax
mov    $0x1,%eax
cmovbe %edx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_lt_ushort(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i16*
%10 = load i16, i16* %9
store i16 %10, i16* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i16*
%13 = load i16, i16* %12
store i16 %13, i16* %7
br label %14
14: ; preds = %2
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = load i16, i16* %7
%18 = zext i16 %17 to i32
%19 = icmp sgt i32 %16, %18
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 1, i32* %3
br label %29
21: ; preds = %14
%22 = load i16, i16* %7
%23 = zext i16 %22 to i32
%24 = load i16, i16* %6
%25 = zext i16 %24 to i32
%26 = icmp sgt i32 %23, %25
br i1 %26, label %27, label %28
27: ; preds = %21
store i32 -1, i32* %3
br label %29
28: ; preds = %21
store i32 0, i32* %3
br label %29
29: ; preds = %20, %27, %28
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @cmp_lt_ushort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = load i16, i16* %3
%5 = bitcast i8* %1 to i16*
%6 = load i16, i16* %5
%7 = icmp ugt i16 %4, %6
%8 = icmp ugt i16 %6, %4
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int open(char const *, int);
int __libc_open(const char *fn, int flags, ...) { return open(fn, flags); }


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

x86 assembly (clang, -O2):
<__libc_open>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @__libc_open(i8* nocapture %0, i32 %1, ...) {
%3 = tail call i32 @open(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ randgen_init(int, int);
void start_randgen(int iSeed1, int iSeed2) { randgen_init(iSeed1, iSeed2); }


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

x86 assembly (clang, -O2):
<start_randgen>:
jmp    1030 <randgen_init@plt>

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

LLVM IR (-O2):
define void @start_randgen(i32 %0, i32 %1) {
%3 = tail call i32 @randgen_init(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/);
int open_device(void) {
  int fd = -1;
  fd = open("/dev/gpio_irq_driver_simple", O_RDONLY);
  if (fd == -1)
    return -1;
  return fd;
}


x86 assembly (clang, -O0):
<open_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x8(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    114d <open_device+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <open_device+0x43>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_device>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"/dev/gpio_irq_driver_simple\00"
@O_RDONLY = global i32 0
define i32 @open_device() {
%1 = alloca i32
%2 = alloca i32
store i32 -1, i32* %2
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %10
8: ; preds = %0
%9 = load i32, i32* %2
store i32 %9, i32* %1
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [28 x i8] c"/dev/gpio_irq_driver_simple\00"
@O_RDONLY = global i32 0
define i32 @open_device() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
void rotate(unsigned char *word) {
  unsigned char c;
  int i;
  c = word[0];
  for (i = 0; i < 3; i++)
    word[i] = word[i + 1];
  word[3] = c;
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    114b <rotate+0x4b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1118 <rotate+0x18>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
mov    (%rdi),%al
movzwl 0x1(%rdi),%ecx
mov    0x3(%rdi),%dl
mov    %dl,0x2(%rdi)
mov    %cx,(%rdi)
mov    %al,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @rotate(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr i8, i8* %0, i64 1
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %2, i8* %4
ret void
}
unsigned xrop3_19_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk1 = S | stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_19_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_19_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_19_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @xrop3_19_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i32 %4, %5
%7 = xor i32 %6, -1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int write(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int raw_send(int fd, uint8_t *buf, uint16_t len) { return write(fd, buf, len); }


x86 assembly (clang, -O0):
<raw_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_send>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @raw_send(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* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 @write(i32 %7, i32* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @raw_send(i32 %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
int test_imm_04int8_mem(signed char *val) {
  return ((*val) & (-0x04 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_04int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xfffffffc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_04int8_mem>:
cmpb   $0x4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_04int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_04int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 4
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
long time(int /*<<< orphan*/ *);
long getWallTime() {
  long t;
  t = time(NULL);
  return t;
}


x86 assembly (clang, -O0):
<getWallTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @getWallTime() {
%1 = alloca i64
%2 = call i64 @time(i32* null)
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @getWallTime() {
%1 = tail call i64 @time(i32* null)
ret i64 %1
}
unsigned avcodec_build(void) { return 4752; }


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

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

LLVM IR (-O0):
define i32 @avcodec_build() {
ret i32 4752
}

LLVM IR (-O2):
define i32 @avcodec_build() {
ret i32 4752
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void vktrace_free(void *ptr) {
  free(ptr);
  ptr = NULL;
}


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

x86 assembly (clang, -O2):
<vktrace_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @vktrace_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int main() {
  char number[20];
  scanf("%s", number);
  is_prime(number);
  printf("%d \n", is_prime());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <is_prime@plt>
mov    $0x0,%al
call   1040 <is_prime@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <is_prime@plt>
xor    %eax,%eax
call   1040 <is_prime@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @is_prime to i32 (i8*, ...)*)(i8* %2)
%5 = call i32 (...) @is_prime()
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int COLS;
int LINES;
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(int, int, char const *);
int strlen(char const *);
void printDesc(const char *desc) {
  move(LINES / 2, 0);
  mvprintw(LINES / 2, (COLS - strlen(desc)) / 2, desc);
}


x86 assembly (clang, -O0):
<printDesc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
xor    %esi,%esi
call   1050 <move@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    0x2e6f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
call   1040 <mvprintw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDesc>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2eaa(%rip),%rbp
mov    0x0(%rbp),%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
xor    %esi,%esi
call   1050 <move@plt>
mov    0x0(%rbp),%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
mov    0x2e7c(%rip),%rax
mov    (%rax),%ebx
mov    %r14,%rdi
call   1030 <strlen@plt>
sub    %eax,%ebx
mov    %ebx,%esi
shr    $0x1f,%esi
add    %ebx,%esi
sar    %esi
mov    %ebp,%edi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <mvprintw@plt>

LLVM IR (-O0):
@LINES = global i32 0
@COLS = global i32 0
define void @printDesc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LINES
%4 = sdiv i32 %3, 2
%5 = call i32 @move(i32 %4, i32 0)
%6 = load i32, i32* @LINES
%7 = sdiv i32 %6, 2
%8 = load i32, i32* @COLS
%9 = load i8*, i8** %2
%10 = call i32 @strlen(i8* %9)
%11 = sub nsw i32 %8, %10
%12 = sdiv i32 %11, 2
%13 = load i8*, i8** %2
%14 = call i32 @mvprintw(i32 %7, i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
@LINES = global i32 0
@COLS = global i32 0
define void @printDesc(i8* %0) {
%2 = load i32, i32* @LINES
%3 = sdiv i32 %2, 2
%4 = tail call i32 @move(i32 %3, i32 0)
%5 = load i32, i32* @LINES
%6 = sdiv i32 %5, 2
%7 = load i32, i32* @COLS
%8 = tail call i32 @strlen(i8* %0)
%9 = sub nsw i32 %7, %8
%10 = sdiv i32 %9, 2
%11 = tail call i32 @mvprintw(i32 %6, i32 %10, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gui_set_status_text_part(int /*<<< orphan*/,
                                            int /*<<< orphan*/, int, char *);
void gui_set_menu_title(char *text) {
  gui_set_status_text_part(0, 0, 14, text);
}


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

x86 assembly (clang, -O2):
<gui_set_menu_title>:
mov    %rdi,%rcx
xor    %edi,%edi
xor    %esi,%esi
mov    $0xe,%edx
jmp    1030 <gui_set_status_text_part@plt>

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

LLVM IR (-O2):
define void @gui_set_menu_title(i8* %0) {
%2 = tail call i32 @gui_set_status_text_part(i32 0, i32 0, i32 14, i8* %0)
ret void
}
/* Variables and functions */
char *simplify(char *);
int /*<<< orphan*/ writeToFile(char *, char *, unsigned int);
void write(char *path, char *data, unsigned int len_data) {
  char *simplifiedPath = simplify(path);
  writeToFile(simplifiedPath, data, len_data);
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <simplify@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <writeToFile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1030 <simplify@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <writeToFile@plt>

LLVM IR (-O0):
define void @write(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i8* @simplify(i8* %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @writeToFile(i8* %10, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @write(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @simplify(i8* %0)
%5 = tail call i32 @writeToFile(i8* %4, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
char gc(int);
int /*<<< orphan*/ loc();
int /*<<< orphan*/ stderr;
char gx() {
  char c = gc(3);
  if ((c & 0xc0) != 0x80) {
    loc();
    fprintf(stderr, "Bad utf8 extension byte: %02X\n", c);
  }
  return c;
}


x86 assembly (clang, -O0):
<gx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1030 <gc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     1179 <gx+0x49>
mov    $0x0,%al
call   1050 <loc@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1040 <fprintf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gx>:
push   %rbx
mov    $0x3,%edi
call   1030 <gc@plt>
mov    %eax,%ebx
and    $0xc0,%al
cmp    $0x80,%al
je     1162 <gx+0x32>
xor    %eax,%eax
call   1050 <loc@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
movsbl %bl,%edx
lea    0xea3(%rip),%rsi
call   1040 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Bad utf8 extension byte: %02X\0A\00"
define signext i8 @gx() {
%1 = alloca i8
%2 = call signext i8 @gc(i32 3)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = and i32 %4, 192
%6 = icmp ne i32 %5, 128
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = call i32 (...) @loc()
%9 = load i32, i32* @stderr
%10 = load i8, i8* %1
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8 signext %10)
br label %12
12: ; preds = %7, %0
%13 = load i8, i8* %1
ret i8 %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Bad utf8 extension byte: %02X\0A\00"
define signext i8 @gx() {
%1 = tail call signext i8 @gc(i32 3)
%2 = and i8 %1, -64
%3 = icmp eq i8 %2, -128
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call i32 (...) @loc()
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8 signext %1)
br label %8
8: ; preds = %4, %0
ret i8 %1
}
__attribute__((no, noclone)) signed __int128 t169_3sub(unsigned __int128 y) {
  signed __int128 r;
  if (__builtin_sub_overflow((unsigned __int128)(0), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t169_3sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rax
xor    %ecx,%ecx
neg    %rdx
mov    %ecx,%edi
mov    %rdi,%rcx
sbb    %rax,%rcx
mov    %rdi,%rsi
sbb    %rsi,%rsi
sbb    %rdi,%rdi
mov    %esi,%eax
and    $0x1,%eax
neg    %rax
mov    %rax,%r8
xor    %rdi,%r8
xor    %rsi,%rax
or     %r8,%rax
mov    %rcx,%r8
sar    $0x3f,%r8
xor    %r8,%rsi
xor    %r8,%rdi
or     %rdi,%rsi
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    118d <t169_3sub+0x7d>
jmp    1194 <t169_3sub+0x84>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t169_3sub>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
mov    %rdi,%rbx
neg    %rbx
sbb    %rsi,%r14
cmp    $0x1,%rdi
movabs $0x8000000000000000,%rax
sbb    %rax,%rsi
jb     113a <t169_3sub+0x2a>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t169_3sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = zext i128 %11 to i129
%13 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 0, i129 %12)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = sext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t169_3sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = sub nsw i129 0, %7
%9 = icmp ult i128 %6, -170141183460469231731687303715884105727
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i129 %8 to i64
%14 = lshr i129 %8, 64
%15 = trunc i129 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
double pow(double, double);
double compute_linear(double value) {
  if (value > 0.04045) {
    return pow((value + 0.055) / (1.0 + 0.055), 2.4);
  } else {
    return value / 12.92;
  }
}


x86 assembly (clang, -O0):
<compute_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1164 <compute_linear+0x54>
movsd  0xee4(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    117a <compute_linear+0x6a>
movsd  -0x10(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_linear>:
ucomisd 0xee8(%rip),%xmm0
jbe    1137 <compute_linear+0x27>
addsd  0xeee(%rip),%xmm0
divsd  0xeee(%rip),%xmm0
movsd  0xeee(%rip),%xmm1
jmp    1030 <pow@plt>
divsd  0xec9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @compute_linear(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 4.045000e-02
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fadd double %7, 5.500000e-02
%9 = fdiv double %8, 1.055000e+00
%10 = call double @pow(double %9, double 2.400000e+00)
store double %10, double* %2
br label %14
11: ; preds = %1
%12 = load double, double* %3
%13 = fdiv double %12, 1.292000e+01
store double %13, double* %2
br label %14
14: ; preds = %11, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @compute_linear(double %0) {
%2 = fcmp ogt double %0, 4.045000e-02
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fadd double %0, 5.500000e-02
%5 = fdiv double %4, 1.055000e+00
%6 = tail call double @pow(double %5, double 2.400000e+00)
br label %9
7: ; preds = %1
%8 = fdiv double %0, 1.292000e+01
br label %9
9: ; preds = %7, %3
%10 = phi double [ %6, %3 ], [ %8, %7 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ create_direct(int, int);
void create_spin_b(float omega) {
  int speed = (int)(omega * 129.0 * 3.14159265359 / 180.0);
  create_direct(speed, -speed);
}


x86 assembly (clang, -O0):
<create_spin_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeba(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
sub    -0x8(%rbp),%esi
call   1030 <create_direct@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_spin_b>:
cvtss2sd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
mulsd  0xee4(%rip),%xmm0
divsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%edi
mov    %edi,%esi
neg    %esi
jmp    1030 <create_direct@plt>

LLVM IR (-O0):
define void @create_spin_b(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fmul double %5, 1.290000e+02
%7 = fmul double %6, 0x400921FB54442EEA
%8 = fdiv double %7, 1.800000e+02
%9 = fptosi double %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = sub nsw i32 0, %11
%13 = call i32 @create_direct(i32 %10, i32 %12)
ret void
}

LLVM IR (-O2):
define void @create_spin_b(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 1.290000e+02
%4 = fmul double %3, 0x400921FB54442EEA
%5 = fdiv double %4, 1.800000e+02
%6 = fptosi double %5 to i32
%7 = sub nsw i32 0, %6
%8 = tail call i32 @create_direct(i32 %6, i32 %7)
ret void
}