xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ die_out_of_memory();
char *strdup(char const *);
char *xstrdup(const char *str) {
  if (!str)
    return NULL;
  char *p = strdup(str);
  if (!p)
    die_out_of_memory();
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    116b <xstrdup+0x4b>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1163 <xstrdup+0x43>
mov    $0x0,%al
call   1030 <die_out_of_memory@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
test   %rdi,%rdi
je     113e <xstrdup+0x1e>
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <xstrdup+0x20>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <die_out_of_memory@plt>
jmp    1140 <xstrdup+0x20>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %2
br label %17
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %8
%14 = call i32 (...) @die_out_of_memory()
br label %15
15: ; preds = %13, %8
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %15, %7
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @die_out_of_memory()
br label %8
8: ; preds = %3, %6, %1
%9 = phi i8* [ null, %1 ], [ null, %6 ], [ %4, %3 ]
ret i8* %9
}
int HelpItem62(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem62() {
ret i32 0
}
void fooAdd(char *s, int i) {
  s[i] = 'd';
  s[i + 2] = 'd';
}


x86 assembly (clang, -O0):
<fooAdd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x64,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movb   $0x64,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fooAdd>:
movslq %esi,%rax
movb   $0x64,(%rdi,%rax,1)
movb   $0x64,0x2(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @fooAdd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 100, i8* %8
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
store i8 100, i8* %13
ret void
}

LLVM IR (-O2):
define void @fooAdd(i8* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 100, i8* %4
%5 = add nsw i32 %1, 2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 100, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(unsigned char *);
__attribute__((nonnull)) void liq_aligned_free(void *inptr) {
  unsigned char *ptr = inptr;
  size_t offset = ptr[-1] ^ 0x59;
  assert(offset > 0 && offset <= 16);
  free(ptr - offset);
}


x86 assembly (clang, -O0):
<liq_aligned_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl -0x1(%rax),%eax
xor    $0x59,%eax
cltq
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jbe    1160 <liq_aligned_free+0x40>
cmpq   $0x10,-0x18(%rbp)
setbe  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
sub    -0x18(%rbp),%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<liq_aligned_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movzbl -0x1(%rdi),%ebx
xor    $0x59,%rbx
lea    -0x1(%rbx),%eax
xor    %edi,%edi
cmp    $0x10,%al
setb   %dil
call   1040 <assert@plt>
sub    %rbx,%r14
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @liq_aligned_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = xor i32 %9, 89
%11 = sext i32 %10 to i64
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = icmp ugt i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = load i64, i64* %4
%16 = icmp ule i64 %15, 16
br label %17
17: ; preds = %14, %1
%18 = phi i1 [ false, %1 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i8*, i8** %3
%22 = load i64, i64* %4
%23 = sub i64 0, %22
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = call i32 @free(i8* %24)
ret void
}

LLVM IR (-O2):
define void @liq_aligned_free(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -1
%3 = load i8, i8* %2
%4 = xor i8 %3, 89
%5 = zext i8 %4 to i64
%6 = add i8 %4, -1
%7 = icmp ult i8 %6, 16
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = sub nsw i64 0, %5
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = tail call i32 @free(i8* %11)
ret void
}
void stkdump(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _hi_free(struct hiarray *, char *, int);
int /*<<< orphan*/ hiarray_deinit(struct hiarray *);
void hiarray_destroy(struct hiarray *a) {
  hiarray_deinit(a);
  do {
    _hi_free(a,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/vipshop/hiredis-vip/refs/heads/master/"
             "hiarray.c",
             35);
    (a) = NULL;
  } while (0);
}


x86 assembly (clang, -O0):
<hiarray_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hiarray_deinit@plt>
mov    -0x8(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x23,%edx
call   1040 <_hi_free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hiarray_destroy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <hiarray_deinit@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
mov    $0x23,%edx
pop    %rbx
jmp    1040 <_hi_free@plt>

LLVM IR (-O0):
%struct.hiarray = type { i32 }
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vipshop/hiredis-vip/refs/heads/master/hiarray.c\00"
define void @hiarray_destroy(%struct.hiarray* %0) {
%2 = alloca %struct.hiarray*
store %struct.hiarray* %0, %struct.hiarray** %2
%3 = load %struct.hiarray*, %struct.hiarray** %2
%4 = call i32 @hiarray_deinit(%struct.hiarray* %3)
br label %5
5: ; preds = %1
%6 = load %struct.hiarray*, %struct.hiarray** %2
%7 = call i32 @_hi_free(%struct.hiarray* %6, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 35)
store %struct.hiarray* null, %struct.hiarray** %2
br label %8
8: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.hiarray = type { i32 }
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vipshop/hiredis-vip/refs/heads/master/hiarray.c\00"
define void @hiarray_destroy(%struct.hiarray* %0) {
%2 = tail call i32 @hiarray_deinit(%struct.hiarray* %0)
%3 = tail call i32 @_hi_free(%struct.hiarray* %0, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 35)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pr(void) { printf("Dwsate arnhtiko arithmo!\n"); }


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

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

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

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

/* Variables and functions */
size_t fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
size_t read_int32(FILE *fp, int32_t *i) { return fread(i, sizeof(*i), 1, fp); }


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

x86 assembly (clang, -O2):
<read_int32>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i64 @read_int32(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fread(i32* %1, i32 4, i32 1, i32* %0)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Free1D(double *);
int /*<<< orphan*/ Free2D(double **);
void Free3D(double ***data) {
  Free1D(**data);
  Free2D((double **)data);
}


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

x86 assembly (clang, -O2):
<Free3D>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rdi
call   1030 <Free1D@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <Free2D@plt>

LLVM IR (-O0):
define void @Free3D(double*** %0) {
%2 = alloca double***
store double*** %0, double**** %2
%3 = load double***, double**** %2
%4 = load double**, double*** %3
%5 = load double*, double** %4
%6 = call i32 @Free1D(double* %5)
%7 = load double***, double**** %2
%8 = bitcast double*** %7 to double**
%9 = call i32 @Free2D(double** %8)
ret void
}

LLVM IR (-O2):
define void @Free3D(double*** %0) {
%2 = load double**, double*** %0
%3 = load double*, double** %2
%4 = tail call i32 @Free1D(double* %3)
%5 = bitcast double*** %0 to double**
%6 = tail call i32 @Free2D(double** %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ carac();
int main() {
  carac();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @carac()
ret i32 0
}
char *int_to_string(int integer) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @int_to_string(i32 %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fred() { printf("this is fred\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"this is fred\00"
define void @fred() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
int equal_keys(void *k1, void *k2) {
  int *id1 = (int *)k1;
  int *id2 = (int *)k2;
  return *id1 == *id2;
}


x86 assembly (clang, -O0):
<equal_keys>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_keys>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @equal_keys(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @equal_keys(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
char test8(int X) {
  char str[100000] = "abc";
  return str[X];
}


x86 assembly (clang, -O0):
<test8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186b0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x186b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x186a0,%edx
call   1030 <memset@plt>
movb   $0x61,-0x186b0(%rbp)
movb   $0x62,-0x186af(%rbp)
movb   $0x63,-0x186ae(%rbp)
movslq -0x4(%rbp),%rax
movsbl -0x186b0(%rbp,%rax,1),%eax
ff
add    $0x186b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test8>:
push   %rbx
sub    $0x186a0,%rsp
mov    %edi,%ebx
mov    %rsp,%rdi
mov    $0x186a0,%edx
xor    %esi,%esi
call   1030 <memset@plt>
movw   $0x6261,(%rsp)
movb   $0x63,0x2(%rsp)
movslq %ebx,%rax
mov    (%rsp,%rax,1),%al
add    $0x186a0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @test8(i32 %0) {
%2 = alloca i32
%3 = alloca [100000 x i8]
store i32 %0, i32* %2
%4 = bitcast [100000 x i8]* %3 to i8*
%5 = bitcast i8* %4 to [100000 x i8]*
%6 = getelementptr inbounds [100000 x i8], [100000 x i8]* %5, i32 0, i32 0
store i8 97, i8* %6
%7 = getelementptr inbounds [100000 x i8], [100000 x i8]* %5, i32 0, i32 1
store i8 98, i8* %7
%8 = getelementptr inbounds [100000 x i8], [100000 x i8]* %5, i32 0, i32 2
store i8 99, i8* %8
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [100000 x i8], [100000 x i8]* %3, i64 0, i64 %10
%12 = load i8, i8* %11
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @test8(i32 %0) {
%2 = alloca [100000 x i8]
%3 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 0
store i8 97, i8* %3
%4 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 1
store i8 98, i8* %4
%5 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 2
store i8 99, i8* %5
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ f2(int *);
void f6(int *x) {
  if (*x > 3) {
    f2(x);
  }
  f2(x);
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x3,(%rax)
jle    1132 <f6+0x22>
mov    -0x8(%rbp),%rdi
call   1030 <f2@plt>
mov    -0x8(%rbp),%rdi
call   1030 <f2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
push   %rbx
mov    %rdi,%rbx
cmpl   $0x4,(%rdi)
jl     1121 <f6+0x11>
mov    %rbx,%rdi
call   1030 <f2@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <f2@plt>

LLVM IR (-O0):
define void @f6(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 3
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = call i32 @f2(i32* %7)
br label %9
9: ; preds = %6, %1
%10 = load i32*, i32** %2
%11 = call i32 @f2(i32* %10)
ret void
}

LLVM IR (-O2):
define void @f6(i32* %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, 3
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @f2(i32* %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @f2(i32* %0)
ret void
}
void ASN1_BIT_STRING_set_bit(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_BIT_STRING_set_bit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test_get_cycles();
int main(int argc, char **argv) { exit(test_get_cycles()); }


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 <test_get_cycles@plt>
mov    %eax,%edi
call   1040 <exit@plt>

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

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 (...) @test_get_cycles()
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_get_cycles()
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int test_imm_AEint32_reg(int val) { return ((val) & (0xAE << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_AEint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xae,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_AEint32_reg>:
test   $0xae,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_AEint32_reg(i32 %0) {
%2 = and i32 %0, 174
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void mulvv(float *result, const float *s1) {
  result[0] *= s1[0];
  result[1] *= s1[1];
  result[2] *= s1[2];
}


x86 assembly (clang, -O0):
<mulvv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mulvv>:
movss  (%rsi),%xmm0
mulss  (%rdi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
mulss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @mulvv(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = fmul float %10, %7
store float %11, float* %9
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
%17 = load float, float* %16
%18 = fmul float %17, %14
store float %18, float* %16
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %3
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = fmul float %24, %21
store float %25, float* %23
ret void
}

LLVM IR (-O2):
define void @mulvv(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = load float, float* %0
%5 = fmul float %3, %4
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = fmul float %7, %9
store float %10, float* %8
%11 = getelementptr inbounds float, float* %1, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = fmul float %12, %14
store float %15, float* %13
ret void
}
__attribute__((always_)) void *read_cr3(void) {
  void *ret;
  asm volatile("mov %%cr3, %0" : "=r"(ret));
  return ret;
}


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

x86 assembly (clang, -O2):
<read_cr3>:
mov    %cr3,%rax
ret

LLVM IR (-O0):
define i8* @read_cr3() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "mov %cr3, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @read_cr3() {
%1 = tail call i8* asm sideeffect "mov %cr3, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
__attribute__((always_)) void outsw(unsigned short port, const void *addr,
                                    unsigned long count) {
  asm volatile("rep ; outs"
               "w"
               : "=S"(addr), "=c"(count)
               : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<outsw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
rep outsw %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsw>:
mov    %rdx,%rcx
mov    %edi,%edx
rep outsw %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsw(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "rep ; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsw(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep ; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ endian_rev16(int /*<<< orphan*/);
uint16_t endian_htons(uint16_t data) { return endian_rev16(data); }


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

x86 assembly (clang, -O2):
<endian_htons>:
jmp    1030 <endian_rev16@plt>

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

LLVM IR (-O2):
define i32 @endian_htons(i32 %0) {
%2 = tail call i32 @endian_rev16(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ disableRawMode();
int /*<<< orphan*/ enableRawMode();
int read(int /*<<< orphan*/, char *, int);
char tty_getchar() {
  int nread;
  char c;
  enableRawMode();
  do {
    nread = read(STDIN_FILENO, &c, 1);
  } while (nread == 0);
  disableRawMode();
  return c;
}


x86 assembly (clang, -O0):
<tty_getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <enableRawMode@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1050 <read@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113f <tty_getchar+0xf>
mov    $0x0,%al
call   1040 <disableRawMode@plt>
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_getchar>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <enableRawMode@plt>
mov    0x2e9e(%rip),%r14
lea    0x7(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    (%r14),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <read@plt>
test   %eax,%eax
je     1150 <tty_getchar+0x20>
xor    %eax,%eax
call   1040 <disableRawMode@plt>
mov    0x7(%rsp),%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define signext i8 @tty_getchar() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 (...) @enableRawMode()
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* @STDIN_FILENO
%6 = call i32 @read(i32 %5, i8* %2, i32 1)
store i32 %6, i32* %1
br label %7
7: ; preds = %4
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %4, label %10
10: ; preds = %7
%11 = call i32 (...) @disableRawMode()
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define signext i8 @tty_getchar() {
%1 = alloca i8
%2 = tail call i32 (...) @enableRawMode()
br label %3
3: ; preds = %3, %0
%4 = load i32, i32* @STDIN_FILENO
%5 = call i32 @read(i32 %4, i8* %1, i32 1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = tail call i32 (...) @disableRawMode()
%9 = load i8, i8* %1
ret i8 %9
}
int count_1_2(int n) {
  int num = 0;
  int mask = 1;
  int count = 0;
  while (count < 8) {
    if ((n & mask) == mask)
      num++;
    mask <<= 1;
    count++;
  }
  return num;
}


x86 assembly (clang, -O0):
<count_1_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    1155 <count_1_2+0x55>
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    113e <count_1_2+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <count_1_2+0x1c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_1_2>:
mov    %edi,%eax
and    $0x1,%eax
mov    %edi,%ecx
shr    %ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
add    %ecx,%eax
mov    %edi,%ecx
shr    $0x3,%ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x4,%eax
and    $0x1,%eax
add    %ecx,%eax
mov    %edi,%ecx
shr    $0x5,%ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x6,%eax
and    $0x1,%eax
add    %ecx,%eax
shr    $0x7,%edi
and    $0x1,%edi
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @count_1_2(i32 %0) {
%2 = and i32 %0, 1
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1
%5 = add nuw nsw i32 %2, %4
%6 = lshr i32 %0, 2
%7 = and i32 %6, 1
%8 = add nuw nsw i32 %5, %7
%9 = lshr i32 %0, 3
%10 = and i32 %9, 1
%11 = add nuw nsw i32 %8, %10
%12 = lshr i32 %0, 4
%13 = and i32 %12, 1
%14 = add nuw nsw i32 %11, %13
%15 = lshr i32 %0, 5
%16 = and i32 %15, 1
%17 = add nuw nsw i32 %14, %16
%18 = lshr i32 %0, 6
%19 = and i32 %18, 1
%20 = add nuw nsw i32 %17, %19
%21 = lshr i32 %0, 7
%22 = and i32 %21, 1
%23 = add nuw nsw i32 %20, %22
ret i32 %23
}
/* Variables and functions */
int /*<<< orphan*/ SYS_setregid;
int syscall(int /*<<< orphan*/, int, int);
int sregid(int a, int b) { return syscall(SYS_setregid, a, b); }


x86 assembly (clang, -O0):
<sregid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sregid>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@SYS_setregid = global i32 0
define i32 @sregid(i32 %0, i32 %1) {
%3 = load i32, i32* @SYS_setregid
%4 = tail call i32 @syscall(i32 %3, i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int read(int, char *, int);
char read_msg_id(int socket) {
  char c = 0;
  if (read(socket, &c, 1) != 1)
    return -1;
  return c;
}


x86 assembly (clang, -O0):
<read_msg_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
je     1142 <read_msg_id+0x32>
movb   $0xff,-0x1(%rbp)
jmp    1148 <read_msg_id+0x38>
mov    -0x9(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_msg_id>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
movzbl 0x7(%rsp),%ecx
mov    $0xff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @read_msg_id(i32 %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 0, i8* %4
%5 = load i32, i32* %3
%6 = call i32 @read(i32 %5, i8* %4, i32 1)
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 -1, i8* %2
br label %11
9: ; preds = %1
%10 = load i8, i8* %4
store i8 %10, i8* %2
br label %11
11: ; preds = %9, %8
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @read_msg_id(i32 %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = call i32 @read(i32 %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 1
%5 = load i8, i8* %2
%6 = select i1 %4, i8 %5, i8 -1
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ gif_stuff(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
void screen_to_gif(Window win, FILE *fp) { gif_stuff(win, fp, 2); }


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

x86 assembly (clang, -O2):
<screen_to_gif>:
mov    $0x2,%edx
jmp    1030 <gif_stuff@plt>

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

LLVM IR (-O2):
define void @screen_to_gif(i32 %0, i32* %1) {
%3 = tail call i32 @gif_stuff(i32 %0, i32* %1, i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int read_int(FILE *f) {
  int i;
  fscanf(f, "%i", &i);
  return i;
}


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

x86 assembly (clang, -O2):
<read_int>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <fscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @read_int(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ emit(int /*<<< orphan*/);
int /*<<< orphan*/ hibyte(int);
int /*<<< orphan*/ lobyte(int);
void eword(int wd) {
  emit(hibyte(wd));
  emit(lobyte(wd));
}


x86 assembly (clang, -O0):
<eword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <hibyte@plt>
mov    %eax,%edi
call   1050 <emit@plt>
mov    -0x4(%rbp),%edi
call   1030 <lobyte@plt>
mov    %eax,%edi
call   1050 <emit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eword>:
push   %rbx
mov    %edi,%ebx
call   1040 <hibyte@plt>
mov    %eax,%edi
call   1050 <emit@plt>
mov    %ebx,%edi
call   1030 <lobyte@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <emit@plt>

LLVM IR (-O0):
define void @eword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @hibyte(i32 %3)
%5 = call i32 @emit(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @lobyte(i32 %6)
%8 = call i32 @emit(i32 %7)
ret void
}

LLVM IR (-O2):
define void @eword(i32 %0) {
%2 = tail call i32 @hibyte(i32 %0)
%3 = tail call i32 @emit(i32 %2)
%4 = tail call i32 @lobyte(i32 %0)
%5 = tail call i32 @emit(i32 %4)
ret void
}
void updateDictResizePolicy(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               133, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<updateDictResizePolicy>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x85,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateDictResizePolicy>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x85,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.updateDictResizePolicy = [23 x i8] c"updateDictResizePolicy\00"
define void @updateDictResizePolicy() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 133, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__func__.updateDictResizePolicy, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.updateDictResizePolicy = [23 x i8] c"updateDictResizePolicy\00"
define void @updateDictResizePolicy() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 133, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__func__.updateDictResizePolicy, i64 0, i64 0))
ret void
}
void rte_prefetch0(const volatile void *p) {
  asm volatile("prefetcht0 %[p]" : : [p] "m"(*(const volatile char *)p));
}


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

x86 assembly (clang, -O2):
<rte_prefetch0>:
prefetcht0 (%rdi)
ret

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

LLVM IR (-O2):
define void @rte_prefetch0(i8* %0) {
tail call void asm sideeffect "prefetcht0 $0", "*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_bitmap();
int /*<<< orphan*/ test_len();
int main(void) {
  test_bitmap();
  test_len();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_bitmap@plt>
mov    $0x0,%al
call   1030 <test_len@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_bitmap()
%2 = call i32 (...) @test_len()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_bitmap()
%2 = tail call i32 (...) @test_len()
ret i32 0
}
void __attribute__((weak)) usart1_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<usart1_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usart1_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.usart1_isr = [11 x i8] c"usart1_isr\00"
define weak void @usart1_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.usart1_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.usart1_isr = [11 x i8] c"usart1_isr\00"
define weak void @usart1_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.usart1_isr, i64 0, i64 0))
ret void
}
void hal_bsp_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @hal_bsp_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *arg) {
  printf("Ftp site list convert.\n");
  printf("Usage: %s <input file name>\n", arg);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Ftp site list convert.\0A\00"
@.str.1 = [29 x i8] c"Usage: %s <input file name>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [29 x i8] c"Usage: %s <input file name>\0A\00"
@str = [23 x i8] c"Ftp site list convert.\00"
define void @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
unsigned getval_481() { return 2428668252U; }


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

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

LLVM IR (-O0):
define i32 @getval_481() {
ret i32 -1866299044
}

LLVM IR (-O2):
define i32 @getval_481() {
ret i32 -1866299044
}
/* Variables and functions */
int /*<<< orphan*/ Fish001();
int /*<<< orphan*/ Fish002();
int /*<<< orphan*/ Fish003();
int /*<<< orphan*/ Fish004();
int /*<<< orphan*/ Fish005();
int /*<<< orphan*/ Fish006();
int /*<<< orphan*/ Fish007();
int /*<<< orphan*/ Fish008();
int /*<<< orphan*/ Fish009();
void Fish_4(void) {
  Fish005();
  Fish004();
  Fish008();
  Fish003();
  Fish002();
  Fish007();
  Fish009();
  Fish001();
  Fish006();
}


x86 assembly (clang, -O0):
<Fish_4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Fish005@plt>
mov    $0x0,%al
call   10a0 <Fish004@plt>
mov    $0x0,%al
call   10b0 <Fish008@plt>
mov    $0x0,%al
call   1040 <Fish003@plt>
mov    $0x0,%al
call   1080 <Fish002@plt>
mov    $0x0,%al
call   1060 <Fish007@plt>
mov    $0x0,%al
call   1070 <Fish009@plt>
mov    $0x0,%al
call   1050 <Fish001@plt>
mov    $0x0,%al
call   1090 <Fish006@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fish_4>:
push   %rax
xor    %eax,%eax
call   1030 <Fish005@plt>
xor    %eax,%eax
call   10a0 <Fish004@plt>
xor    %eax,%eax
call   10b0 <Fish008@plt>
xor    %eax,%eax
call   1040 <Fish003@plt>
xor    %eax,%eax
call   1080 <Fish002@plt>
xor    %eax,%eax
call   1060 <Fish007@plt>
xor    %eax,%eax
call   1070 <Fish009@plt>
xor    %eax,%eax
call   1050 <Fish001@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <Fish006@plt>

LLVM IR (-O0):
define void @Fish_4() {
%1 = call i32 (...) @Fish005()
%2 = call i32 (...) @Fish004()
%3 = call i32 (...) @Fish008()
%4 = call i32 (...) @Fish003()
%5 = call i32 (...) @Fish002()
%6 = call i32 (...) @Fish007()
%7 = call i32 (...) @Fish009()
%8 = call i32 (...) @Fish001()
%9 = call i32 (...) @Fish006()
ret void
}

LLVM IR (-O2):
define void @Fish_4() {
%1 = tail call i32 (...) @Fish005()
%2 = tail call i32 (...) @Fish004()
%3 = tail call i32 (...) @Fish008()
%4 = tail call i32 (...) @Fish003()
%5 = tail call i32 (...) @Fish002()
%6 = tail call i32 (...) @Fish007()
%7 = tail call i32 (...) @Fish009()
%8 = tail call i32 (...) @Fish001()
%9 = tail call i32 (...) @Fish006()
ret void
}
unsigned char f95(unsigned char x, int y) {
  return (x << ((-y) & (8 * sizeof(unsigned char) - 1))) + (x >> y);
}


x86 assembly (clang, -O0):
<f95>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
movslq %ecx,%rcx
and    $0x7,%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f95>:
mov    %esi,%ecx
neg    %cl
and    $0x7,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f95(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = sext i32 %8 to i64
%10 = and i64 %9, 7
%11 = trunc i64 %10 to i32
%12 = shl i32 %6, %11
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = load i32, i32* %4
%16 = ashr i32 %14, %15
%17 = add nsw i32 %12, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @f95(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = sub nsw i32 0, %1
%5 = and i32 %4, 7
%6 = shl nuw nsw i32 %3, %5
%7 = lshr i32 %3, %1
%8 = add nuw nsw i32 %6, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}
/* Type definitions */
typedef unsigned long uint8_t;

/* Variables and functions */
void writePageNumber(uint8_t *fic_page_num, const unsigned long PAGE_NUM) {
  for (size_t i = 0; i < 3; i++) {
    fic_page_num[i] = PAGE_NUM >> (i * 8);
  }
}


x86 assembly (clang, -O0):
<writePageNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    114b <writePageNumber+0x4b>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
shl    $0x3,%rcx
shr    %cl,%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <writePageNumber+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<writePageNumber>:
mov    %rsi,(%rdi)
mov    %rsi,%rax
shr    $0x8,%rax
mov    %rax,0x8(%rdi)
shr    $0x10,%rsi
mov    %rsi,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @writePageNumber(i64* nocapture writeonly %0, i64 %1) {
store i64 %1, i64* %0
%3 = lshr i64 %1, 8
%4 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %3, i64* %4
%5 = lshr i64 %1, 16
%6 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %5, i64* %6
ret void
}
int my_ceil(int val, int div) { return (val + div - 1) / div; }


x86 assembly (clang, -O0):
<my_ceil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_ceil>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @my_ceil(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @my_ceil(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sdiv i32 %4, %1
ret i32 %5
}