xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SHA512(unsigned char const *, size_t, unsigned char *);
void crypto_hash_sha512(unsigned char *output, const unsigned char *input,
                        size_t len) {
  SHA512(input, len, output);
}


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

x86 assembly (clang, -O2):
<crypto_hash_sha512>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <SHA512@plt>

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

LLVM IR (-O2):
define void @crypto_hash_sha512(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @SHA512(i8* %1, i64 %2, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_WriteData(int);
void createDisruption_One() {
  LCD_WriteData(0x0);
  LCD_WriteData(0xc);
  LCD_WriteData(0xc);
  LCD_WriteData(0x0);
  LCD_WriteData(0x0);
  LCD_WriteData(0x6);
  LCD_WriteData(0x6);
  LCD_WriteData(0x0);
}


x86 assembly (clang, -O0):
<createDisruption_One>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xc,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xc,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x6,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x6,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<createDisruption_One>:
push   %rax
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xc,%edi
call   1030 <LCD_WriteData@plt>
mov    $0xc,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x6,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x6,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <LCD_WriteData@plt>

LLVM IR (-O0):
define void @createDisruption_One() {
%1 = call i32 @LCD_WriteData(i32 0)
%2 = call i32 @LCD_WriteData(i32 12)
%3 = call i32 @LCD_WriteData(i32 12)
%4 = call i32 @LCD_WriteData(i32 0)
%5 = call i32 @LCD_WriteData(i32 0)
%6 = call i32 @LCD_WriteData(i32 6)
%7 = call i32 @LCD_WriteData(i32 6)
%8 = call i32 @LCD_WriteData(i32 0)
ret void
}

LLVM IR (-O2):
define void @createDisruption_One() {
%1 = tail call i32 @LCD_WriteData(i32 0)
%2 = tail call i32 @LCD_WriteData(i32 12)
%3 = tail call i32 @LCD_WriteData(i32 12)
%4 = tail call i32 @LCD_WriteData(i32 0)
%5 = tail call i32 @LCD_WriteData(i32 0)
%6 = tail call i32 @LCD_WriteData(i32 6)
%7 = tail call i32 @LCD_WriteData(i32 6)
%8 = tail call i32 @LCD_WriteData(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_ocaml_comments() {
  test_parser_verify_parse(test_parser_sourcefile("ocaml", " (* comment *)"),
                           "ocaml", "", "(* comment *)", 0);
}


x86 assembly (clang, -O0):
<test_ocaml_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xecd(%rip),%rdx
lea    0xeb9(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ocaml_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xed6(%rip),%rdx
lea    0xec2(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ocaml\00"
@.str.1 = [15 x i8] c" (* comment *)\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [14 x i8] c"(* comment *)\00"
define void @test_ocaml_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ocaml\00"
@.str.1 = [15 x i8] c" (* comment *)\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [14 x i8] c"(* comment *)\00"
define void @test_ocaml_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
void ff_hevc_put_hevc_bi_w_epel_v16_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_v16_12_sse4() {
ret void
}
/* Variables and functions */
int errno;
long getpriority(int, int);
int Seccomp_isWorking(void) {
  errno = 0;
  long ret = getpriority(1000, 1);
  int err = errno;
  return (ret == -1 && err == 3333) || (ret == -3333 && err == 0);
}


x86 assembly (clang, -O0):
<Seccomp_isWorking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
movl   $0x0,(%rax)
mov    $0x3e8,%edi
mov    $0x1,%esi
call   1030 <getpriority@plt>
mov    %rax,-0x8(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpq   $0xffffffffffffffff,-0x8(%rbp)
jne    1161 <Seccomp_isWorking+0x51>
mov    $0x1,%al
cmpl   $0xd05,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1184 <Seccomp_isWorking+0x74>
xor    %eax,%eax
cmpq   $0xfffffffffffff2fb,-0x8(%rbp)
ff
mov    %al,-0xe(%rbp)
jne    117e <Seccomp_isWorking+0x6e>
cmpl   $0x0,-0xc(%rbp)
sete   %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Seccomp_isWorking>:
push   %rbx
mov    0x2ec8(%rip),%rbx
movl   $0x0,(%rbx)
mov    $0x3e8,%edi
mov    $0x1,%esi
call   1030 <getpriority@plt>
mov    (%rbx),%ecx
cmp    $0xffffffffffffffff,%rax
sete   %dl
cmp    $0xd05,%ecx
sete   %bl
and    %dl,%bl
cmp    $0xfffffffffffff2fb,%rax
sete   %al
test   %ecx,%ecx
sete   %cl
and    %al,%cl
or     %bl,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @Seccomp_isWorking() {
%1 = alloca i64
%2 = alloca i32
store i32 0, i32* @errno
%3 = call i64 @getpriority(i32 1000, i32 1)
store i64 %3, i64* %1
%4 = load i32, i32* @errno
store i32 %4, i32* %2
%5 = load i64, i64* %1
%6 = icmp eq i64 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 3333
br i1 %9, label %18, label %10
10: ; preds = %7, %0
%11 = load i64, i64* %1
%12 = icmp eq i64 %11, -3333
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 0
br label %16
16: ; preds = %13, %10
%17 = phi i1 [ false, %10 ], [ %15, %13 ]
br label %18
18: ; preds = %16, %7
%19 = phi i1 [ true, %7 ], [ %17, %16 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @Seccomp_isWorking() {
store i32 0, i32* @errno
%1 = tail call i64 @getpriority(i32 1000, i32 1)
%2 = load i32, i32* @errno
%3 = icmp eq i64 %1, -1
%4 = icmp eq i32 %2, 3333
%5 = select i1 %3, i1 %4, i1 false
%6 = icmp eq i64 %1, -3333
%7 = icmp eq i32 %2, 0
%8 = select i1 %6, i1 %7, i1 false
%9 = select i1 %5, i1 true, i1 %8
%10 = zext i1 %9 to i32
ret i32 %10
}
int pl_on_flush(const int label, void *handle, struct writebuffer_st **wb_ref) {
  return 0;
}


x86 assembly (clang, -O0):
<pl_on_flush>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.writebuffer_st = type opaque
define i32 @pl_on_flush(i32 %0, i8* %1, %struct.writebuffer_st** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.writebuffer_st**
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.writebuffer_st** %2, %struct.writebuffer_st*** %6
ret i32 0
}

LLVM IR (-O2):
%struct.writebuffer_st = type opaque
define i32 @pl_on_flush(i32 %0, i8* nocapture readnone %1, %struct.writebuffer_st** nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int desejaEditar(char *field, char *value) {
  printf("%s: %s - Deseja editar?(s/n):", field, value);
  char choice = 'n';
  scanf(" %c", &choice);
  return choice == 's' ? 1 : 0;
}


x86 assembly (clang, -O0):
<desejaEditar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
movb   $0x6e,-0x11(%rbp)
lea    0xecf(%rip),%rdi
lea    -0x11(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x11(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x73,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<desejaEditar>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
movb   $0x6e,0x7(%rsp)
lea    0xedf(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
cmpb   $0x73,0x7(%rsp)
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"%s: %s - Deseja editar?(s/n):\00"
@.str.1 = [4 x i8] c" %c\00"
define i32 @desejaEditar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
store i8 110, i8* %5
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 115
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
ret i32 %14
}

LLVM IR (-O2):
@.str = [30 x i8] c"%s: %s - Deseja editar?(s/n):\00"
@.str.1 = [4 x i8] c" %c\00"
define i32 @desejaEditar(i8* %0, i8* %1) {
%3 = alloca i8
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
store i8 110, i8* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 115
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo1(void) { printf("foo1\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"foo1\00"
define void @foo1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int pthread_sigmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                    int /*<<< orphan*/ *);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int m_signal_block(int sig) {
  sigset_t sig_mask;
  sigemptyset(&sig_mask);
  sigaddset(&sig_mask, sig);
  return (pthread_sigmask(SIG_BLOCK, &sig_mask, NULL));
}


x86 assembly (clang, -O0):
<m_signal_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <sigemptyset@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <pthread_sigmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_signal_block>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <pthread_sigmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define i32 @m_signal_block(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @sigemptyset(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @sigaddset(i32* %3, i32 %5)
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @pthread_sigmask(i32 %7, i32* %3, i32* null)
ret i32 %8
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define i32 @m_signal_block(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigemptyset(i32* %2)
%5 = call i32 @sigaddset(i32* %2, i32 %0)
%6 = load i32, i32* @SIG_BLOCK
%7 = call i32 @pthread_sigmask(i32 %6, i32* %2, i32* null)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EEPROM_Real_Enable();
void EEPROM_Real_Start(void) { EEPROM_Real_Enable(); }


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

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

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

LLVM IR (-O2):
define void @EEPROM_Real_Start() {
%1 = tail call i32 (...) @EEPROM_Real_Enable()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void decrypt(uint8_t *plaintext, const uint8_t *ciphertext, size_t length) {}


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

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

LLVM IR (-O0):
define void @decrypt(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @decrypt(i32* nocapture %0, i32* nocapture %1, i64 %2) {
ret void
}
void outl(unsigned short port, unsigned long data) {
  asm volatile("outl %%eax, %%dx" ::"d"(port), "a"(data));
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rax
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl>:
mov    %rsi,%rax
mov    %edi,%edx
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @outl(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @outl(i16 zeroext %0, i64 %1) {
tail call void asm sideeffect "outl %eax, %dx", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i64 %1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int icmp_uint64_t(uint64_t a, uint64_t b) {
  if (a > b)
    return 1;
  else if (a < b)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<icmp_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1126 <icmp_uint64_t+0x26>
movl   $0x1,-0x4(%rbp)
jmp    1147 <icmp_uint64_t+0x47>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1140 <icmp_uint64_t+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <icmp_uint64_t+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icmp_uint64_t>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setl   %cl
neg    %ecx
cmp    %rsi,%rdi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @icmp_uint64_t(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp sgt i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %16
10: ; preds = %2
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = icmp slt i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 -1, i32* %3
br label %16
15: ; preds = %10
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @icmp_uint64_t(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = icmp slt i64 %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
double trifn(double d) {
  if (d < 0.25)
    return d * 4.0;
  if (d < 0.75)
    return 2.0 - 4.0 * d;
  return 4.0 * (d - 1.0);
}


x86 assembly (clang, -O0):
<trifn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1133 <trifn+0x33>
movsd  0xeec(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118f <trifn+0x8f>
movsd  0xecd(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    116d <trifn+0x6d>
movsd  -0x10(%rbp),%xmm0
movsd  0xecd(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118f <trifn+0x8f>
movsd  -0x10(%rbp),%xmm1
movsd  0xe9e(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe8a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<trifn>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1135 <trifn+0x35>
movsd  0xef2(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    112d <trifn+0x2d>
mulsd  0xefc(%rip),%xmm0
addsd  0xefc(%rip),%xmm0
ret
addsd  0xedb(%rip),%xmm0
mulsd  0xedb(%rip),%xmm0
ret

LLVM IR (-O0):
define double @trifn(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 2.500000e-01
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fmul double %7, 4.000000e+00
store double %8, double* %2
br label %19
9: ; preds = %1
%10 = load double, double* %3
%11 = fcmp olt double %10, 7.500000e-01
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load double, double* %3
%14 = call double @llvm.fmuladd.f64(double -4.000000e+00, double %13, double 2.000000e+00)
store double %14, double* %2
br label %19
15: ; preds = %9
%16 = load double, double* %3
%17 = fsub double %16, 1.000000e+00
%18 = fmul double 4.000000e+00, %17
store double %18, double* %2
br label %19
19: ; preds = %15, %12, %6
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
define double @trifn(double %0) {
%2 = fcmp olt double %0, 2.500000e-01
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fmul double %0, 4.000000e+00
br label %12
5: ; preds = %1
%6 = fcmp olt double %0, 7.500000e-01
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call double @llvm.fmuladd.f64(double %0, double -4.000000e+00, double 2.000000e+00)
br label %12
9: ; preds = %5
%10 = fadd double %0, -1.000000e+00
%11 = fmul double %10, 4.000000e+00
br label %12
12: ; preds = %9, %7, %3
%13 = phi double [ %4, %3 ], [ %8, %7 ], [ %11, %9 ]
ret double %13
}
/* Variables and functions */
char *longestPalindrome(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("%s\n", longestPalindrome(argv[1]));
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i8* @longestPalindrome(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ min_base(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  while (1) {
    int n;
    scanf("%d", &n);
    if (!n)
      break;
    min_base(n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    114e <main+0x2e>
jmp    115b <main+0x3b>
mov    -0x8(%rbp),%edi
call   1030 <min_base@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
je     1168 <main+0x48>
lea    0xebc(%rip),%r14
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
call   1030 <min_base@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = call i32 @min_base(i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ advance();
scalar_t__ match(int);
int /*<<< orphan*/ statements();
opt_statement() {
  statements();
  while (match(1)) {
    advance();
    statements();
  }
}


x86 assembly (clang, -O0):
<opt_statement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <statements@plt>
mov    $0x1,%edi
call   1050 <match@plt>
cmp    $0x0,%rax
je     1166 <opt_statement+0x36>
mov    $0x0,%al
call   1040 <advance@plt>
mov    $0x0,%al
call   1030 <statements@plt>
jmp    113f <opt_statement+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_statement>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <statements@plt>
mov    $0x1,%edi
call   1050 <match@plt>
test   %rax,%rax
je     115f <opt_statement+0x2f>
xor    %eax,%eax
call   1040 <advance@plt>
jmp    1140 <opt_statement+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @opt_statement() {
%1 = tail call i32 (...) @statements()
%2 = tail call i64 @match(i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @advance()
%6 = tail call i32 (...) @statements()
%7 = tail call i64 @match(i32 1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ DCDC_DriverIRQHandler();
__attribute__((weak)) void DCDC_IRQHandler(void) { DCDC_DriverIRQHandler(); }


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

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

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

LLVM IR (-O2):
define weak void @DCDC_IRQHandler() {
%1 = tail call i32 (...) @DCDC_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ omap_do_wfi();
int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state) {
  omap_do_wfi();
  return 0;
}


x86 assembly (clang, -O0):
<omap4_enter_lowpower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <omap_do_wfi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @omap4_enter_lowpower(i32 %0, i32 %1) {
%3 = tail call i32 (...) @omap_do_wfi()
ret i32 0
}
/* Variables and functions */
int errno;
int listen(int, int);
int os_listen(int s, int backlog) {
  int retval;
  retval = listen(s, backlog);
  if (retval == -1)
    retval = -errno;
  return retval;
}


x86 assembly (clang, -O0):
<os_listen>:
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 <listen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1144 <os_listen+0x34>
xor    %eax,%eax
mov    0x2ea1(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_listen>:
push   %rax
call   1030 <listen@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
cmp    $0xffffffff,%eax
cmove  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @os_listen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @listen(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = sub nsw i32 0, %12
store i32 %13, i32* %5
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @os_listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
%5 = load i32, i32* @errno
%6 = sub nsw i32 0, %5
%7 = select i1 %4, i32 %6, i32 %3
ret i32 %7
}
/* Variables and functions */
int write(int, void const *, size_t);
int posix_write(int fd, const void *buf, size_t n) { return write(fd, buf, n); }


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

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

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

LLVM IR (-O2):
define i32 @posix_write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
int clrTTyMode(void *sg, const char *mode) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @clrTTyMode(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ bswap64(int /*<<< orphan*/);
int64_t minipack_unpack_int64(void *ptr, size_t *sz) {
  *sz = 9;
  return (uint64_t)bswap64(*((int64_t *)(ptr + 1)));
}


x86 assembly (clang, -O0):
<minipack_unpack_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x9,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%edi
call   1030 <bswap64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_int64>:
movq   $0x9,(%rsi)
mov    0x1(%rdi),%edi
jmp    1030 <bswap64@plt>

LLVM IR (-O0):
define i32 @minipack_unpack_int64(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
store i64 9, i64* %5
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 1
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = call i32 @bswap64(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @minipack_unpack_int64(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 9, i64* %1
%3 = getelementptr i8, i8* %0, i64 1
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @bswap64(i32 %5)
ret i32 %6
}
int DUMMY_Initialize(int x, int y, char *c) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @DUMMY_Initialize(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void test_void(char *s) { printf("%s", s); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @test_void(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execle(char *, char *, int /*<<< orphan*/, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[], char *envp[]) {
  (void)execle("/home/jsmith/tanya/lab2", "/home/jsmith/tanya/lab2", 0, envp);
  printf("Error!!!!!");
  exit(-1);
}


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)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
lea    0xeab(%rip),%rsi
xor    %edx,%edx
mov    %rsi,%rdi
call   1050 <execle@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rdx,%rcx
lea    0xec5(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1050 <execle@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"/home/jsmith/tanya/lab2\00"
@.str.1 = [11 x i8] c"Error!!!!!\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i8**, i8*** %7
%9 = call i32 @execle(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 0, i8** %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"/home/jsmith/tanya/lab2\00"
@.str.1 = [11 x i8] c"Error!!!!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** %2) {
%4 = tail call i32 @execle(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 0, i8** %2)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
scalar_t__ isValidPort(int /*<<< orphan*/);
int isValidArguments(int argc, char **argv) {
  return (argc == 2 && isValidPort(atoi(argv[1])));
}


x86 assembly (clang, -O0):
<isValidArguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jne    115c <isValidArguments+0x3c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <isValidPort@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidArguments>:
xor    %eax,%eax
cmp    $0x2,%edi
jne    1147 <isValidArguments+0x27>
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <isValidPort@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @isValidArguments(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 eq i32 %5, 2
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
%12 = call i64 @isValidPort(i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %7, %2
%15 = phi i1 [ false, %2 ], [ %13, %7 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isValidArguments(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = tail call i64 @isValidPort(i32 %7)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %2
%12 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %12
}
/* Type definitions */
struct generator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ w(struct generator *, char *);
void generate_create_and_close_templates(struct generator *g) {
  w(g, "~N"
       "extern struct SN_env * ~pcreate_env(void);~N"
       "extern void ~pclose_env(struct SN_env * z);~N"
       "~N");
}


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

x86 assembly (clang, -O2):
<generate_create_and_close_templates>:
lea    0xee9(%rip),%rsi
jmp    1030 <w@plt>

LLVM IR (-O0):
%struct.generator = type { i32 }
@.str = [94 x i8] c"~Nextern struct SN_env * ~pcreate_env(void);~Nextern void ~pclose_env(struct SN_env * z);~N~N\00"
define void @generate_create_and_close_templates(%struct.generator* %0) {
%2 = alloca %struct.generator*
store %struct.generator* %0, %struct.generator** %2
%3 = load %struct.generator*, %struct.generator** %2
%4 = call i32 @w(%struct.generator* %3, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.generator = type { i32 }
@.str = [94 x i8] c"~Nextern struct SN_env * ~pcreate_env(void);~Nextern void ~pclose_env(struct SN_env * z);~N~N\00"
define void @generate_create_and_close_templates(%struct.generator* %0) {
%2 = tail call i32 @w(%struct.generator* %0, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int noscramble(int);
int echo(int a) { return noscramble(a); }


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

x86 assembly (clang, -O2):
<echo>:
jmp    1030 <noscramble@plt>

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

LLVM IR (-O2):
define i32 @echo(i32 %0) {
%2 = tail call i32 @noscramble(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, char const *);
void predicate_fail(int label, const char *test) {
  printf("<li style='color:red'>Predicate failed (%d): %s</li>\n", label, test);
  static int num;
  if (++num >= 20)
    exit(0);
}


x86 assembly (clang, -O0):
<predicate_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eec(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ee3(%rip)
cmp    $0x14,%eax
jl     1161 <predicate_fail+0x41>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<predicate_fail>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2efc(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2ef3(%rip)
cmp    $0x13,%eax
jge    1148 <predicate_fail+0x28>
pop    %rax
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"<li style='color:red'>Predicate failed (%d): %s</li>\0A\00"
@predicate_fail.num = internal global i32 0
define void @predicate_fail(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
%8 = load i32, i32* @predicate_fail.num
%9 = add nsw i32 %8, 1
store i32 %9, i32* @predicate_fail.num
%10 = icmp sge i32 %9, 20
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"<li style='color:red'>Predicate failed (%d): %s</li>\0A\00"
@predicate_fail.num = internal unnamed_addr global i32 0
define void @predicate_fail(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%4 = load i32, i32* @predicate_fail.num
%5 = add nsw i32 %4, 1
store i32 %5, i32* @predicate_fail.num
%6 = icmp sgt i32 %4, 18
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun(int, int);
int main(void) {
  fun(0xb9f3dcdcUL, 0xfbdc740b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xb9f3dcdc,%edi
mov    $0xfbdc740b,%esi
call   1030 <fun@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xb9f3dcdc,%edi
mov    $0xfbdc740b,%esi
call   1030 <fun@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fun(i32 -1175200548, i32 -69438453)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fun(i32 -1175200548, i32 -69438453)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void sys_put_le16(uint16_t val, uint8_t dst[2]) {
  dst[0] = val;
  dst[1] = val >> 8;
}


x86 assembly (clang, -O0):
<sys_put_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_put_le16>:
mov    %edi,(%rsi)
sar    $0x8,%edi
mov    %edi,0x4(%rsi)
ret

LLVM IR (-O0):
define void @sys_put_le16(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 = getelementptr inbounds i32, i32* %6, i64 0
store i32 %5, i32* %7
%8 = load i32, i32* %3
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @sys_put_le16(i32 %0, i32* nocapture writeonly %1) {
store i32 %0, i32* %1
%3 = ashr i32 %0, 8
%4 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *check_realloc(void *ptr, size_t len) {
  ptr = (char *)realloc(ptr, len);
  if (ptr == NULL) {
    fprintf(stderr, "*****  memory reallocation error\n");
    exit(-1);
  }
  return (ptr);
}


x86 assembly (clang, -O0):
<check_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117b <check_realloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"***** memory reallocation error\0A\00"
define i8* @check_realloc(i8* %0, i64 %1) {
%3 = tail call i64 @realloc(i8* %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
%10 = inttoptr i64 %3 to i8*
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Shit it's risky\a\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Shit it's risky\07\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"Shit it's risky\07\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_remainder();
scalar_t__ remainder(double, double);
void test_remainder(double d1, double d2) {
  if (remainder(d1, d2) != remainder(d1, d2))
    link_failure_remainder();
}


x86 assembly (clang, -O0):
<test_remainder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <remainder@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <remainder@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_remainder+0x4b>
mov    $0x0,%al
call   1030 <link_failure_remainder@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_remainder>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1040 <remainder@plt>
mov    %rax,%rbx
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <remainder@plt>
cmp    %rax,%rbx
jne    1153 <test_remainder+0x33>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_remainder@plt>

LLVM IR (-O0):
define void @test_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 i64 @remainder(double %5, double %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i64 @remainder(double %8, double %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_remainder()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_remainder(double %0, double %1) {
%3 = tail call i64 @remainder(double %0, double %1)
%4 = tail call i64 @remainder(double %0, double %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_remainder()
br label %8
8: ; preds = %6, %2
ret void
}