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

/* Variables and functions */
int /*<<< orphan*/ error(struct analyser *, int);
struct name *look_for_name(struct analyser *);
struct name *find_name(struct analyser *a) {
  struct name *p = look_for_name(a);
  if (p == 0)
    error(a, 31);
  return p;
}


x86 assembly (clang, -O0):
<find_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <look_for_name@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1152 <find_name+0x32>
mov    -0x8(%rbp),%rdi
mov    $0x1f,%esi
call   1030 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_name>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <look_for_name@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1141 <find_name+0x21>
mov    %r14,%rdi
mov    $0x1f,%esi
call   1030 <error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.name = type { i32 }
%struct.analyser = type { i32 }
define %struct.name* @find_name(%struct.analyser* %0) {
%2 = alloca %struct.analyser*
%3 = alloca %struct.name*
store %struct.analyser* %0, %struct.analyser** %2
%4 = load %struct.analyser*, %struct.analyser** %2
%5 = call %struct.name* @look_for_name(%struct.analyser* %4)
store %struct.name* %5, %struct.name** %3
%6 = load %struct.name*, %struct.name** %3
%7 = icmp eq %struct.name* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load %struct.analyser*, %struct.analyser** %2
%10 = call i32 @error(%struct.analyser* %9, i32 31)
br label %11
11: ; preds = %8, %1
%12 = load %struct.name*, %struct.name** %3
ret %struct.name* %12
}

