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

/* Variables and functions */
int /*<<< orphan*/ *EVP_get_digestbyname(char *);
int /*<<< orphan*/ OpenSSL_add_all_digests();
int /*<<< orphan*/ X509_digest(void *, int /*<<< orphan*/ const *,
                               unsigned char *, unsigned int *);
int create_fingerprint(unsigned char *hash_ptr, void *pub_key) {
  OpenSSL_add_all_digests();
  const EVP_MD *digest = EVP_get_digestbyname("sha1");
  unsigned int n;
  X509_digest(pub_key, digest, hash_ptr, &n);
  return 1;
}


x86 assembly (clang, -O0):
<create_fingerprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <OpenSSL_add_all_digests@plt>
lea    0xeb2(%rip),%rdi
call   1040 <EVP_get_digestbyname@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1050 <X509_digest@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_fingerprint>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <OpenSSL_add_all_digests@plt>
lea    0xeb8(%rip),%rdi
call   1040 <EVP_get_digestbyname@plt>
lea    0x4(%rsp),%rcx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1050 <X509_digest@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"sha1\00"
define i32 @create_fingerprint(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = call i32 (...) @OpenSSL_add_all_digests()
%8 = call i32* @EVP_get_digestbyname(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = load i32*, i32** %5
%11 = load i8*, i8** %3
%12 = call i32 @X509_digest(i8* %9, i32* %10, i8* %11, i32* %6)
ret i32 1
}

LLVM IR (-O2):
@.str = [5 x i8] c"sha1\00"
define i32 @create_fingerprint(i8* %0, i8* %1) {
%3 = alloca i32
%4 = tail call i32 (...) @OpenSSL_add_all_digests()
%5 = tail call i32* @EVP_get_digestbyname(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = bitcast i32* %3 to i8*
%7 = call i32 @X509_digest(i8* %1, i32* %5, i8* %0, i32* %3)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ avrtest_putchar(char);
int avrtest_fputc(char c, FILE *stream) {
  (void)stream;
  avrtest_putchar(c);
  return 0;
}


x86 assembly (clang, -O0):
<avrtest_fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <avrtest_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @avrtest_fputc(i8 signext %0, i32* nocapture readnone %1) {
%3 = tail call i32 @avrtest_putchar(i8 signext %0)
ret i32 0
}
/* Variables and functions */
int machdep_sys_getdents(int, char *, int);
int machdep_sys_getdirentries(int fd, char *buf, int len, int *seek) {
  int i;
  i = machdep_sys_getdents(fd, buf, len);
  return i;
}


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

x86 assembly (clang, -O2):
<machdep_sys_getdirentries>:
jmp    1030 <machdep_sys_getdents@plt>

LLVM IR (-O0):
define i32 @machdep_sys_getdirentries(i32 %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = call i32 @machdep_sys_getdents(i32 %10, i8* %11, i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
ret i32 %14
}

LLVM IR (-O2):
define i32 @machdep_sys_getdirentries(i32 %0, i8* %1, i32 %2, i32* nocapture readnone %3) {
%5 = tail call i32 @machdep_sys_getdents(i32 %0, i8* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int db_int_query(char const *, int);
int class_count(void) {
  static const char q[] = "SELECT COUNT(1) FROM class";
  return db_int_query(q, sizeof q);
}


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

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

LLVM IR (-O0):
@class_count.q = internal constant [27 x i8] c"SELECT COUNT(1) FROM class\00"
define i32 @class_count() {
%1 = call i32 @db_int_query(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @class_count.q, i64 0, i64 0), i32 27)
ret i32 %1
}

LLVM IR (-O2):
@class_count.q = internal constant [27 x i8] c"SELECT COUNT(1) FROM class\00"
define i32 @class_count() {
%1 = tail call i32 @db_int_query(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @class_count.q, i64 0, i64 0), i32 27)
ret i32 %1
}
int security_skb_alloc(struct sk_buff *skb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.sk_buff = type opaque
define i32 @security_skb_alloc(%struct.sk_buff* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Delay();
int /*<<< orphan*/ DisplayColourArea(int, int, int, int);
void CommonInterruptHandler(int handlerNum) {
  DisplayColourArea(0xF, 0xF, handlerNum, 1);
  Delay();
  DisplayColourArea(0x0, 0xF, handlerNum, 1);
}


x86 assembly (clang, -O0):
<CommonInterruptHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xf,%esi
mov    $0x1,%ecx
mov    %esi,%edi
call   1040 <DisplayColourArea@plt>
mov    $0x0,%al
call   1030 <Delay@plt>
mov    -0x4(%rbp),%edx
xor    %edi,%edi
mov    $0xf,%esi
mov    $0x1,%ecx
call   1040 <DisplayColourArea@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CommonInterruptHandler>:
push   %rbx
mov    %edi,%ebx
mov    $0xf,%edi
mov    $0xf,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
call   1040 <DisplayColourArea@plt>
xor    %eax,%eax
call   1030 <Delay@plt>
xor    %edi,%edi
mov    $0xf,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
pop    %rbx
jmp    1040 <DisplayColourArea@plt>

LLVM IR (-O0):
define void @CommonInterruptHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @DisplayColourArea(i32 15, i32 15, i32 %3, i32 1)
%5 = call i32 (...) @Delay()
%6 = load i32, i32* %2
%7 = call i32 @DisplayColourArea(i32 0, i32 15, i32 %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @CommonInterruptHandler(i32 %0) {
%2 = tail call i32 @DisplayColourArea(i32 15, i32 15, i32 %0, i32 1)
%3 = tail call i32 (...) @Delay()
%4 = tail call i32 @DisplayColourArea(i32 0, i32 15, i32 %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
extern void tfp_asid_setup(void) { panic("tfp_asid_setup: implement me"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"tfp_asid_setup: implement me\00"
define void @tfp_asid_setup() {
%1 = call i32 @panic(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"tfp_asid_setup: implement me\00"
define void @tfp_asid_setup() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
int setup_perf_record(struct uftrace_perf_writer *perf, int nr_cpu, int pid,
                      const char *dirname, int use_ctxsw) {
  return -1;
}


x86 assembly (clang, -O0):
<setup_perf_record>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.uftrace_perf_writer = type opaque
define i32 @setup_perf_record(%struct.uftrace_perf_writer* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca %struct.uftrace_perf_writer*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store %struct.uftrace_perf_writer* %0, %struct.uftrace_perf_writer** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret i32 -1
}

LLVM IR (-O2):
%struct.uftrace_perf_writer = type opaque
define i32 @setup_perf_record(%struct.uftrace_perf_writer* nocapture readnone %0, i32 %1, i32 %2, i8* nocapture readnone %3, i32 %4) {
ret i32 -1
}
void foo_2_1_1_1_2_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_1_2_2_2_2_1() {
ret void
}
/* Type definitions */
struct int_cont_t {
  int dummy;
};
struct cont_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ shrink_cont(struct cont_t **, int);
void shrink_int(struct int_cont_t **int_cont_ref) {
  struct int_cont_t *int_cont = *int_cont_ref;
  shrink_cont((struct cont_t **)&int_cont, sizeof(int));
  return;
}


x86 assembly (clang, -O0):
<shrink_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1030 <shrink_cont@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shrink_int>:
push   %rax
mov    (%rdi),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1030 <shrink_cont@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.int_cont_t = type { i32 }
%struct.cont_t = type { i32 }
define void @shrink_int(%struct.int_cont_t** %0) {
%2 = alloca %struct.int_cont_t**
%3 = alloca %struct.int_cont_t*
store %struct.int_cont_t** %0, %struct.int_cont_t*** %2
%4 = load %struct.int_cont_t**, %struct.int_cont_t*** %2
%5 = load %struct.int_cont_t*, %struct.int_cont_t** %4
store %struct.int_cont_t* %5, %struct.int_cont_t** %3
%6 = bitcast %struct.int_cont_t** %3 to %struct.cont_t**
%7 = call i32 @shrink_cont(%struct.cont_t** %6, i32 4)
ret void
}

LLVM IR (-O2):
%struct.int_cont_t = type { i32 }
%struct.cont_t = type { i32 }
define void @shrink_int(%struct.int_cont_t** nocapture %0) {
%2 = alloca %struct.int_cont_t*
%3 = bitcast %struct.int_cont_t** %2 to i8*
%4 = load %struct.int_cont_t*, %struct.int_cont_t** %0
store %struct.int_cont_t* %4, %struct.int_cont_t** %2
%5 = bitcast %struct.int_cont_t** %2 to %struct.cont_t**
%6 = call i32 @shrink_cont(%struct.cont_t** %5, i32 4)
ret void
}
/* Type definitions */
struct ir_remote {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_rec_buffer();
char *decode_all(struct ir_remote *);
char *udp_rec(struct ir_remote *remotes) {
  if (!clear_rec_buffer())
    return (NULL);
  return (decode_all(remotes));
}


x86 assembly (clang, -O0):
<udp_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clear_rec_buffer@plt>
cmp    $0x0,%eax
jne    1149 <udp_rec+0x29>
movq   $0x0,-0x8(%rbp)
jmp    1156 <udp_rec+0x36>
mov    -0x10(%rbp),%rdi
call   1040 <decode_all@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp_rec>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clear_rec_buffer@plt>
test   %eax,%eax
je     1138 <udp_rec+0x18>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <decode_all@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ir_remote = type { i32 }
define i8* @udp_rec(%struct.ir_remote* %0) {
%2 = alloca i8*
%3 = alloca %struct.ir_remote*
store %struct.ir_remote* %0, %struct.ir_remote** %3
%4 = call i32 (...) @clear_rec_buffer()
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load %struct.ir_remote*, %struct.ir_remote** %3
%9 = call i8* @decode_all(%struct.ir_remote* %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
%struct.ir_remote = type { i32 }
define i8* @udp_rec(%struct.ir_remote* %0) {
%2 = tail call i32 (...) @clear_rec_buffer()
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @decode_all(%struct.ir_remote* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ Reserved57_DriverIRQHandler();
__attribute__((weak)) void Reserved57_IRQHandler(void) {
  Reserved57_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @Reserved57_IRQHandler() {
%1 = tail call i32 (...) @Reserved57_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ KSA(char *, unsigned char *);
int /*<<< orphan*/ PRGA(unsigned char *, char *, unsigned char *);
int RC4(char *key, char *plaintext, unsigned char *ciphertext) {
  unsigned char S[256];
  KSA(key, S);
  PRGA(S, plaintext, ciphertext);
  return 0;
}


x86 assembly (clang, -O0):
<RC4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1030 <KSA@plt>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <PRGA@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RC4>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rsp,%r15
mov    %r15,%rsi
call   1030 <KSA@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <PRGA@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @RC4(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [256 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%10 = call i32 @KSA(i8* %8, i8* %9)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = call i32 @PRGA(i8* %11, i8* %12, i8* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @RC4(i8* %0, i8* %1, i8* %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = call i32 @KSA(i8* %0, i8* %5)
%7 = call i32 @PRGA(i8* %5, i8* %1, i8* %2)
ret i32 0
}
/* Variables and functions */
double doubles_inner_product(double *, double *, int);
double doubles_magnitude_sqd(double *f, int size) {
  return (doubles_inner_product(f, f, size));
}


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

x86 assembly (clang, -O2):
<doubles_magnitude_sqd>:
mov    %esi,%edx
mov    %rdi,%rsi
jmp    1030 <doubles_inner_product@plt>

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

LLVM IR (-O2):
define double @doubles_magnitude_sqd(double* %0, i32 %1) {
%3 = tail call double @doubles_inner_product(double* %0, double* %0, i32 %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void zlib_free(void *opaque, void *address) { free(address); }


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

x86 assembly (clang, -O2):
<zlib_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @zlib_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
void mt_lbprof_tick(void) {}


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

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

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

LLVM IR (-O2):
define void @mt_lbprof_tick() {
ret void
}
double dot_prod3(const double a[], const double b[]) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}


x86 assembly (clang, -O0):
<dot_prod3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_prod3>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dot_prod3(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @dot_prod3(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
int main() {
  foo("blah %x blah");
  foo("blah %1x blah %2x blah");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <foo@plt>
lea    0xee6(%rip),%rdi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"blah %x blah\00"
@.str.1 = [23 x i8] c"blah %1x blah %2x blah\00"
define i32 @main() {
%1 = call i32 @foo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @foo(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"blah %x blah\00"
@.str.1 = [23 x i8] c"blah %1x blah %2x blah\00"
define i32 @main() {
%1 = tail call i32 @foo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @foo(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
long DIV_ROUND_CLOSEST(long, int);
long milli_kelvin_to_millicelsius(long);
long deci_kelvin_to_celsius(long t) {
  t = milli_kelvin_to_millicelsius(t * 100);
  return DIV_ROUND_CLOSEST(t, 1000);
}


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

x86 assembly (clang, -O2):
<deci_kelvin_to_celsius>:
push   %rax
imul   $0x64,%rdi,%rdi
call   1030 <milli_kelvin_to_millicelsius@plt>
mov    %rax,%rdi
mov    $0x3e8,%esi
pop    %rax
jmp    1040 <DIV_ROUND_CLOSEST@plt>

LLVM IR (-O0):
define i64 @deci_kelvin_to_celsius(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 100
%5 = call i64 @milli_kelvin_to_millicelsius(i64 %4)
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = call i64 @DIV_ROUND_CLOSEST(i64 %6, i32 1000)
ret i64 %7
}

LLVM IR (-O2):
define i64 @deci_kelvin_to_celsius(i64 %0) {
%2 = mul nsw i64 %0, 100
%3 = tail call i64 @milli_kelvin_to_millicelsius(i64 %2)
%4 = tail call i64 @DIV_ROUND_CLOSEST(i64 %3, i32 1000)
ret i64 %4
}
int isRightPrecedence(char opt) {
  if (opt == '^')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isRightPrecedence>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5e,%eax
jne    1123 <isRightPrecedence+0x23>
movl   $0x1,-0x4(%rbp)
jmp    112a <isRightPrecedence+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isRightPrecedence(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 94
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @isRightPrecedence(i8 signext %0) {
%2 = icmp eq i8 %0, 94
%3 = zext i1 %2 to i32
ret i32 %3
}
void free_rand() {}


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

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

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

LLVM IR (-O2):
define void @free_rand() {
ret void
}
int func3(int x) {
  int i = 0;
  i += x;
  return i;
}


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

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

LLVM IR (-O0):
define i32 @func3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %5, %4
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @func3(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ pr_crit(char *, char const *);
void mark_hardware_unsupported(const char *msg) {
  pr_crit("Warning: %s - this hardware has not undergone upstream testing. "
          "Please consult http://wiki.centos.org/FAQ for more information\n",
          msg);
}


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

x86 assembly (clang, -O2):
<mark_hardware_unsupported>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <pr_crit@plt>

LLVM IR (-O0):
@.str = [128 x i8] c"Warning: %s - this hardware has not undergone upstream testing. Please consult http://wiki.centos.org/FAQ for more information\0A\00"
define void @mark_hardware_unsupported(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pr_crit(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [128 x i8] c"Warning: %s - this hardware has not undergone upstream testing. Please consult http://wiki.centos.org/FAQ for more information\0A\00"
define void @mark_hardware_unsupported(i8* %0) {
%2 = tail call i32 @pr_crit(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int Com_Clampi(int, int, int);
int Com_AbsClampi(int min, int max, int value) {
  if (value < 0) {
    return Com_Clampi(-max, -min, value);
  } else {
    return Com_Clampi(min, max, value);
  }
}


x86 assembly (clang, -O0):
<Com_AbsClampi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1145 <Com_AbsClampi+0x35>
xor    %edi,%edi
sub    -0xc(%rbp),%edi
xor    %esi,%esi
sub    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <Com_Clampi@plt>
mov    %eax,-0x4(%rbp)
jmp    1156 <Com_AbsClampi+0x46>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <Com_Clampi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_AbsClampi>:
mov    %edi,%eax
test   %edx,%edx
js     111d <Com_AbsClampi+0xd>
mov    %eax,%edi
jmp    1030 <Com_Clampi@plt>
neg    %esi
neg    %eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <Com_Clampi@plt>

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

LLVM IR (-O2):
define i32 @Com_AbsClampi(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = sub nsw i32 0, %1
%7 = sub nsw i32 0, %0
%8 = tail call i32 @Com_Clampi(i32 %6, i32 %7, i32 %2)
br label %11
9: ; preds = %3
%10 = tail call i32 @Com_Clampi(i32 %0, i32 %1, i32 %2)
br label %11
11: ; preds = %9, %5
%12 = phi i32 [ %8, %5 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fatal(char *mess) {
  fprintf(stderr, "Error: %s\n", mess);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int compare(const void *a, const void *b) {
  const double a0 = *(const double *)a;
  const double b0 = *(const double *)b;
  return (a0 > b0) - (a0 < b0);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
%9 = load double, double* %8
store double %9, double* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to double*
%12 = load double, double* %11
store double %12, double* %6
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fcmp ogt double %13, %14
%16 = zext i1 %15 to i32
%17 = load double, double* %5
%18 = load double, double* %6
%19 = fcmp olt double %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = zext i1 %7 to i32
%9 = fcmp olt double %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
char *first_doc_line(char *line) {
  if (line[1] != '\0' && line[1] != '\n')
    return line + 2;
  else
    return line + 1;
}


x86 assembly (clang, -O0):
<first_doc_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     113b <first_doc_line+0x3b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0xa,%eax
je     113b <first_doc_line+0x3b>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <first_doc_line+0x47>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_doc_line>:
lea    0x1(%rdi),%rax
mov    0x1(%rdi),%cl
test   %cl,%cl
je     1110 <first_doc_line+0x10>
cmp    $0xa,%cl
jne    1111 <first_doc_line+0x11>
ret
add    $0x2,%rdi
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @first_doc_line(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
switch i8 %3, label %4 [
i8 0, label %6
i8 10, label %6
]
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 2
br label %6
6: ; preds = %1, %1, %4
%7 = phi i8* [ %5, %4 ], [ %2, %1 ], [ %2, %1 ]
ret i8* %7
}
/* Variables and functions */
long TR_euklidGcd(long, long);
long TR_lcm(register long val1, register long val2) {
  return val1 * val2 / TR_euklidGcd(val1, val2);
}


x86 assembly (clang, -O0):
<TR_lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <TR_euklidGcd@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cqto
idiv   %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TR_lcm>:
push   %rbx
mov    %rsi,%rbx
imul   %rdi,%rbx
call   1030 <TR_euklidGcd@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     1133 <TR_lcm+0x23>
mov    %rbx,%rax
cqto
idiv   %rcx
pop    %rbx
ret
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i64 @TR_lcm(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul nsw i64 %5, %6
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i64 @TR_euklidGcd(i64 %8, i64 %9)
%11 = sdiv i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @TR_lcm(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
%4 = tail call i64 @TR_euklidGcd(i64 %0, i64 %1)
%5 = sdiv i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ ffxmsg(int, char *);
void ffcmrk(void) {
  char *dummy = 0;
  ffxmsg(2, dummy);
  return;
}


x86 assembly (clang, -O0):
<ffcmrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x2,%edi
call   1030 <ffxmsg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffcmrk>:
mov    $0x2,%edi
xor    %esi,%esi
jmp    1030 <ffxmsg@plt>

LLVM IR (-O0):
define void @ffcmrk() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @ffxmsg(i32 2, i8* %2)
ret void
}

LLVM IR (-O2):
define void @ffcmrk() {
%1 = tail call i32 @ffxmsg(i32 2, i8* null)
ret void
}
void ABGRToUVRow_SSSE3() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ mysql_close(int /*<<< orphan*/ *);
int /*<<< orphan*/ *mysql_init(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  MYSQL *mysql_dbh;
  mysql_dbh = mysql_init(0);
  mysql_close(mysql_dbh);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <mysql_init@plt>
mov    %rax,%rdi
call   1030 <mysql_close@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @mysql_init(i32 0)
%4 = tail call i32 @mysql_close(i32* %3)
ret i32 0
}
char *lib_strcat(char *dest, const char *src) {
  char *ptr = dest;
  while (*ptr)
    ptr++;
  while (*src)
    *ptr++ = *src++;
  *ptr = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<lib_strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <lib_strcat+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <lib_strcat+0x14>
jmp    1137 <lib_strcat+0x37>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <lib_strcat+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1137 <lib_strcat+0x37>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib_strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
mov    %rcx,%rdi
add    $0x1,%rcx
cmpb   $0x0,(%rdi)
jne    1110 <lib_strcat+0x10>
mov    (%rsi),%dl
test   %dl,%dl
je     1146 <lib_strcat+0x46>
mov    $0xffffffffffffffff,%rdi
nopl   0x0(%rax)
mov    %dl,(%rcx,%rdi,1)
movzbl 0x2(%rsi,%rdi,1),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1130 <lib_strcat+0x30>
add    %rdi,%rcx
mov    %rcx,%rdi
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @lib_strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %16, %11 ], [ %4, %8 ]
%14 = phi i8* [ %15, %11 ], [ %1, %8 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %13
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %4, %8 ], [ %16, %11 ]
store i8 0, i8* %20
ret i8* %0
}
int main(void) {
  extern char __executable_start;
  return __executable_start;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ece(%rip),%rax
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
movsbl (%rax),%eax
ret

LLVM IR (-O0):
@__executable_start = external global i8
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i8, i8* @__executable_start
%3 = sext i8 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
@__executable_start = external global i8
define i32 @main() {
%1 = load i8, i8* @__executable_start
%2 = sext i8 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
long _lseek(int fd, long offset, int whence) {
  fprintf(stderr, "lseek not implemented\n");
  return -1;
}


x86 assembly (clang, -O0):
<_lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffffffffffff,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lseek>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"lseek not implemented\0A\00"
define i64 @_lseek(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i64 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"lseek not implemented\0A\00"
define i64 @_lseek(i32 %0, i64 %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i64 -1
}
/* Variables and functions */
int /*<<< orphan*/ unload_all();
void op_unload() { unload_all(); }


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

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

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

LLVM IR (-O2):
define void @op_unload() {
%1 = tail call i32 (...) @unload_all()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void safefree(void *ptr) {
  free(ptr);
  return;
}


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

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

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

LLVM IR (-O2):
define void @safefree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int /*<<< orphan*/ h_line(char, char, int);
void h_lines(char v_edge, char h_edge, int lspace, int n) {
  for (int8_t i = 0; i < n; ++i)
    h_line(v_edge, h_edge, lspace);
}


x86 assembly (clang, -O0):
<h_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <h_lines+0x50>
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
mov    -0x8(%rbp),%edx
movsbl %cl,%edi
movsbl %al,%esi
call   1030 <h_line@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <h_lines+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_lines>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %ecx,%ecx
jle    1142 <h_lines+0x32>
mov    %ecx,%ebx
mov    %edx,%r14d
movsbl %dil,%r15d
movsbl %sil,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r15d,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <h_line@plt>
add    $0xffffffff,%ebx
jne    1130 <h_lines+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @h_lines(i8 signext %0, i8 signext %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %7, label %6
6: ; preds = %7, %4
ret void
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ 0, %4 ]
%9 = tail call i32 @h_line(i8 signext %0, i8 signext %1, i32 %2)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %3
br i1 %11, label %6, label %7
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, char *);
int userInputNumber(char *prompt, int min, int max) {
  printf("%s", prompt);
  int input = getchar();
  int inputNumber = 0;
  return inputNumber;
}


x86 assembly (clang, -O0):
<userInputNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @userInputNumber(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 (...) @getchar()
ret i32 0
}