xunge/DecIR huggingface dataset:
void init_libgcrypt() {}


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

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

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

LLVM IR (-O2):
define void @init_libgcrypt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_color(int);
void load_palette(int palette[], size_t n) {
  size_t i;
  for (i = 0; i < n; i++) {
    add_color(palette[i]);
  }
}


x86 assembly (clang, -O0):
<load_palette>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1157 <load_palette+0x47>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <add_color@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <load_palette+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_palette>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1142 <load_palette+0x32>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%edi
call   1030 <add_color@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <load_palette+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @load_palette(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @add_color(i32 %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @load_palette(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @add_color(i32 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pop();
int /*<<< orphan*/ storep_dst();
void mtpi() {
  pop();
  storep_dst();
}


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

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

LLVM IR (-O0):
define void @mtpi() {
%1 = call i32 (...) @pop()
%2 = call i32 (...) @storep_dst()
ret void
}

LLVM IR (-O2):
define void @mtpi() {
%1 = tail call i32 (...) @pop()
%2 = tail call i32 (...) @storep_dst()
ret void
}
int test_imm_62uint16_mem(unsigned short *val) {
  return ((*val) & (-0x62 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_62uint16_mem>:
movzwl (%rdi),%eax
test   $0xff9e,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_62uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -98
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *m_strn(int, int);
char *m_name(int num) {
  if (num <= 0)
    return "?";
  return m_strn(num, (sizeof "INT_MAX"));
}


x86 assembly (clang, -O0):
<m_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1135 <m_name+0x25>
lea    0xed4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <m_name+0x36>
mov    -0xc(%rbp),%edi
mov    $0x8,%esi
call   1030 <m_strn@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_name>:
test   %edi,%edi
jle    111e <m_name+0xe>
mov    $0x8,%esi
jmp    1030 <m_strn@plt>
lea    0xedb(%rip),%rax
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
define i8* @m_name(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @m_strn(i32 %0, i32 8)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isAND(const char *comm) { return strcmp(comm, "and") == 0; }


x86 assembly (clang, -O0):
<isAND>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAND>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"and\00"
define i32 @isAND(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"and\00"
define i32 @isAND(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
__attribute__((fentry_name("bar"))) int func2(int a) { return a + 1; }


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

x86 assembly (clang, -O2):
<func2>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @func2(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gc_global_lock(int);
int /*<<< orphan*/ gc_major();
extern void hl_gc_major() {
  gc_global_lock(1);
  gc_major();
  gc_global_lock(0);
}


x86 assembly (clang, -O0):
<hl_gc_major>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <gc_global_lock@plt>
mov    $0x0,%al
call   1040 <gc_major@plt>
xor    %edi,%edi
call   1030 <gc_global_lock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hl_gc_major>:
push   %rax
mov    $0x1,%edi
call   1030 <gc_global_lock@plt>
xor    %eax,%eax
call   1040 <gc_major@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <gc_global_lock@plt>

LLVM IR (-O0):
define void @hl_gc_major() {
%1 = call i32 @gc_global_lock(i32 1)
%2 = call i32 (...) @gc_major()
%3 = call i32 @gc_global_lock(i32 0)
ret void
}

LLVM IR (-O2):
define void @hl_gc_major() {
%1 = tail call i32 @gc_global_lock(i32 1)
%2 = tail call i32 (...) @gc_major()
%3 = tail call i32 @gc_global_lock(i32 0)
ret void
}
char *SubStrings_ASCII_UpperS(char *const S) {
  register char *Worker = S;
  for (; *Worker != '\0'; ++Worker) {
    if (*Worker >= 'a' && *Worker <= 'z') {
      *Worker -= ('a' - 'A');
    }
  }
  return S;
}


x86 assembly (clang, -O0):
<SubStrings_ASCII_UpperS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <SubStrings_ASCII_UpperS+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     114c <SubStrings_ASCII_UpperS+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     114c <SubStrings_ASCII_UpperS+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
jmp    1151 <SubStrings_ASCII_UpperS+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <SubStrings_ASCII_UpperS+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SubStrings_ASCII_UpperS>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <SubStrings_ASCII_UpperS+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <SubStrings_ASCII_UpperS+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <SubStrings_ASCII_UpperS+0x2c>
lea    -0x61(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <SubStrings_ASCII_UpperS+0x10>
add    $0xe0,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <SubStrings_ASCII_UpperS+0x10>
ret

LLVM IR (-O0):
define i8* @SubStrings_ASCII_UpperS(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %27, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %30
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
br label %26
26: ; preds = %20, %15, %10
br label %27
27: ; preds = %26
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %3
br label %5
30: ; preds = %5
%31 = load i8*, i8** %2
ret i8* %31
}

LLVM IR (-O2):
define i8* @SubStrings_ASCII_UpperS(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ assert(void const *);
unsigned int hash_intptr_hash(const void *to_int) {
  assert(to_int);
  return (unsigned int)*((int *)to_int);
}


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

x86 assembly (clang, -O2):
<hash_intptr_hash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hash_intptr_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @hash_intptr_hash(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
char *strcpy(char *restrict dest, const char *restrict src) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @strcpy(i8* noalias nocapture readnone %0, i8* noalias nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ execute_sendto();
int /*<<< orphan*/ server_recvfrom();
int /*<<< orphan*/ sleep(int);
int execute_recvfrom() {
  server_recvfrom();
  execute_sendto();
  sleep(3);
  return 0;
}


x86 assembly (clang, -O0):
<execute_recvfrom>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <server_recvfrom@plt>
mov    $0x0,%al
call   1030 <execute_sendto@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_recvfrom>:
push   %rax
xor    %eax,%eax
call   1050 <server_recvfrom@plt>
xor    %eax,%eax
call   1030 <execute_sendto@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @execute_recvfrom() {
%1 = call i32 (...) @server_recvfrom()
%2 = call i32 (...) @execute_sendto()
%3 = call i32 @sleep(i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_recvfrom() {
%1 = tail call i32 (...) @server_recvfrom()
%2 = tail call i32 (...) @execute_sendto()
%3 = tail call i32 @sleep(i32 3)
ret i32 0
}
/* Type definitions */
struct usb_function {
  int dummy;
};
struct usb_configuration {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ func_to_rudolf(struct usb_function *);
int /*<<< orphan*/ kfree(int /*<<< orphan*/);
void f_rudolf_unbind(struct usb_configuration *c, struct usb_function *f) {
  kfree(func_to_rudolf(f));
}


x86 assembly (clang, -O0):
<f_rudolf_unbind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <func_to_rudolf@plt>
mov    %eax,%edi
call   1040 <kfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_rudolf_unbind>:
push   %rax
mov    %rsi,%rdi
call   1030 <func_to_rudolf@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <kfree@plt>

LLVM IR (-O0):
%struct.usb_configuration = type { i32 }
%struct.usb_function = type { i32 }
define void @f_rudolf_unbind(%struct.usb_configuration* %0, %struct.usb_function* %1) {
%3 = alloca %struct.usb_configuration*
%4 = alloca %struct.usb_function*
store %struct.usb_configuration* %0, %struct.usb_configuration** %3
store %struct.usb_function* %1, %struct.usb_function** %4
%5 = load %struct.usb_function*, %struct.usb_function** %4
%6 = call i32 @func_to_rudolf(%struct.usb_function* %5)
%7 = call i32 @kfree(i32 %6)
ret void
}

LLVM IR (-O2):
%struct.usb_configuration = type { i32 }
%struct.usb_function = type { i32 }
define void @f_rudolf_unbind(%struct.usb_configuration* nocapture readnone %0, %struct.usb_function* %1) {
%3 = tail call i32 @func_to_rudolf(%struct.usb_function* %1)
%4 = tail call i32 @kfree(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ JK2SP_Unload(int);
void JK2SP_Shutdown(void) { JK2SP_Unload((0x01) | (0x02) | (0x04) | (0x08)); }


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

x86 assembly (clang, -O2):
<JK2SP_Shutdown>:
mov    $0xf,%edi
jmp    1030 <JK2SP_Unload@plt>

LLVM IR (-O0):
define void @JK2SP_Shutdown() {
%1 = call i32 @JK2SP_Unload(i32 15)
ret void
}

LLVM IR (-O2):
define void @JK2SP_Shutdown() {
%1 = tail call i32 @JK2SP_Unload(i32 15)
ret void
}
signed char f12(signed char a, unsigned char b) {
  short c;
  return __builtin_mul_overflow(a, b, &c);
}


x86 assembly (clang, -O0):
<f12>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
movsbl %cl,%ecx
movzbl %al,%eax
imul   %ax,%cx
seto   %al
mov    %cx,-0x4(%rbp)
and    $0x1,%al
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @f12(i8 signext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i16
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = load i8, i8* %4
%8 = sext i8 %6 to i16
%9 = zext i8 %7 to i16
%10 = call { i16, i1 } @llvm.smul.with.overflow.i16(i16 %8, i16 %9)
%11 = extractvalue { i16, i1 } %10, 1
%12 = extractvalue { i16, i1 } %10, 0
store i16 %12, i16* %5
%13 = zext i1 %11 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @f12(i8 signext %0, i8 zeroext %1) {
ret i8 0
}
/* Variables and functions */
size_t min(size_t one, size_t two) {
  if (one < two)
    return one;
  else
    return two;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1127 <min+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <min+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @min(i64 %0, i64 %1) {
%3 = alloca i64
%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 ult i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %4
store i64 %10, i64* %3
br label %13
11: ; preds = %2
%12 = load i64, i64* %5
store i64 %12, i64* %3
br label %13
13: ; preds = %11, %9
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *exec) { printf("Usage: %s <start> <iterations>\n", exec); }


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [32 x i8] c"Usage: %s <start> <iterations>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char const *const);
ssize_t check(ssize_t ret, const char *const msg) {
  if (ret == -1) {
    err(1, "%s", msg);
  }
  return ret;
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    113e <check+0x2e>
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
lea    0xec7(%rip),%rsi
call   1030 <err@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rbx
mov    %edi,%ebx
cmp    $0xffffffff,%edi
jne    112c <check+0x1c>
mov    %rsi,%rdx
lea    0xede(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @check(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, -1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @check(i32 returned %0, i8* %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %6
6: ; preds = %4, %2
ret i32 %0
}
void gtk_cell_view_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_view_get_type() {
ret void
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  static int x = 42;
  x = rand();
  return x;
}


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    $0x0,%al
call   1030 <rand@plt>
mov    %eax,0x2ef5(%rip)
mov    0x2eef(%rip),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@main.x = internal global i32 42
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 = call i32 (...) @rand()
store i32 %6, i32* @main.x
%7 = load i32, i32* @main.x
ret i32 %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_wday;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int WeekDay() {
  struct tm *timeptr;
  time_t secsnow;
  time(&secsnow);
  timeptr = localtime(&secsnow);
  return (timeptr->tm_wday);
}


x86 assembly (clang, -O0):
<WeekDay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WeekDay>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @WeekDay() {
%1 = alloca %struct.tm*
%2 = alloca i32
%3 = call i32 @time(i32* %2)
%4 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %4, %struct.tm** %1
%5 = load %struct.tm*, %struct.tm** %1
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @WeekDay() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ n8(int, int, int, int, int, int, int, int);
void call_f8() { n8(1, 2, 3, 4, 5, 6, 7, 8); }


x86 assembly (clang, -O0):
<call_f8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
movl   $0x8,0x8(%rsp)
call   1030 <n8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_f8>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0x8
push   $0x7
call   1030 <n8@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @call_f8() {
%1 = call i32 @n8(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8)
ret void
}

LLVM IR (-O2):
define void @call_f8() {
%1 = tail call i32 @n8(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8)
ret void
}
void pixie_raise_thread_priority() {}


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

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

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

LLVM IR (-O2):
define void @pixie_raise_thread_priority() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
scalar_t__ mp2vseqdx_get_color(int const *);
uint16_t mp2vseqdx_get_horizontal(const uint8_t *p_mp2vseqdx) {
  unsigned int base = mp2vseqdx_get_color(p_mp2vseqdx) ? 8 : 5;
  return (p_mp2vseqdx[base] << 6) | (p_mp2vseqdx[base + 1] >> 2);
}


x86 assembly (clang, -O0):
<mp2vseqdx_get_horizontal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mp2vseqdx_get_color@plt>
mov    %rax,%rdx
mov    $0x5,%eax
mov    $0x8,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
shl    $0x6,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
mov    %edx,%edx
mov    (%rcx,%rdx,4),%ecx
sar    $0x2,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqdx_get_horizontal>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mp2vseqdx_get_color@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    (%rcx,%rcx,2),%eax
add    $0x5,%eax
mov    (%rbx,%rax,4),%ecx
mov    0x4(%rbx,%rax,4),%eax
shl    $0x6,%ecx
sar    $0x2,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mp2vseqdx_get_horizontal(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i64 @mp2vseqdx_get_color(i32* %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 8, i32 5
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* %3
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = shl i32 %13, 6
%15 = load i32*, i32** %2
%16 = load i32, i32* %3
%17 = add i32 %16, 1
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %15, i64 %18
%20 = load i32, i32* %19
%21 = ashr i32 %20, 2
%22 = or i32 %14, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @mp2vseqdx_get_horizontal(i32* %0) {
%2 = tail call i64 @mp2vseqdx_get_color(i32* %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 5, i32 8
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = shl i32 %7, 6
%9 = add nuw nsw i32 %4, 1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = ashr i32 %12, 2
%14 = or i32 %13, %8
ret i32 %14
}
void goertzel_filter_v1(short int *delay, short int input,
                        short int coefficient) {
  long product;
  short int sum;
  product = ((long)delay[0] * coefficient) >> 14;
  sum = (short int)((input >> 7) + (short int)product - delay[1]);
  delay[1] = delay[0];
  delay[0] = sum;
}


x86 assembly (clang, -O0):
<goertzel_filter_v1>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movswq (%rax),%rax
movswq -0xc(%rbp),%rcx
imul   %rcx,%rax
sar    $0xe,%rax
mov    %rax,-0x18(%rbp)
movswl -0xa(%rbp),%eax
sar    $0x7,%eax
mov    -0x18(%rbp),%rcx
movswl %cx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movswl 0x2(%rcx),%ecx
sub    %ecx,%eax
mov    %ax,-0x1a(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cx
mov    -0x8(%rbp),%rax
mov    %cx,0x2(%rax)
mov    -0x1a(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<goertzel_filter_v1>:
movswl (%rdi),%eax
imul   %eax,%edx
shr    $0x7,%esi
sub    0x2(%rdi),%si
shr    $0xe,%edx
add    %edx,%esi
mov    %ax,0x2(%rdi)
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @goertzel_filter_v1(i16* %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16*
%5 = alloca i16
%6 = alloca i16
%7 = alloca i64
%8 = alloca i16
store i16* %0, i16** %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%9 = load i16*, i16** %4
%10 = getelementptr inbounds i16, i16* %9, i64 0
%11 = load i16, i16* %10
%12 = sext i16 %11 to i64
%13 = load i16, i16* %6
%14 = sext i16 %13 to i64
%15 = mul nsw i64 %12, %14
%16 = ashr i64 %15, 14
store i64 %16, i64* %7
%17 = load i16, i16* %5
%18 = sext i16 %17 to i32
%19 = ashr i32 %18, 7
%20 = load i64, i64* %7
%21 = trunc i64 %20 to i16
%22 = sext i16 %21 to i32
%23 = add nsw i32 %19, %22
%24 = load i16*, i16** %4
%25 = getelementptr inbounds i16, i16* %24, i64 1
%26 = load i16, i16* %25
%27 = sext i16 %26 to i32
%28 = sub nsw i32 %23, %27
%29 = trunc i32 %28 to i16
store i16 %29, i16* %8
%30 = load i16*, i16** %4
%31 = getelementptr inbounds i16, i16* %30, i64 0
%32 = load i16, i16* %31
%33 = load i16*, i16** %4
%34 = getelementptr inbounds i16, i16* %33, i64 1
store i16 %32, i16* %34
%35 = load i16, i16* %8
%36 = load i16*, i16** %4
%37 = getelementptr inbounds i16, i16* %36, i64 0
store i16 %35, i16* %37
ret void
}

LLVM IR (-O2):
define void @goertzel_filter_v1(i16* nocapture %0, i16 signext %1, i16 signext %2) {
%4 = load i16, i16* %0
%5 = sext i16 %4 to i32
%6 = sext i16 %2 to i32
%7 = mul nsw i32 %5, %6
%8 = ashr i16 %1, 7
%9 = lshr i32 %7, 14
%10 = getelementptr inbounds i16, i16* %0, i64 1
%11 = load i16, i16* %10
%12 = trunc i32 %9 to i16
%13 = sub i16 %8, %11
%14 = add i16 %13, %12
store i16 %4, i16* %10
store i16 %14, i16* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ swap32(int /*<<< orphan*/);
int32_t be32_to_cpu(int32_t x) { return (swap32(x)); }


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

x86 assembly (clang, -O2):
<be32_to_cpu>:
jmp    1030 <swap32@plt>

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

LLVM IR (-O2):
define i32 @be32_to_cpu(i32 %0) {
%2 = tail call i32 @swap32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void printLine(FILE **fp, int i) {
  if (1 == 1) {
    fprintf(*fp, "line:%d ", i);
  } else {
  }
}


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

x86 assembly (clang, -O2):
<printLine>:
mov    %esi,%edx
mov    (%rdi),%rdi
lea    0xee4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"line:%d \00"
define void @printLine(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** %5
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"line:%d \00"
define void @printLine(i32** nocapture %0, i32 %1) {
%3 = load i32*, i32** %0
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void UYVYToUVRow_C() {}


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

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

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

LLVM IR (-O2):
define void @UYVYToUVRow_C() {
ret void
}
int EAC_OBJ_sn2nid(const char *s) { return EAC_OBJ_sn2nid(s); }


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

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

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

LLVM IR (-O2):
define i32 @EAC_OBJ_sn2nid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, World!\n");
  printf("Welcome to COMP 1571.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
@.str.1 = [23 x i8] c"Welcome to COMP 1571.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
@str.2 = [22 x i8] c"Welcome to COMP 1571.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check_mul_double();
int /*<<< orphan*/ check_mul_float();
int /*<<< orphan*/ check_mul_long_double();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  check_mul_float();
  check_mul_double();
  check_mul_long_double();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <check_mul_float@plt>
mov    $0x0,%al
call   1060 <check_mul_double@plt>
mov    $0x0,%al
call   1030 <check_mul_long_double@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <check_mul_float@plt>
xor    %eax,%eax
call   1060 <check_mul_double@plt>
xor    %eax,%eax
call   1030 <check_mul_long_double@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check_mul_float()
%3 = call i32 (...) @check_mul_double()
%4 = call i32 (...) @check_mul_long_double()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_mul_float()
%2 = tail call i32 (...) @check_mul_double()
%3 = tail call i32 (...) @check_mul_long_double()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ getuid();
int /*<<< orphan*/ stderr;
void check_capabilities() {
  if (getuid() != 0) {
    fprintf(stderr, "You haven't required permissions to make this action\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<check_capabilities>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getuid@plt>
cmp    $0x0,%rax
je     1164 <check_capabilities+0x34>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_capabilities>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
test   %rax,%rax
jne    113f <check_capabilities+0xf>
pop    %rax
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"You haven't required permissions to make this action\0A\00"
define void @check_capabilities() {
%1 = call i64 (...) @getuid()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 -1)
unreachable
7: ; preds = %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"You haven't required permissions to make this action\0A\00"
define void @check_capabilities() {
%1 = tail call i64 (...) @getuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %0
ret void
}
int f(void) {
  int *restrict p;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32*
ret i32 0
}

LLVM IR (-O2):
define i32 @f() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x3b() {
  Assert_real((isupper(59) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              300, ("isupper should be 0 for ;"));
}


x86 assembly (clang, -O0):
<t_isupper_0x3b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3b,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x12c,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x3b>:
push   %rax
mov    $0x3b,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x12c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for ;\00"
define void @t_isupper_0x3b() {
%1 = call i64 @isupper(i32 59)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 300, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for ;\00"
define void @t_isupper_0x3b() {
%1 = tail call i64 @isupper(i32 59)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 300, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, double);
main2() {
  double nc;
  for (nc = 0; getchar() != EOF; ++nc)
    ;
  printf("%.0f\n", nc);
}


x86 assembly (clang, -O0):
<main2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
je     1163 <main2+0x43>
jmp    114c <main2+0x2c>
movsd  0xeac(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1130 <main2+0x10>
movsd  -0x10(%rbp),%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main2>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb5(%rip),%rbx
xorpd  %xmm0,%xmm0
cmp    (%rbx),%rax
je     1160 <main2+0x40>
xorpd  %xmm0,%xmm0
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <getchar@plt>
movsd  0x8(%rsp),%xmm0
cmp    (%rbx),%rax
jne    1140 <main2+0x20>
lea    0xea1(%rip),%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main2() {
%1 = alloca i32
%2 = alloca double
store double 0.000000e+00, double* %2
br label %3
3: ; preds = %8, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
br label %8
8: ; preds = %7
%9 = load double, double* %2
%10 = fadd double %9, 1.000000e+00
store double %10, double* %2
br label %3
11: ; preds = %3
%12 = load double, double* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %12)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main2() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi double [ %6, %4 ], [ 0.000000e+00, %0 ]
%6 = fadd double %5, 1.000000e+00
%7 = tail call i64 (...) @getchar()
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi double [ 0.000000e+00, %0 ], [ %6, %4 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
ret i32 undef
}
/* Variables and functions */
float sincalc(unsigned int);
float ar(unsigned i) { return 0.5f * (1.0f - sincalc(i)); }


x86 assembly (clang, -O0):
<ar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sincalc@plt>
movss  0xed9(%rip),%xmm1
subss  %xmm0,%xmm1
movss  0xec9(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ar>:
push   %rax
call   1030 <sincalc@plt>
movss  0xee2(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  0xeda(%rip),%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call float @sincalc(i32 %3)
%5 = fsub float 1.000000e+00, %4
%6 = fmul float 5.000000e-01, %5
ret float %6
}

LLVM IR (-O2):
define float @ar(i32 %0) {
%2 = tail call float @sincalc(i32 %0)
%3 = fsub float 1.000000e+00, %2
%4 = fmul float %3, 5.000000e-01
ret float %4
}
void _delay_us(double __us) {
  double __tmp = ((24000000) / 172e6) * __us;
  while (__tmp > 0)
    __tmp--;
}


x86 assembly (clang, -O0):
<_delay_us>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1144 <_delay_us+0x44>
movsd  0xed3(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    111b <_delay_us+0x1b>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_delay_us(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 0x3FC1DC47711DC477, %4
store double %5, double* %3
br label %6
6: ; preds = %9, %1
%7 = load double, double* %3
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load double, double* %3
%11 = fadd double %10, -1.000000e+00
store double %11, double* %3
br label %6
12: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @_delay_us(double %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ print_tap_result(char *, unsigned long, char const *,
                                    int /*<<< orphan*/);
int /*<<< orphan*/ safe_printf(char *);
void tap_ok_todo_va(unsigned long testnum, const char *msg, va_list ap) {
  print_tap_result("ok", testnum, msg, ap);
  safe_printf(" # TODO\n");
}


x86 assembly (clang, -O0):
<tap_ok_todo_va>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xebb(%rip),%rdi
call   1040 <print_tap_result@plt>
lea    0xeb2(%rip),%rdi
call   1030 <safe_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tap_ok_todo_va>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
call   1040 <print_tap_result@plt>
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1030 <safe_printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ok\00"
@.str.1 = [9 x i8] c" # TODO\0A\00"
define void @tap_ok_todo_va(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @print_tap_result(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %7, i8* %8, i32 %9)
%11 = call i32 @safe_printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ok\00"
@.str.1 = [9 x i8] c" # TODO\0A\00"
define void @tap_ok_todo_va(i64 %0, i8* %1, i32 %2) {
%4 = tail call i32 @print_tap_result(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %0, i8* %1, i32 %2)
%5 = tail call i32 @safe_printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fact(int);
int binomial(int a, int b) { return fact(a) / (fact(b) * fact(a - b)); }


x86 assembly (clang, -O0):
<binomial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fact@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fact@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <fact@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binomial>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <fact@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <fact@plt>
mov    %eax,%r15d
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <fact@plt>
mov    %eax,%ecx
imul   %r15d,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @binomial(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 = call i32 @fact(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @fact(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = call i32 @fact(i32 %11)
%13 = mul nsw i32 %8, %12
%14 = sdiv i32 %6, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @binomial(i32 %0, i32 %1) {
%3 = tail call i32 @fact(i32 %0)
%4 = tail call i32 @fact(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call i32 @fact(i32 %5)
%7 = mul nsw i32 %6, %4
%8 = sdiv i32 %3, %7
ret i32 %8
}