LLVM IR (-O2):
%struct.name = type { i32 }
%struct.analyser = type { i32 }
define %struct.name* @find_name(%struct.analyser* %0) {
%2 = tail call %struct.name* @look_for_name(%struct.analyser* %0)
%3 = icmp eq %struct.name* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(%struct.analyser* %0, i32 31)
br label %6
6: ; preds = %4, %1
ret %struct.name* %2
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_RDWR;
int close(int);
int /*<<< orphan*/ shutdown(int, int /*<<< orphan*/);
int ipify_disconnect(int sd) {
  shutdown(sd, SHUT_RDWR);
  return close(sd);
}


x86 assembly (clang, -O0):
<ipify_disconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipify_disconnect>:
push   %rbx
mov    %edi,%ebx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@SHUT_RDWR = global i32 0
define i32 @ipify_disconnect(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SHUT_RDWR
%5 = call i32 @shutdown(i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@SHUT_RDWR = global i32 0
define i32 @ipify_disconnect(i32 %0) {
%2 = load i32, i32* @SHUT_RDWR
%3 = tail call i32 @shutdown(i32 %0, i32 %2)
%4 = tail call i32 @close(i32 %0)
ret i32 %4
}
int init_thin(struct mosaic *m) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mosaic = type opaque
define i32 @init_thin(%struct.mosaic* nocapture readnone %0) {
ret i32 0
}
unsigned char ChartoAscii(const unsigned char cha) {
  unsigned char ascii;
  if ((cha >= 0x0A) && (cha <= 0x0F)) {
    ascii = cha + 'A' - 10;
  } else {
    ascii = cha + '0';
  }
  return ascii;
}


x86 assembly (clang, -O0):
<ChartoAscii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jl     1136 <ChartoAscii+0x36>
movzbl -0x1(%rbp),%eax
cmp    $0xf,%eax
jg     1136 <ChartoAscii+0x36>
movzbl -0x1(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %al,-0x2(%rbp)
jmp    1140 <ChartoAscii+0x40>
movzbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChartoAscii>:
lea    -0xa(%rdi),%eax
cmp    $0x6,%al
mov    $0x37,%ecx
mov    $0x30,%eax
cmovb  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @ChartoAscii(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 10
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 15
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = add nsw i32 %13, 65
%15 = sub nsw i32 %14, 10
%16 = trunc i32 %15 to i8
store i8 %16, i8* %3
br label %22
17: ; preds = %7, %1
%18 = load i8, i8* %2
%19 = zext i8 %18 to i32
%20 = add nsw i32 %19, 48
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
br label %22
22: ; preds = %17, %11
%23 = load i8, i8* %3
ret i8 %23
}

LLVM IR (-O2):
define zeroext i8 @ChartoAscii(i8 zeroext %0) {
%2 = add i8 %0, -10
%3 = icmp ult i8 %2, 6
%4 = select i1 %3, i8 55, i8 48
%5 = add i8 %4, %0
ret i8 %5
}
void __DELETE_org_apache_harmony_niochar_charset_UTF_8_Encoder(
    void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_org_apache_harmony_niochar_charset_UTF_8_Encoder(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
char *ckalloc(scalar_t__);
char *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *copy_string(const char *s) {
  char *p = ckalloc(strlen(s) + 1);
  return strcpy(p, s);
}


x86 assembly (clang, -O0):
<copy_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1030 <ckalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1030 <ckalloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <strcpy@plt>

LLVM IR (-O0):
define i8* @copy_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @ckalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @copy_string(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @ckalloc(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
/* Type definitions */
struct ThreadResources {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ countdownTicks(int, struct ThreadResources *);
int /*<<< orphan*/ pullInSegment(long, long, struct ThreadResources *, int);
void accessMemory(long pageNumber, long segment,
                  struct ThreadResources *thResources, int overmark) {
  pullInSegment(pageNumber, segment, thResources, overmark);
  countdownTicks(4, thResources);
  return;
}


x86 assembly (clang, -O0):
<accessMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <pullInSegment@plt>
mov    -0x18(%rbp),%rsi
mov    $0x4,%edi
call   1030 <countdownTicks@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accessMemory>:
push   %rbx
mov    %rdx,%rbx
call   1040 <pullInSegment@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <countdownTicks@plt>

LLVM IR (-O0):
%struct.ThreadResources = type { i32 }
define void @accessMemory(i64 %0, i64 %1, %struct.ThreadResources* %2, i32 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca %struct.ThreadResources*
%8 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store %struct.ThreadResources* %2, %struct.ThreadResources** %7
store i32 %3, i32* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = load %struct.ThreadResources*, %struct.ThreadResources** %7
%12 = load i32, i32* %8
%13 = call i32 @pullInSegment(i64 %9, i64 %10, %struct.ThreadResources* %11, i32 %12)
%14 = load %struct.ThreadResources*, %struct.ThreadResources** %7
%15 = call i32 @countdownTicks(i32 4, %struct.ThreadResources* %14)
ret void
}

LLVM IR (-O2):
%struct.ThreadResources = type { i32 }
define void @accessMemory(i64 %0, i64 %1, %struct.ThreadResources* %2, i32 %3) {
%5 = tail call i32 @pullInSegment(i64 %0, i64 %1, %struct.ThreadResources* %2, i32 %3)
%6 = tail call i32 @countdownTicks(i32 4, %struct.ThreadResources* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ getbegyx(int /*<<< orphan*/ *, int, int);
void macro_getbegyx(WINDOW *win, int *y, int *x) { getbegyx(win, *y, *x); }


x86 assembly (clang, -O0):
<macro_getbegyx>:
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),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <getbegyx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macro_getbegyx>:
mov    (%rsi),%esi
mov    (%rdx),%edx
jmp    1030 <getbegyx@plt>

LLVM IR (-O0):
define void @macro_getbegyx(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* %8
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = call i32 @getbegyx(i32* %7, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @macro_getbegyx(i32* %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = tail call i32 @getbegyx(i32* %0, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int, int, char *);
int pthread_self();
int /*<<< orphan*/ sleep(int);
void funcThread(void *argp) {
  sleep(2);
  printf("Alo do filho (pid=%u, thread=%u, arg=%s)\n", getpid(), pthread_self(),
         (char *)argp);
  sleep(3);
}


x86 assembly (clang, -O0):
<funcThread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1060 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcThread>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x2,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xe99(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
mov    %rbx,%rcx
call   1040 <printf@plt>
mov    $0x3,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <sleep@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Alo do filho (pid=%u, thread=%u, arg=%s)\0A\00"
define void @funcThread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 2)
%4 = call i32 (...) @getpid()
%5 = call i32 (...) @pthread_self()
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i8* %6)
%8 = call i32 @sleep(i32 3)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Alo do filho (pid=%u, thread=%u, arg=%s)\0A\00"
define void @funcThread(i8* %0) {
%2 = tail call i32 @sleep(i32 2)
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 (...) @pthread_self()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i8* %0)
%6 = tail call i32 @sleep(i32 3)
ret void
}
/* Variables and functions */
double __ocml_remainder_f64(double, double);
double remainder(double x, double y) { return __ocml_remainder_f64(x, y); }


x86 assembly (clang, -O0):
<remainder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__ocml_remainder_f64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainder>:
jmp    1030 <__ocml_remainder_f64@plt>

LLVM IR (-O0):
define double @remainder(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__ocml_remainder_f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @remainder(double %0, double %1) {
%3 = tail call double @__ocml_remainder_f64(double %0, double %1)
ret double %3
}
/* Type definitions */
struct stack_st_OPENSSL_BLOCK {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int OPENSSL_sk_is_sorted(int /*<<< orphan*/ const *);
int sk_OPENSSL_BLOCK_is_sorted(const struct stack_st_OPENSSL_BLOCK *sk) {
  return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_BLOCK_is_sorted>:
jmp    1030 <OPENSSL_sk_is_sorted@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_BLOCK = type { i32 }
define i32 @sk_OPENSSL_BLOCK_is_sorted(%struct.stack_st_OPENSSL_BLOCK* %0) {
%2 = alloca %struct.stack_st_OPENSSL_BLOCK*
store %struct.stack_st_OPENSSL_BLOCK* %0, %struct.stack_st_OPENSSL_BLOCK** %2
%3 = load %struct.stack_st_OPENSSL_BLOCK*, %struct.stack_st_OPENSSL_BLOCK** %2
%4 = bitcast %struct.stack_st_OPENSSL_BLOCK* %3 to i32*
%5 = call i32 @OPENSSL_sk_is_sorted(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_BLOCK = type { i32 }
define i32 @sk_OPENSSL_BLOCK_is_sorted(%struct.stack_st_OPENSSL_BLOCK* %0) {
%2 = getelementptr %struct.stack_st_OPENSSL_BLOCK, %struct.stack_st_OPENSSL_BLOCK* %0, i64 0, i32 0
%3 = tail call i32 @OPENSSL_sk_is_sorted(i32* %2)
ret i32 %3
}
int test_imm_62uint32_mem(unsigned int *val) {
  return ((*val) & (0x62 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_62uint32_mem>:
testb  $0x62,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_62uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 98
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "ln", message); }


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

x86 assembly (clang, -O2):
<g_error>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [3 x i8] c"ln\00"
define void @g_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [3 x i8] c"ln\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double M_PI;
double rad(double deg) { return deg * M_PI / 180.0; }


x86 assembly (clang, -O0):
<rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad>:
mov    0x2ee1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fmul double %3, %4
%6 = fdiv double %5, 1.800000e+02
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @rad(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
ret double %4
}
int create_binary(int fd) {}


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

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

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

LLVM IR (-O2):
define i32 @create_binary(i32 %0) {
ret i32 undef
}
/* Type definitions */
struct object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destruct_cons(struct object *, struct object **,
                                 struct object **);
int /*<<< orphan*/ object_release(struct object *);
struct object *pop();
int /*<<< orphan*/ push(struct object *);
void quote_function(struct object *data) {
  struct object *arg = pop();
  struct object *envs;
  struct object *body;
  destruct_cons(arg, &envs, &body);
  object_release(envs);
  object_release(data);
  push(body);
}


x86 assembly (clang, -O0):
<quote_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <pop@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <destruct_cons@plt>
mov    -0x18(%rbp),%rdi
call   1040 <object_release@plt>
mov    -0x8(%rbp),%rdi
call   1040 <object_release@plt>
mov    -0x20(%rbp),%rdi
call   1060 <push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quote_function>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <pop@plt>
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
mov    %rax,%rdi
call   1050 <destruct_cons@plt>
mov    0x8(%rsp),%rdi
call   1040 <object_release@plt>
mov    %rbx,%rdi
call   1040 <object_release@plt>
mov    (%rsp),%rdi
call   1060 <push@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.object = type { i32 }
define void @quote_function(%struct.object* %0) {
%2 = alloca %struct.object*
%3 = alloca %struct.object*
%4 = alloca %struct.object*
%5 = alloca %struct.object*
store %struct.object* %0, %struct.object** %2
%6 = call %struct.object* (...) @pop()
store %struct.object* %6, %struct.object** %3
%7 = load %struct.object*, %struct.object** %3
%8 = call i32 @destruct_cons(%struct.object* %7, %struct.object** %4, %struct.object** %5)
%9 = load %struct.object*, %struct.object** %4
%10 = call i32 @object_release(%struct.object* %9)
%11 = load %struct.object*, %struct.object** %2
%12 = call i32 @object_release(%struct.object* %11)
%13 = load %struct.object*, %struct.object** %5
%14 = call i32 @push(%struct.object* %13)
ret void
}

LLVM IR (-O2):
%struct.object = type { i32 }
define void @quote_function(%struct.object* %0) {
%2 = alloca %struct.object*
%3 = alloca %struct.object*
%4 = tail call %struct.object* (...) @pop()
%5 = bitcast %struct.object** %2 to i8*
%6 = bitcast %struct.object** %3 to i8*
%7 = call i32 @destruct_cons(%struct.object* %4, %struct.object** %2, %struct.object** %3)
%8 = load %struct.object*, %struct.object** %2
%9 = call i32 @object_release(%struct.object* %8)
%10 = call i32 @object_release(%struct.object* %0)
%11 = load %struct.object*, %struct.object** %3
%12 = call i32 @push(%struct.object* %11)
ret void
}
int cairo_code_draw_blackLEDbutton_get_width() { return 30; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_blackLEDbutton_get_width() {
ret i32 30
}

LLVM IR (-O2):
define i32 @cairo_code_draw_blackLEDbutton_get_width() {
ret i32 30
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ NID_sha384;
int jksengine_digests_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
int jksengine_sha384_init(EVP_MD_CTX *ctx) {
  ;
  return (jksengine_digests_init(ctx, NID_sha384));
}


x86 assembly (clang, -O0):
<jksengine_sha384_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <jksengine_digests_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_sha384_init>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <jksengine_digests_init@plt>

LLVM IR (-O0):
@NID_sha384 = global i32 0
define i32 @jksengine_sha384_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @NID_sha384
%5 = call i32 @jksengine_digests_init(i32* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@NID_sha384 = global i32 0
define i32 @jksengine_sha384_init(i32* %0) {
%2 = load i32, i32* @NID_sha384
%3 = tail call i32 @jksengine_digests_init(i32* %0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ CRYPTO_RWLOCK;

/* Variables and functions */
int /*<<< orphan*/ OPENSSL_assert(int);
int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock) {
  OPENSSL_assert(*(unsigned int *)lock == 1);
  return 1;
}


x86 assembly (clang, -O0):
<CRYPTO_THREAD_read_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <OPENSSL_assert@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_THREAD_read_lock>:
push   %rax
xor    %eax,%eax
cmpl   $0x1,(%rdi)
sete   %al
mov    %eax,%edi
call   1030 <OPENSSL_assert@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @CRYPTO_THREAD_read_lock(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = tail call i32 @OPENSSL_assert(i32 %4)
ret i32 1
}
int baz(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<baz>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @baz(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @baz(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t F1(uint8_t x) {
  uint8_t temp1, temp2, temp3;
  temp1 = ((x << 3) & 0xFF) ^ ((x >> 5) & 0xFF);
  temp2 = ((x << 4) & 0xFF) ^ ((x >> 4) & 0xFF);
  temp3 = ((x << 6) & 0xFF) ^ ((x >> 2) & 0xFF);
  return temp1 ^ temp2 ^ temp3;
}


x86 assembly (clang, -O0):
<F1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
and    $0xff,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
and    $0xff,%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x6,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0xff,%ecx
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<F1>:
lea    0x0(,%rdi,8),%eax
mov    %edi,%ecx
shr    $0x5,%ecx
xor    %eax,%ecx
mov    %edi,%eax
shl    $0x4,%eax
mov    %edi,%edx
shr    $0x4,%edx
xor    %eax,%edx
mov    %edi,%eax
shl    $0x6,%eax
shr    $0x2,%edi
xor    %eax,%edi
xor    %ecx,%edi
xor    %edx,%edi
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @F1(i32 %0) {
%2 = shl i32 %0, 3
%3 = and i32 %2, 248
%4 = lshr i32 %0, 5
%5 = and i32 %4, 255
%6 = shl i32 %0, 4
%7 = and i32 %6, 240
%8 = lshr i32 %0, 4
%9 = and i32 %8, 255
%10 = shl i32 %0, 6
%11 = and i32 %10, 192
%12 = lshr i32 %0, 2
%13 = and i32 %12, 255
%14 = xor i32 %11, %13
%15 = xor i32 %14, %5
%16 = xor i32 %15, %3
%17 = xor i32 %16, %9
%18 = xor i32 %17, %7
ret i32 %18
}
/* Variables and functions */
int mkdir(char const *, int);
int UnixVfs_mkdir(const char *zPath, int mode, int recursive) {
  int rc;
  rc = mkdir(zPath, mode);
  recursive = 0;
  return rc == 0 ? 0 : -1;
}


x86 assembly (clang, -O0):
<UnixVfs_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <mkdir@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x14(%rbp),%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnixVfs_mkdir>:
push   %rax
call   1030 <mkdir@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @UnixVfs_mkdir(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @mkdir(i8* %8, i32 %9)
store i32 %10, i32* %7
store i32 0, i32* %6
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 0, i32 -1
ret i32 %14
}

LLVM IR (-O2):
define i32 @UnixVfs_mkdir(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @mkdir(i8* %0, i32 %1)
%5 = icmp ne i32 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}
void resize() {}


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

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

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

LLVM IR (-O2):
define void @resize() {
ret void
}
/* Variables and functions */
int fwrite(char const *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int log_write(const char *data, int size) {
  int succ_size = 0;
  if (size <= 0)
    return 0;
  succ_size = fwrite(data, 1, size, stderr);
  if (succ_size <= 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<log_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     113c <log_write+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1176 <log_write+0x66>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    0x2e96(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1030 <fwrite@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     116f <log_write+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    1176 <log_write+0x66>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_write>:
test   %esi,%esi
jle    1138 <log_write+0x28>
push   %rax
mov    %esi,%edx
mov    0x2ec2(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1030 <fwrite@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setg   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@stderr = global i32 0
define i32 @log_write(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 0, i32* %6
%7 = load i32, i32* %5
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %19
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i32, i32* @stderr
%14 = call i32 @fwrite(i8* %11, i32 1, i32 %12, i32 %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp sle i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %10
store i32 0, i32* %3
br label %19
18: ; preds = %10
store i32 1, i32* %3
br label %19
19: ; preds = %18, %17, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @log_write(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fwrite(i8* %0, i32 1, i32 %1, i32 %5)
%7 = icmp sgt i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %2
%10 = phi i32 [ 0, %2 ], [ %8, %4 ]
ret i32 %10
}
void REMR3IsPageAccessHandled(void) {}


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

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

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

LLVM IR (-O2):
define void @REMR3IsPageAccessHandled() {
ret void
}
void str_copy(char *str_to, char *str_from) {
  while ((*str_to++ = *str_from++) != 0)
    ;
}


x86 assembly (clang, -O0):
<str_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     113f <str_copy+0x3f>
jmp    110c <str_copy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <str_copy+0x10>
ret

LLVM IR (-O0):
define void @str_copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %13, %2
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %4
%8 = load i8, i8* %6
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
store i8 %8, i8* %9
%11 = sext i8 %8 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @str_copy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outl(unsigned int, int);
int /*<<< orphan*/ slow_down_io();
__attribute__((always_)) void outl_p(unsigned int value, int port) {
  outl(value, port);
  slow_down_io();
}


x86 assembly (clang, -O0):
<outl_p>:
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 <outl@plt>
mov    $0x0,%al
call   1040 <slow_down_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @outl_p(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 @outl(i32 %5, i32 %6)
%8 = call i32 (...) @slow_down_io()
ret void
}

LLVM IR (-O2):
define void @outl_p(i32 %0, i32 %1) {
%3 = tail call i32 @outl(i32 %0, i32 %1)
%4 = tail call i32 (...) @slow_down_io()
ret void
}
double getEpsilon(unsigned int sigdig) {
  double result = 0.1;
  for (unsigned int i = 0; i <= sigdig; i++)
    result *= 0.1;
  return result;
}


x86 assembly (clang, -O0):
<getEpsilon>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
ja     1147 <getEpsilon+0x47>
movsd  0xed1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <getEpsilon+0x1b>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEpsilon>:
lea    0x1(%rdi),%ecx
mov    %ecx,%eax
and    $0x7,%eax
cmp    $0x7,%edi
jae    1117 <getEpsilon+0x17>
movsd  0xeeb(%rip),%xmm0
jmp    1155 <getEpsilon+0x55>
and    $0xfffffff8,%ecx
movsd  0xede(%rip),%xmm1
movapd %xmm1,%xmm0
cs nopw 0x0(%rax,%rax,1)
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
add    $0xfffffff8,%ecx
jne    1130 <getEpsilon+0x30>
test   %eax,%eax
je     1179 <getEpsilon+0x79>
movsd  0xe9f(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mulsd  %xmm1,%xmm0
add    $0xffffffff,%eax
jne    1170 <getEpsilon+0x70>
ret

LLVM IR (-O0):
define double @getEpsilon(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store i32 %0, i32* %2
store double 1.000000e-01, double* %3
store i32 0, i32* %4
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp ule i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load double, double* %3
%11 = fmul double %10, 1.000000e-01
store double %11, double* %3
br label %12
12: ; preds = %9
%13 = load i32, i32* %4
%14 = add i32 %13, 1
store i32 %14, i32* %4
br label %5
15: ; preds = %5
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @getEpsilon(i32 %0) {
%2 = add i32 %0, 1
%3 = and i32 %2, 7
%4 = icmp ult i32 %0, 7
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = and i32 %2, -8
br label %19
7: ; preds = %19, %1
%8 = phi double [ undef, %1 ], [ %29, %19 ]
%9 = phi double [ 1.000000e-01, %1 ], [ %29, %19 ]
%10 = icmp eq i32 %3, 0
br i1 %10, label %17, label %11
11: ; preds = %7, %11
%12 = phi double [ %14, %11 ], [ %9, %7 ]
%13 = phi i32 [ %15, %11 ], [ 0, %7 ]
%14 = fmul double %12, 1.000000e-01
%15 = add i32 %13, 1
%16 = icmp eq i32 %15, %3
br i1 %16, label %17, label %11
17: ; preds = %11, %7
%18 = phi double [ %8, %7 ], [ %14, %11 ]
ret double %18
19: ; preds = %19, %5
%20 = phi double [ 1.000000e-01, %5 ], [ %29, %19 ]
%21 = phi i32 [ 0, %5 ], [ %30, %19 ]
%22 = fmul double %20, 1.000000e-01
%23 = fmul double %22, 1.000000e-01
%24 = fmul double %23, 1.000000e-01
%25 = fmul double %24, 1.000000e-01
%26 = fmul double %25, 1.000000e-01
%27 = fmul double %26, 1.000000e-01
%28 = fmul double %27, 1.000000e-01
%29 = fmul double %28, 1.000000e-01
%30 = add i32 %21, 8
%31 = icmp eq i32 %30, %6
br i1 %31, label %7, label %19
}
/* Variables and functions */
int /*<<< orphan*/ SCOTCHFRANDOMRESET();
void scotchfrandomreset() { SCOTCHFRANDOMRESET(); }


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

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

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

LLVM IR (-O2):
define void @scotchfrandomreset() {
%1 = tail call i32 (...) @SCOTCHFRANDOMRESET()
ret void
}
int test_imm_ACint32_mem(int *val) {
  return ((*val) & (0xAC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_ACint32_mem>:
testb  $0xac,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ACint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 172
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int annotated_inc_2_2(int);
int annotated_inc_2_1(int i) { return annotated_inc_2_2(i); }


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

x86 assembly (clang, -O2):
<annotated_inc_2_1>:
jmp    1030 <annotated_inc_2_2@plt>

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

LLVM IR (-O2):
define i32 @annotated_inc_2_1(i32 %0) {
%2 = tail call i32 @annotated_inc_2_2(i32 %0)
ret i32 %2
}
/* Variables and functions */
int hash(char *);
int getHash(char *str, int tableSize) {
  return (hash(str) % (tableSize - 1)) + 1;
}


x86 assembly (clang, -O0):
<getHash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hash@plt>
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHash>:
push   %rbx
mov    %esi,%ebx
call   1030 <hash@plt>
add    $0xffffffff,%ebx
cltd
idiv   %ebx
lea    0x1(%rdx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getHash(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 = call i32 @hash(i8* %5)
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = srem i32 %6, %8
%10 = add nsw i32 %9, 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @getHash(i8* %0, i32 %1) {
%3 = tail call i32 @hash(i8* %0)
%4 = add nsw i32 %1, -1
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ func1();
int /*<<< orphan*/ func2();
int main(void) {
  func1();
  fork();
  func2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <func1@plt>
mov    $0x0,%al
call   1050 <fork@plt>
mov    $0x0,%al
call   1040 <func2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @func1()
%3 = call i32 (...) @fork()
%4 = call i32 (...) @func2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func1()
%2 = tail call i32 (...) @fork()
%3 = tail call i32 (...) @func2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
int blankline(char *line) {
  register char *cp;
  for (cp = line; *cp; cp++) {
    if (!isspace(*cp))
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<blankline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <blankline+0x58>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1152 <blankline+0x42>
movl   $0x0,-0x4(%rbp)
jmp    116f <blankline+0x5f>
jmp    1157 <blankline+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <blankline+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blankline>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <blankline+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <blankline+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <blankline+0x20>
jmp    114b <blankline+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @blankline(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isspace(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y;
};
typedef TYPE_1__ XExposeEvent;

/* Variables and functions */
int get_XExposeEvent_y(void *_p) { return (int)((XExposeEvent *)_p)->y; }


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

x86 assembly (clang, -O2):
<get_XExposeEvent_y>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XExposeEvent_y(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XExposeEvent_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ _clock();
clock_t __attribute__((weak)) clock(void) { return _clock(); }


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

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

LLVM IR (-O0):
define weak i32 @clock() {
%1 = call i32 (...) @_clock()
ret i32 %1
}

LLVM IR (-O2):
define weak i32 @clock() {
%1 = tail call i32 (...) @_clock()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void assert(int condition, char *message) {
  if (!condition)
    error(message);
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1132 <assert+0x22>
mov    -0x10(%rbp),%rdi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1115 <assert+0x5>
ret
mov    %rsi,%rdi
jmp    1030 <error@plt>

LLVM IR (-O0):
define void @assert(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 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @error(i8* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @assert(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @error(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int syscall(int, int, char *, int);
int klogctl(int type, char *buf, int len) {
  return syscall(103, type, buf, len);
}


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

x86 assembly (clang, -O2):
<klogctl>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x67,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @klogctl(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @syscall(i32 103, i32 %0, i8* %1, i32 %2)
ret i32 %4
}