xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int f(int, int, int);
main() {
  assert(f(1, 2, 3) == 0);
  assert(f(1, 1, 3) == 0);
  assert(f(1, 1, 1) == 1);
  assert(f(1, 1, 1) == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <f@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x1,%esi
mov    $0x3,%edx
mov    %esi,%edi
call   1030 <f@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x1,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <f@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x1,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <f@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <f@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <f@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <f@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <f@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 1, i32 2, i32 3)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @f(i32 1, i32 1, i32 3)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @f(i32 1, i32 1, i32 1)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @f(i32 1, i32 1, i32 1)
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2, i32 3)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @f(i32 1, i32 1, i32 3)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @f(i32 1, i32 1, i32 1)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @f(i32 1, i32 1, i32 1)
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x0d() {
  Assert_real((islower(13) == 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_islower.c",
              70, ("islower should be 0 for 0x0d"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x0d>:
push   %rax
mov    $0xd,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x46,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x0d\00"
define void @t_islower_0x0d() {
%1 = call i64 @islower(i32 13)
%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 70, i8* getelementptr inbounds ([29 x i8], [29 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x0d\00"
define void @t_islower_0x0d() {
%1 = tail call i64 @islower(i32 13)
%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 70, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tbl_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ row(struct tbl_node *, int, char const *, int *);
int tbl_layout(struct tbl_node *tbl, int ln, const char *p) {
  int pos;
  pos = 0;
  row(tbl, ln, p, &pos);
  return (1);
}


x86 assembly (clang, -O0):
<tbl_layout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1030 <row@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tbl_layout>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rcx
call   1030 <row@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tbl_node = type { i32 }
define i32 @tbl_layout(%struct.tbl_node* %0, i32 %1, i8* %2) {
%4 = alloca %struct.tbl_node*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store %struct.tbl_node* %0, %struct.tbl_node** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i32 0, i32* %7
%8 = load %struct.tbl_node*, %struct.tbl_node** %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @row(%struct.tbl_node* %8, i32 %9, i8* %10, i32* %7)
ret i32 1
}

LLVM IR (-O2):
%struct.tbl_node = type { i32 }
define i32 @tbl_layout(%struct.tbl_node* %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @row(%struct.tbl_node* %0, i32 %1, i8* %2, i32* %4)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_notequal_flt(int *, float, float);
int xil_fpo_notequal_flt(float a, float b) {
  int res_int;
  xip_fpo_notequal_flt(&res_int, a, b);
  return res_int;
}


x86 assembly (clang, -O0):
<xil_fpo_notequal_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    -0xc(%rbp),%rdi
call   1030 <xip_fpo_notequal_flt@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_notequal_flt>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_notequal_flt@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @xil_fpo_notequal_flt(float %0, float %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @xip_fpo_notequal_flt(i32* %3, float %0, float %1)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
main() { exit((L'1' + (0)) != L'1'); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int getInput() {
  int input;
  printf("%s", "Please enter a positive number to search (0 - 100): ");
  scanf("%d", &input);
  return input;
}


x86 assembly (clang, -O0):
<getInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInput>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [53 x i8] c"Please enter a positive number to search (0 - 100): \00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @getInput() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [53 x i8] c"Please enter a positive number to search (0 - 100): \00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @getInput() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ FCEU_QSimpleCommand(int);
void FCEUI_ResetNES(void) { FCEU_QSimpleCommand(0x01); }


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

x86 assembly (clang, -O2):
<FCEUI_ResetNES>:
mov    $0x1,%edi
jmp    1030 <FCEU_QSimpleCommand@plt>

LLVM IR (-O0):
define void @FCEUI_ResetNES() {
%1 = call i32 @FCEU_QSimpleCommand(i32 1)
ret void
}

LLVM IR (-O2):
define void @FCEUI_ResetNES() {
%1 = tail call i32 @FCEU_QSimpleCommand(i32 1)
ret void
}
int viewvideo_save_shot(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @viewvideo_save_shot() {
ret i32 0
}

LLVM IR (-O2):
define i32 @viewvideo_save_shot() {
ret i32 0
}
char val_to_asc(unsigned char x, unsigned char letter_case) {
  static char letters[] = "0123456789abcdefghijklmnopqrstuvwxyz"
                          "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  return letters[x + letter_case * sizeof letters / 2];
}


x86 assembly (clang, -O0):
<val_to_asc>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
movzbl -0x2(%rbp),%eax
imul   $0x49,%rax,%rax
shr    $0x1,%rax
add    %rax,%rcx
lea    0x2f04(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_to_asc>:
mov    %edi,%eax
mov    %esi,%ecx
lea    (%rcx,%rcx,8),%rdx
lea    (%rcx,%rdx,8),%rcx
shr    %rcx
add    %rax,%rcx
lea    0xee7(%rip),%rax
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@val_to_asc.letters = internal global [73 x i8] c"0123456789abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define signext i8 @val_to_asc(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i64
%7 = load i8, i8* %4
%8 = zext i8 %7 to i64
%9 = mul i64 %8, 73
%10 = udiv i64 %9, 2
%11 = add i64 %6, %10
%12 = getelementptr inbounds [73 x i8], [73 x i8]* @val_to_asc.letters, i64 0, i64 %11
%13 = load i8, i8* %12
ret i8 %13
}

LLVM IR (-O2):
@val_to_asc.letters = internal unnamed_addr constant [73 x i8] c"0123456789abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define signext i8 @val_to_asc(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i64
%4 = zext i8 %1 to i64
%5 = mul nuw nsw i64 %4, 73
%6 = lshr i64 %5, 1
%7 = add nuw nsw i64 %6, %3
%8 = getelementptr inbounds [73 x i8], [73 x i8]* @val_to_asc.letters, i64 0, i64 %7
%9 = load i8, i8* %8
ret i8 %9
}
void adc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @adc_init() {
ret void
}
void EVP_aes_192_cbc(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_aes_192_cbc() {
ret void
}
void RTAvlroGCPhysRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroGCPhysRemove() {
ret void
}
/* Variables and functions */
int strcmp(char *const, char *const);
int comparStr(const void *p1, const void *p2) {
  return strcmp(*(char *const *)p1, *(char *const *)p2);
}


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

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

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

LLVM IR (-O2):
define i32 @comparStr(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t be32_to_host(uint32_t in) { return ntohl(in); }


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

x86 assembly (clang, -O2):
<be32_to_host>:
jmp    1030 <ntohl@plt>

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

LLVM IR (-O2):
define i32 @be32_to_host(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int starts_with(const char *a, const char *b) {
  if (strncmp(a, b, strlen(b)) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    116e <starts_with+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <starts_with+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @starts_with(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void udpv4head(int osvers, int osrel, int ossub) {
  printf("indgram/s outdgram/s   inerr/s  noport/s    "
         "                  _udpv4_");
}


x86 assembly (clang, -O0):
<udpv4head>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [70 x i8] c"indgram/s outdgram/s inerr/s noport/s _udpv4_\00"
define void @udpv4head(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"indgram/s outdgram/s inerr/s noport/s _udpv4_\00"
define void @udpv4head(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
void SHA1_Transform(void) {}


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

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

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

LLVM IR (-O2):
define void @SHA1_Transform() {
ret void
}
void foo_2_1_2_2_2_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_2_2_2_1_2_1() {
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *mbasename(const char *path) {
  const char *last = strrchr(path, '/');
  if (last) {
    return last + 1;
  }
  return path;
}


x86 assembly (clang, -O0):
<mbasename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <mbasename+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <mbasename+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbasename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mbasename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @mbasename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
int /*<<< orphan*/ WaypointActiveHandle();
void WaypointActiveLogging() { UAVObjLogging(WaypointActiveHandle()); }


x86 assembly (clang, -O0):
<WaypointActiveLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <WaypointActiveHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaypointActiveLogging>:
push   %rax
xor    %eax,%eax
call   1040 <WaypointActiveHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @WaypointActiveLogging() {
%1 = call i32 (...) @WaypointActiveHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @WaypointActiveLogging() {
%1 = tail call i32 (...) @WaypointActiveHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
int drm_alloc_resource(struct drm_device *dev, int resource) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.drm_device = type opaque
define i32 @drm_alloc_resource(%struct.drm_device* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
void timespec_fromMillis(struct timespec *time, long millis) {
  time->tv_sec = millis / 1000;
  time->tv_nsec = (millis % 1000) * 1000000;
}


x86 assembly (clang, -O0):
<timespec_fromMillis>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
imul   $0xf4240,%rdx,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_fromMillis>:
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rsi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rax,%rdx
mov    %rdx,(%rdi)
imul   $0x3e8,%rdx,%rax
sub    %rax,%rsi
imul   $0xf4240,%rsi,%rax
mov    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @timespec_fromMillis(%struct.timespec* %0, i64 %1) {
%3 = alloca %struct.timespec*
%4 = alloca i64
store %struct.timespec* %0, %struct.timespec** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = sdiv i64 %5, 1000
%7 = load %struct.timespec*, %struct.timespec** %3
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
store i64 %6, i64* %8
%9 = load i64, i64* %4
%10 = srem i64 %9, 1000
%11 = mul nsw i64 %10, 1000000
%12 = load %struct.timespec*, %struct.timespec** %3
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %12, i32 0, i32 1
store i64 %11, i64* %13
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @timespec_fromMillis(%struct.timespec* nocapture writeonly %0, i64 %1) {
%3 = sdiv i64 %1, 1000
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i64 %3, i64* %4
%5 = srem i64 %1, 1000
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i64 %6, i64* %7
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
void set_XMotionEvent_serial(void *_p, unsigned long _v) {
  ((XMotionEvent *)_p)->serial = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XMotionEvent_serial>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XMotionEvent_serial(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
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XMotionEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void print_error(int sfd, const char *message, int error) {
  (void)sfd;
  (void)error;
  (void)message;
}


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

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

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

LLVM IR (-O2):
define void @print_error(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
size_t mobi_pow(unsigned base, unsigned exp) {
  size_t result = 1;
  while (exp) {
    if (exp & 1) {
      result *= base;
    }
    exp >>= 1;
    base *= base;
  }
  return result;
}


x86 assembly (clang, -O0):
<mobi_pow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114f <mobi_pow+0x4f>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1137 <mobi_pow+0x37>
mov    -0x4(%rbp),%eax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <mobi_pow+0x12>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mobi_pow>:
mov    $0x1,%eax
test   %esi,%esi
je     113a <mobi_pow+0x3a>
mov    $0x1,%r8d
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %edi,%ecx
cmove  %r8d,%ecx
imul   %rcx,%rax
shr    %edx
imul   %edi,%edi
cmp    $0x1,%esi
mov    %edx,%esi
ja     1120 <mobi_pow+0x20>
ret

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

LLVM IR (-O2):
define i64 @mobi_pow(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %12, %4 ], [ 1, %2 ]
%6 = phi i32 [ %13, %4 ], [ %1, %2 ]
%7 = phi i32 [ %14, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %7
%11 = zext i32 %10 to i64
%12 = mul i64 %5, %11
%13 = lshr i32 %6, 1
%14 = mul i32 %7, %7
%15 = icmp ult i32 %6, 2
br i1 %15, label %16, label %4
16: ; preds = %4, %2
%17 = phi i64 [ 1, %2 ], [ %12, %4 ]
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ atan2f(short, short);
short roundf(int /*<<< orphan*/);
short phase_fun_complexOf_short(unsigned a) {
  short re = (a >> 16);
  short im = (a & 0x0000ffff);
  if (re == 0 && im == 0)
    return 0;
  else
    return roundf(atan2f(im, re));
}


x86 assembly (clang, -O0):
<phase_fun_complexOf_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0xc(%rbp)
movswl -0xa(%rbp),%eax
cmp    $0x0,%eax
jne    1166 <phase_fun_complexOf_short+0x46>
movswl -0xc(%rbp),%eax
cmp    $0x0,%eax
jne    1166 <phase_fun_complexOf_short+0x46>
movw   $0x0,-0x2(%rbp)
jmp    1181 <phase_fun_complexOf_short+0x61>
mov    -0xc(%rbp),%ax
movswl %ax,%edi
movswl -0xa(%rbp),%esi
call   1040 <atan2f@plt>
mov    %eax,%edi
call   1030 <roundf@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phase_fun_complexOf_short>:
test   %edi,%edi
je     113a <phase_fun_complexOf_short+0x1a>
push   %rax
mov    %edi,%esi
sar    $0x10,%esi
movswl %di,%edi
call   1040 <atan2f@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <roundf@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i16 @phase_fun_complexOf_short(i32 %0) {
%2 = alloca i16
%3 = alloca i32
%4 = alloca i16
%5 = alloca i16
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = lshr i32 %6, 16
%8 = trunc i32 %7 to i16
store i16 %8, i16* %4
%9 = load i32, i32* %3
%10 = and i32 %9, 65535
%11 = trunc i32 %10 to i16
store i16 %11, i16* %5
%12 = load i16, i16* %4
%13 = sext i16 %12 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %1
%16 = load i16, i16* %5
%17 = sext i16 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15
store i16 0, i16* %2
br label %25
20: ; preds = %15, %1
%21 = load i16, i16* %5
%22 = load i16, i16* %4
%23 = call i32 @atan2f(i16 signext %21, i16 signext %22)
%24 = call signext i16 @roundf(i32 %23)
store i16 %24, i16* %2
br label %25
25: ; preds = %20, %19
%26 = load i16, i16* %2
ret i16 %26
}

LLVM IR (-O2):
define signext i16 @phase_fun_complexOf_short(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = trunc i32 %0 to i16
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i16
%7 = tail call i32 @atan2f(i16 signext %4, i16 signext %6)
%8 = tail call signext i16 @roundf(i32 %7)
br label %9
9: ; preds = %1, %3
%10 = phi i16 [ %8, %3 ], [ 0, %1 ]
ret i16 %10
}
long long uzzs() { return 0x7fff00000000ffffLL; }


x86 assembly (clang, -O0):
<uzzs>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fff00000000ffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uzzs>:
movabs $0x7fff00000000ffff,%rax
ret

LLVM IR (-O0):
define i64 @uzzs() {
ret i64 9223090561878130687
}

LLVM IR (-O2):
define i64 @uzzs() {
ret i64 9223090561878130687
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int tst_not_found(void *setup_ctxt) {
  printf("  (c) this test should not be found\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c" (c) this test should not be found\0A\00"
define i32 @tst_not_found(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [36 x i8] c" (c) this test should not be found\00"
define i32 @tst_not_found(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int sizetoalloc(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int strsize(char *str) { return sizetoalloc(strlen(str)); }


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

x86 assembly (clang, -O2):
<strsize>:
push   %rax
call   1040 <strlen@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sizetoalloc@plt>

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

LLVM IR (-O2):
define i32 @strsize(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @sizetoalloc(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ rt_init();
void __attribute__((constructor)) libmatrixstore_init(void) { rt_init(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @libmatrixstore_init, i8* null }]
define void @libmatrixstore_init() {
%1 = call i32 (...) @rt_init()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @libmatrixstore_init, i8* null }]
define void @libmatrixstore_init() {
%1 = tail call i32 (...) @rt_init()
ret void
}
/* Variables and functions */
double nextafter(double, double);
double c_nextafter(double arg0, double arg1) { return nextafter(arg0, arg1); }


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

x86 assembly (clang, -O2):
<c_nextafter>:
jmp    1030 <nextafter@plt>

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

LLVM IR (-O2):
define double @c_nextafter(double %0, double %1) {
%3 = tail call double @nextafter(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned int, int);
void disable_dma(unsigned int dmanr) {
  if (dmanr <= 3)
    outb(dmanr | 4, 0x0A);
  else
    outb((dmanr & 3) | 4, 0xD4);
}


x86 assembly (clang, -O0):
<disable_dma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
ja     113a <disable_dma+0x2a>
mov    -0x4(%rbp),%edi
or     $0x4,%edi
mov    $0xa,%esi
call   1030 <outb@plt>
jmp    114d <disable_dma+0x3d>
mov    -0x4(%rbp),%edi
and    $0x3,%edi
or     $0x4,%edi
mov    $0xd4,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_dma>:
mov    %edi,%eax
and    $0x3,%eax
cmp    $0x4,%edi
mov    $0xa,%ecx
mov    $0xd4,%esi
cmovb  %ecx,%esi
or     $0x4,%eax
mov    %eax,%edi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @disable_dma(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ule i32 %3, 3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = or i32 %6, 4
%8 = call i32 @outb(i32 %7, i32 10)
br label %14
9: ; preds = %1
%10 = load i32, i32* %2
%11 = and i32 %10, 3
%12 = or i32 %11, 4
%13 = call i32 @outb(i32 %12, i32 212)
br label %14
14: ; preds = %9, %5
ret void
}

LLVM IR (-O2):
define void @disable_dma(i32 %0) {
%2 = icmp ult i32 %0, 4
%3 = and i32 %0, 3
%4 = select i1 %2, i32 10, i32 212
%5 = or i32 %3, 4
%6 = tail call i32 @outb(i32 %5, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fopen_main();
int /*<<< orphan*/ sscanf_main();
int main(int argc, char *argv[]) {
  fopen_main();
  sscanf_main();
  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    $0x0,%al
call   1030 <fopen_main@plt>
mov    $0x0,%al
call   1040 <sscanf_main@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fopen_main()
%4 = tail call i32 (...) @sscanf_main()
ret i32 0
}
void test1i_setup_once() {}


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

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

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

LLVM IR (-O2):
define void @test1i_setup_once() {
ret void
}
void ScaleARGBCols_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBCols_NEON() {
ret void
}
double Sleef_tanh_u10(double x) { return __builtin_tanh(x); }


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

x86 assembly (clang, -O2):
<Sleef_tanh_u10>:
jmp    1030 <tanh@plt>

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

LLVM IR (-O2):
define double @Sleef_tanh_u10(double %0) {
%2 = tail call double @tanh(double %0)
ret double %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int key_click_percent;
};
typedef TYPE_1__ XKeyboardState;

/* Variables and functions */
void set_XKeyboardState_key_click_percent(void *_p, int _v) {
  ((XKeyboardState *)_p)->key_click_percent = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XKeyboardState_key_click_percent>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XKeyboardState_key_click_percent(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ base64_to_name(char *);
int /*<<< orphan*/ do_wallops(int /*<<< orphan*/, char *);
void m_wallusers(char *origin, char **argv, int argc, int srv) {
  do_wallops(base64_to_name(origin), argv[0]);
}


x86 assembly (clang, -O0):
<m_wallusers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <base64_to_name@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1040 <do_wallops@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_wallusers>:
push   %rbx
mov    %rsi,%rbx
call   1030 <base64_to_name@plt>
mov    (%rbx),%rsi
mov    %eax,%edi
pop    %rbx
jmp    1040 <do_wallops@plt>

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

LLVM IR (-O2):
define void @m_wallusers(i8* %0, i8** nocapture %1, i32 %2, i32 %3) {
%5 = tail call i32 @base64_to_name(i8* %0)
%6 = load i8*, i8** %1
%7 = tail call i32 @do_wallops(i32 %5, i8* %6)
ret void
}
/* Variables and functions */
int chdir(char *);
int /*<<< orphan*/ perror(char *);
int cdCommand(char **args) {
  *args++;
  int ret = chdir(*args);
  if (ret == -1)
    perror("cd");
  return ret;
}


x86 assembly (clang, -O0):
<cdCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <chdir@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    115d <cdCommand+0x3d>
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdCommand>:
push   %rbx
mov    0x8(%rdi),%rdi
call   1030 <chdir@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1135 <cdCommand+0x15>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec4(%rip),%rdi
call   1040 <perror@plt>
jmp    1131 <cdCommand+0x11>

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

LLVM IR (-O2):
@.str = [3 x i8] c"cd\00"
define i32 @cdCommand(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = tail call i32 @chdir(i8* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i32 %4
}
int main(void) {
  int a[4][5] = {0};
  a[1][7];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [4 x [5 x i32]]
%2 = bitcast [4 x [5 x i32]]* %1 to i8*
%3 = getelementptr inbounds [4 x [5 x i32]], [4 x [5 x i32]]* %1, i64 0, i64 1
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 7
%5 = load i32, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ tab;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
int strlen(char *);
int test13(void) {
  char pad1 = 0;
  char tab[10];
  char pad2 = 0;
  memset(tab, 'a', sizeof(tab));
  return strlen(tab);
}


x86 assembly (clang, -O0):
<test13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movb   $0x0,-0xc(%rbp)
lea    -0xb(%rbp),%rdi
mov    $0x61,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
lea    -0xb(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test13>:
push   %rbx
sub    $0x10,%rsp
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x61,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test13() {
%1 = alloca i8
%2 = alloca [10 x i8]
%3 = alloca i8
store i8 0, i8* %1
store i8 0, i8* %3
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i8 signext 97, i32 10)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test13() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 97, i32 10)
%4 = call i32 @strlen(i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf(
      "USAGE: memhog [-wuv] -s <kbytes>\n"
      "\n"
      "  -s <kbytes>  allocate <kbytes> on the heap\n"
      "  -w           allocate then wait - do not exit (use CTRL-C to exit)\n"
      "  -u           use the memory (via memcpy)\n"
      "  -v           be verbose\n"
      "\n"
      "program will exit with 0 if the memory was successfully allocated\n"
      "\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [286 x i8] c"USAGE: memhog [-wuv] -s <kbytes>\0A\0A -s <kbytes> allocate <kbytes> on the heap\0A -w allocate then wait - do not exit (use CTRL-C to exit)\0A -u use the memory (via memcpy)\0A -v be verbose\0A\0Aprogram will exit with 0 if the memory was successfully allocated\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([286 x i8], [286 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [285 x i8] c"USAGE: memhog [-wuv] -s <kbytes>\0A\0A -s <kbytes> allocate <kbytes> on the heap\0A -w allocate then wait - do not exit (use CTRL-C to exit)\0A -u use the memory (via memcpy)\0A -v be verbose\0A\0Aprogram will exit with 0 if the memory was successfully allocated\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([285 x i8], [285 x i8]* @str, i64 0, i64 0))
ret void
}