xunge/DecIR huggingface dataset:
/* Type definitions */
struct nlmsghdr {
  int dummy;
};
struct nlattr {
  int nla_len;
};

/* Variables and functions */
scalar_t__ nh_tail(struct nlmsghdr *);
void nlattr_end_nested(struct nlmsghdr *nh, struct nlattr *tail) {
  tail->nla_len = (char *)nh_tail(nh) - (char *)tail;
}


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

x86 assembly (clang, -O2):
<nlattr_end_nested>:
push   %rbx
mov    %rsi,%rbx
call   1030 <nh_tail@plt>
sub    %ebx,%eax
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.nlmsghdr = type { i32 }
%struct.nlattr = type { i32 }
define void @nlattr_end_nested(%struct.nlmsghdr* %0, %struct.nlattr* %1) {
%3 = alloca %struct.nlmsghdr*
%4 = alloca %struct.nlattr*
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %3
store %struct.nlattr* %1, %struct.nlattr** %4
%5 = load %struct.nlmsghdr*, %struct.nlmsghdr** %3
%6 = call i64 @nh_tail(%struct.nlmsghdr* %5)
%7 = inttoptr i64 %6 to i8*
%8 = load %struct.nlattr*, %struct.nlattr** %4
%9 = bitcast %struct.nlattr* %8 to i8*
%10 = ptrtoint i8* %7 to i64
%11 = ptrtoint i8* %9 to i64
%12 = sub i64 %10, %11
%13 = trunc i64 %12 to i32
%14 = load %struct.nlattr*, %struct.nlattr** %4
%15 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %14, i32 0, i32 0
store i32 %13, i32* %15
ret void
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i32 }
%struct.nlattr = type { i32 }
define void @nlattr_end_nested(%struct.nlmsghdr* %0, %struct.nlattr* %1) {
%3 = tail call i64 @nh_tail(%struct.nlmsghdr* %0)
%4 = ptrtoint %struct.nlattr* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %1, i64 0, i32 0
store i32 %6, i32* %7
ret void
}
feq(x) long long int x;
{
  if (x == 0)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<feq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <feq+0x1f>
movl   $0xd,-0x4(%rbp)
jmp    1126 <feq+0x26>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<feq>:
test   %rdi,%rdi
mov    $0xd,%ecx
mov    $0x8c,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @feq(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 13, i32* %2
br label %8
7: ; preds = %1
store i32 140, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @feq(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i32 13, i32 140
ret i32 %3
}
/* Variables and functions */
int foo(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("Success! foo(%d)=%d\n", 2, foo(2));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1040 <foo@plt>
lea    0xece(%rip),%rdi
mov    $0x2,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Success! foo(%d)=%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 2)
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 2, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Success! foo(%d)=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @foo(i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 2, i32 %1)
ret i32 0
}
/* Variables and functions */
double measure_plaquette_sf_weights(int);
double measure_wilson_action_sf(int t, double beta) {
  double plaquette;
  double wilson;
  plaquette = measure_plaquette_sf_weights(t);
  wilson = -(beta / (2. * 3.)) * plaquette;
  return wilson;
}


x86 assembly (clang, -O0):
<measure_wilson_action_sf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <measure_plaquette_sf_weights@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measure_wilson_action_sf>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <measure_plaquette_sf_weights@plt>
movsd  (%rsp),%xmm1
divsd  0xed8(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @measure_wilson_action_sf(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%7 = load i32, i32* %3
%8 = call double @measure_plaquette_sf_weights(i32 %7)
store double %8, double* %5
%9 = load double, double* %4
%10 = fdiv double %9, 6.000000e+00
%11 = fneg double %10
%12 = load double, double* %5
%13 = fmul double %11, %12
store double %13, double* %6
%14 = load double, double* %6
ret double %14
}

LLVM IR (-O2):
define double @measure_wilson_action_sf(i32 %0, double %1) {
%3 = tail call double @measure_plaquette_sf_weights(i32 %0)
%4 = fdiv double %1, -6.000000e+00
%5 = fmul double %4, %3
ret double %5
}
void cropmark_clear_cache() {}


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

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

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

LLVM IR (-O2):
define void @cropmark_clear_cache() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xaa() {
  Assert_real((ispunct(170) == 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_ispunct.c",
              855, ("ispunct should be 0 for 0xaa"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xaa>:
push   %rax
mov    $0xaa,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x357,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xaa\00"
define void @t_ispunct_0xaa() {
%1 = call i64 @ispunct(i32 170)
%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 855, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xaa\00"
define void @t_ispunct_0xaa() {
%1 = tail call i64 @ispunct(i32 170)
%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 855, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int umatch(s, p)
char *s, *p;
{
  if (*p == 0)
    return 1;
  while (*s)
    if (amatch(s++, p))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<umatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113c <umatch+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1189 <umatch+0x79>
jmp    1141 <umatch+0x31>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1182 <umatch+0x72>
mov    -0x10(%rbp),%rdi
mov    %rdi,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <amatch@plt>
cmp    $0x0,%eax
je     117d <umatch+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    1189 <umatch+0x79>
jmp    1141 <umatch+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umatch>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%r14d
cmpb   $0x0,(%rsi)
je     114f <umatch+0x3f>
mov    %rsi,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi)
je     114c <umatch+0x3c>
lea    0x1(%rdi),%rbp
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <amatch@plt>
mov    %rbp,%rdi
test   %eax,%eax
je     1130 <umatch+0x20>
jmp    114f <umatch+0x3f>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @umatch(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** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %25
11: ; preds = %2
br label %12
12: ; preds = %23, %11
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %4
%19 = load i8*, i8** %5
%20 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @amatch to i32 (i8*, i8*, ...)*)(i8* %17, i8* %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %16
store i32 1, i32* %3
br label %25
23: ; preds = %16
br label %12
24: ; preds = %12
store i32 0, i32* %3
br label %25
25: ; preds = %24, %22, %10
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @umatch(i8* %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @amatch to i32 (i8*, i8*, ...)*)(i8* %6, i8* %1)
%12 = icmp eq i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %5, %9, %2
%14 = phi i32 [ 1, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int openit();
int /*<<< orphan*/ read(int, unsigned char *, int);
int /*<<< orphan*/ write(int, unsigned char *, int);
int get(int addr) {
  unsigned char msg[2];
  int fd;
  fd = openit();
  msg[0] = addr;
  msg[1] = addr >> 8;
  write(fd, msg, 2);
  read(fd, msg, 1);
  close(fd);
  return msg[0];
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <openit@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x5(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x6(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
call   1050 <read@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
movzbl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <openit@plt>
mov    %eax,%ebp
mov    %bx,0x6(%rsp)
lea    0x6(%rsp),%rbx
mov    %eax,%edi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <read@plt>
mov    %ebp,%edi
call   1040 <close@plt>
movzbl 0x6(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (...) @openit()
store i32 %5, i32* %4
%6 = load i32, i32* %2
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %11, i8* %12
%13 = load i32, i32* %4
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%15 = call i32 @write(i32 %13, i8* %14, i32 2)
%16 = load i32, i32* %4
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%18 = call i32 @read(i32 %16, i8* %17, i32 1)
%19 = load i32, i32* %4
%20 = call i32 @close(i32 %19)
%21 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @get(i32 %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (...) @openit()
%5 = trunc i32 %0 to i8
store i8 %5, i8* %3
%6 = lshr i32 %0, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @write(i32 %4, i8* %3, i32 2)
%10 = call i32 @read(i32 %4, i8* %3, i32 1)
%11 = tail call i32 @close(i32 %4)
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ MADV_WILLNEED;
int madvise(void *, size_t, int /*<<< orphan*/);
size_t pageAlignLen(void *, size_t);
void *pageAlignStart(void *);
int sasMsyncBring(void *startAddr, size_t size) {
  void *alignAddr = pageAlignStart(startAddr);
  size_t alignSize = pageAlignLen(startAddr, size);
  return madvise(alignAddr, alignSize, MADV_WILLNEED);
}


x86 assembly (clang, -O0):
<sasMsyncBring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pageAlignStart@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <pageAlignLen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x2e73(%rip),%rax
mov    (%rax),%edx
call   1050 <madvise@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sasMsyncBring>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <pageAlignStart@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <pageAlignLen@plt>
mov    0x2e8b(%rip),%rcx
mov    (%rcx),%edx
mov    %r15,%rdi
mov    %rax,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <madvise@plt>

LLVM IR (-O0):
@MADV_WILLNEED = global i32 0
define i32 @sasMsyncBring(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = call i8* @pageAlignStart(i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i64 @pageAlignLen(i8* %9, i64 %10)
store i64 %11, i64* %6
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = load i32, i32* @MADV_WILLNEED
%15 = call i32 @madvise(i8* %12, i64 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
@MADV_WILLNEED = global i32 0
define i32 @sasMsyncBring(i8* %0, i64 %1) {
%3 = tail call i8* @pageAlignStart(i8* %0)
%4 = tail call i64 @pageAlignLen(i8* %0, i64 %1)
%5 = load i32, i32* @MADV_WILLNEED
%6 = tail call i32 @madvise(i8* %3, i64 %4, i32 %5)
ret i32 %6
}
char *strcpy(char *restrict s1, const char *restrict s2) {
  char *rc = s1;
  while ((*s1++ = *s2++))
    ;
  return rc;
}


x86 assembly (clang, -O0):
<strcpy>:
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,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
void INT_Excep_ICU_GROUPBL1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_GROUPBL1() {
ret void
}
/* Variables and functions */
unsigned int GET32(int);
unsigned int timer_tick(void) { return (GET32((0x20000000 + 0x0000B420))); }


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

x86 assembly (clang, -O2):
<timer_tick>:
mov    $0x2000b420,%edi
jmp    1030 <GET32@plt>

LLVM IR (-O0):
define i32 @timer_tick() {
%1 = call i32 @GET32(i32 536917024)
ret i32 %1
}

LLVM IR (-O2):
define i32 @timer_tick() {
%1 = tail call i32 @GET32(i32 536917024)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
void kill_snacache(char ***board) {
  free(*board);
  (*board) = NULL;
}


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

x86 assembly (clang, -O2):
<kill_snacache>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kill_snacache(i8*** nocapture %0) {
%2 = load i8**, i8*** %0
%3 = tail call i32 @free(i8** %2)
store i8** null, i8*** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putchar(int);
void cat_file(FILE *fp) {
  while (!feof(fp)) {
    int c = fgetc(fp);
    if (c == EOF)
      break;
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<cat_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115a <cat_file+0x2a>
jmp    118a <cat_file+0x5a>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e78(%rip),%rcx
cmp    (%rcx),%eax
jne    117d <cat_file+0x4d>
jmp    118a <cat_file+0x5a>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
jmp    113c <cat_file+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <feof@plt>
test   %eax,%eax
jne    1170 <cat_file+0x40>
mov    0x2ea1(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    (%r14),%eax
je     1170 <cat_file+0x40>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
je     1150 <cat_file+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @cat_file(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %16, %1
%5 = load i32*, i32** %2
%6 = call i32 @feof(i32* %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i32*, i32** %2
%11 = call i32 @fgetc(i32* %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %9
br label %19
16: ; preds = %9
%17 = load i32, i32* %3
%18 = call i32 @putchar(i32 %17)
br label %4
19: ; preds = %15, %4
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @cat_file(i32* nocapture %0) {
%2 = tail call i32 @feof(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1, %8
%5 = tail call i32 @fgetc(i32* %0)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = tail call i32 @putchar(i32 %5)
%10 = tail call i32 @feof(i32* %0)
%11 = icmp eq i32 %10, 0
br i1 %11, label %4, label %12
12: ; preds = %8, %4, %1
ret void
}
/* Variables and functions */
char getchar();
void readLine(char buffer[]) {
  char character;
  int i = 0;
  do {
    character = getchar();
    buffer[i] = character;
    ++i;
  } while (character != '\n');
  buffer[i - 1] = '\0';
}


x86 assembly (clang, -O0):
<readLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    1123 <readLine+0x13>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readLine>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %al,0x1(%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0xa,%al
jne    1120 <readLine+0x10>
mov    %ebx,%eax
movb   $0x0,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @readLine(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %6, %2 ], [ 0, %1 ]
%4 = tail call signext i8 (...) @getchar()
%5 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 %4, i8* %5
%6 = add nuw i64 %3, 1
%7 = icmp eq i8 %4, 10
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void setiopin(FILE *fp, int val) {
  fprintf(fp, "%d\n", val);
  fflush(fp);
}


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

x86 assembly (clang, -O2):
<setiopin>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @setiopin(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @fflush(i32* %0)
ret void
}
int _cmd_snd_ud_usr_data(struct m_l2 *l2, unsigned char mask) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.m_l2 = type opaque
define i32 @_cmd_snd_ud_usr_data(%struct.m_l2* nocapture readnone %0, i8 zeroext %1) {
ret i32 0
}
/* Type definitions */
struct search_worker {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ allocate_nnue_cache(struct search_worker *, int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ hash_nnue_clear_table(struct search_worker *);
int /*<<< orphan*/ hash_nnue_destroy_table(struct search_worker *);
void hash_nnue_create_table(struct search_worker *worker, int size) {
  assert(size >= 0);
  hash_nnue_destroy_table(worker);
  allocate_nnue_cache(worker, size);
  hash_nnue_clear_table(worker);
}


x86 assembly (clang, -O0):
<hash_nnue_create_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1060 <hash_nnue_destroy_table@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <allocate_nnue_cache@plt>
mov    -0x8(%rbp),%rdi
call   1030 <hash_nnue_clear_table@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_nnue_create_table>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
not    %edi
shr    $0x1f,%edi
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1060 <hash_nnue_destroy_table@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <allocate_nnue_cache@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <hash_nnue_clear_table@plt>

LLVM IR (-O0):
%struct.search_worker = type { i32 }
define void @hash_nnue_create_table(%struct.search_worker* %0, i32 %1) {
%3 = alloca %struct.search_worker*
%4 = alloca i32
store %struct.search_worker* %0, %struct.search_worker** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.search_worker*, %struct.search_worker** %3
%10 = call i32 @hash_nnue_destroy_table(%struct.search_worker* %9)
%11 = load %struct.search_worker*, %struct.search_worker** %3
%12 = load i32, i32* %4
%13 = call i32 @allocate_nnue_cache(%struct.search_worker* %11, i32 %12)
%14 = load %struct.search_worker*, %struct.search_worker** %3
%15 = call i32 @hash_nnue_clear_table(%struct.search_worker* %14)
ret void
}

LLVM IR (-O2):
%struct.search_worker = type { i32 }
define void @hash_nnue_create_table(%struct.search_worker* %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @hash_nnue_destroy_table(%struct.search_worker* %0)
%7 = tail call i32 @allocate_nnue_cache(%struct.search_worker* %0, i32 %1)
%8 = tail call i32 @hash_nnue_clear_table(%struct.search_worker* %0)
ret void
}
/* Type definitions */
struct ifreq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ifreq *);
void __dispose_req(struct ifreq **req) {
  if (req && *req) {
    free(*req);
    *req = 0;
  }
}


x86 assembly (clang, -O0):
<__dispose_req>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <__dispose_req+0x3c>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <__dispose_req+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dispose_req>:
push   %rbx
test   %rdi,%rdi
je     112d <__dispose_req+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <__dispose_req+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.ifreq = type { i32 }
define void @__dispose_req(%struct.ifreq** %0) {
%2 = alloca %struct.ifreq**
store %struct.ifreq** %0, %struct.ifreq*** %2
%3 = load %struct.ifreq**, %struct.ifreq*** %2
%4 = icmp ne %struct.ifreq** %3, null
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load %struct.ifreq**, %struct.ifreq*** %2
%7 = load %struct.ifreq*, %struct.ifreq** %6
%8 = icmp ne %struct.ifreq* %7, null
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load %struct.ifreq**, %struct.ifreq*** %2
%11 = load %struct.ifreq*, %struct.ifreq** %10
%12 = call i32 @free(%struct.ifreq* %11)
%13 = load %struct.ifreq**, %struct.ifreq*** %2
store %struct.ifreq* null, %struct.ifreq** %13
br label %14
14: ; preds = %9, %5, %1
ret void
}

LLVM IR (-O2):
%struct.ifreq = type { i32 }
define void @__dispose_req(%struct.ifreq** %0) {
%2 = icmp eq %struct.ifreq** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load %struct.ifreq*, %struct.ifreq** %0
%5 = icmp eq %struct.ifreq* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(%struct.ifreq* %4)
store %struct.ifreq* null, %struct.ifreq** %0
br label %8
8: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void storage_close() { printf("Finishing storage!\n"); }


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Finishing storage!\00"
define void @storage_close() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
double eval_div(double x, double y) { return x / y; }


x86 assembly (clang, -O0):
<eval_div>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_div>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @eval_div(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 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @eval_div(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Variables and functions */
int foo();
int extern_foo(void) { return foo(); }


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

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

LLVM IR (-O0):
define i32 @extern_foo() {
%1 = call i32 (...) @foo()
ret i32 %1
}

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

/* Variables and functions */
int /*<<< orphan*/ pthread_cancel_gettid(int /*<<< orphan*/);
int pthread_cancel_tkill(int /*<<< orphan*/, int);
int __wrap_pthread_kill(pthread_t thd, int sig) {
  return pthread_cancel_tkill(pthread_cancel_gettid(thd), sig);
}


x86 assembly (clang, -O0):
<__wrap_pthread_kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <pthread_cancel_gettid@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1030 <pthread_cancel_tkill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_pthread_kill>:
push   %rbx
mov    %esi,%ebx
call   1040 <pthread_cancel_gettid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <pthread_cancel_tkill@plt>

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

LLVM IR (-O2):
define i32 @__wrap_pthread_kill(i32 %0, i32 %1) {
%3 = tail call i32 @pthread_cancel_gettid(i32 %0)
%4 = tail call i32 @pthread_cancel_tkill(i32 %3, i32 %1)
ret i32 %4
}
void mk20dx256_gpo_port_c_off(unsigned int pin) {
  *((volatile unsigned int *)0x400FF080) &= ~(1 << pin);
}


x86 assembly (clang, -O0):
<mk20dx256_gpo_port_c_off>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    $0x400ff080,%ecx
mov    (%rcx),%ecx
and    %eax,%ecx
mov    $0x400ff080,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk20dx256_gpo_port_c_off>:
mov    %edi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,0x400ff080
ret

LLVM IR (-O0):
define void @mk20dx256_gpo_port_c_off(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = xor i32 %4, -1
%6 = load volatile i32, i32* inttoptr (i64 1074786432 to i32*)
%7 = and i32 %6, %5
store volatile i32 %7, i32* inttoptr (i64 1074786432 to i32*)
ret void
}

LLVM IR (-O2):
define void @mk20dx256_gpo_port_c_off(i32 %0) {
%2 = shl nuw i32 1, %0
%3 = xor i32 %2, -1
%4 = load volatile i32, i32* inttoptr (i64 1074786432 to i32*)
%5 = and i32 %4, %3
store volatile i32 %5, i32* inttoptr (i64 1074786432 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TestSerialC__Boot__booted();
void RealMainP__Boot__booted(void) { TestSerialC__Boot__booted(); }


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

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

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

LLVM IR (-O2):
define void @RealMainP__Boot__booted() {
%1 = tail call i32 (...) @TestSerialC__Boot__booted()
ret void
}
void test_g0(int *x, float *y) {
  g0(y);
  g0(x);
}


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

x86 assembly (clang, -O2):
<test_g0>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <g0@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <g0@plt>

LLVM IR (-O0):
define void @test_g0(i32* %0, float* %1) {
%3 = alloca i32*
%4 = alloca float*
store i32* %0, i32** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = call i32 (float*, ...) bitcast (i32 (...)* @g0 to i32 (float*, ...)*)(float* %5)
%7 = load i32*, i32** %3
%8 = call i32 (i32*, ...) bitcast (i32 (...)* @g0 to i32 (i32*, ...)*)(i32* %7)
ret void
}

LLVM IR (-O2):
define void @test_g0(i32* %0, float* %1) {
%3 = tail call i32 (float*, ...) bitcast (i32 (...)* @g0 to i32 (float*, ...)*)(float* %1)
%4 = tail call i32 (i32*, ...) bitcast (i32 (...)* @g0 to i32 (i32*, ...)*)(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ gpio_write_and_close(int, int);
int /*<<< orphan*/ spi_byte_send_8(int, int /*<<< orphan*/);
int spi_init(int /*<<< orphan*/, int, int);
void screen_ssd1306_send_data(uint8_t data) {
  int dev = spi_init(0, 8, 25000);
  gpio_write_and_close(19, 1);
  spi_byte_send_8(dev, data);
}


x86 assembly (clang, -O0):
<screen_ssd1306_send_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
mov    $0x8,%esi
mov    $0x61a8,%edx
call   1040 <spi_init@plt>
mov    %eax,-0x8(%rbp)
mov    $0x13,%edi
mov    $0x1,%esi
call   1030 <gpio_write_and_close@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <spi_byte_send_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_ssd1306_send_data>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %edi,%edi
mov    $0x8,%esi
mov    $0x61a8,%edx
call   1040 <spi_init@plt>
mov    %eax,%ebp
mov    $0x13,%edi
mov    $0x1,%esi
call   1030 <gpio_write_and_close@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <spi_byte_send_8@plt>

LLVM IR (-O0):
define void @screen_ssd1306_send_data(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @spi_init(i32 0, i32 8, i32 25000)
store i32 %4, i32* %3
%5 = call i32 @gpio_write_and_close(i32 19, i32 1)
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = call i32 @spi_byte_send_8(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @screen_ssd1306_send_data(i32 %0) {
%2 = tail call i32 @spi_init(i32 0, i32 8, i32 25000)
%3 = tail call i32 @gpio_write_and_close(i32 19, i32 1)
%4 = tail call i32 @spi_byte_send_8(i32 %2, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kernel_main();
void jump(void) { kernel_main(); }


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

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

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

LLVM IR (-O2):
define void @jump() {
%1 = tail call i32 (...) @kernel_main()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IOMEM(int);
int __raw_readb(int /*<<< orphan*/);
int ts72xx_model(void) { return __raw_readb(IOMEM(0xfebff000)) & 0x07; }


x86 assembly (clang, -O0):
<ts72xx_model>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfebff000,%edi
call   1040 <IOMEM@plt>
mov    %eax,%edi
call   1030 <__raw_readb@plt>
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts72xx_model>:
push   %rax
mov    $0xfebff000,%edi
call   1040 <IOMEM@plt>
mov    %eax,%edi
call   1030 <__raw_readb@plt>
and    $0x7,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ts72xx_model() {
%1 = call i32 @IOMEM(i32 -20975616)
%2 = call i32 @__raw_readb(i32 %1)
%3 = and i32 %2, 7
ret i32 %3
}

LLVM IR (-O2):
define i32 @ts72xx_model() {
%1 = tail call i32 @IOMEM(i32 -20975616)
%2 = tail call i32 @__raw_readb(i32 %1)
%3 = and i32 %2, 7
ret i32 %3
}
int interpolator_double_vector_compare(void const *a, void const *b) {
  return (*(double *)a - *(double *)b);
}


x86 assembly (clang, -O0):
<interpolator_double_vector_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolator_double_vector_compare>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @interpolator_double_vector_compare(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 double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = fptosi double %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @interpolator_double_vector_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glPixelTransferf(int /*<<< orphan*/, int /*<<< orphan*/);
void PixelTransferf(GLenum pname, GLfloat param) {
  glPixelTransferf(pname, param);
}


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

x86 assembly (clang, -O2):
<PixelTransferf>:
jmp    1030 <glPixelTransferf@plt>

LLVM IR (-O0):
define void @PixelTransferf(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 @glPixelTransferf(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @PixelTransferf(i32 %0, i32 %1) {
%3 = tail call i32 @glPixelTransferf(i32 %0, i32 %1)
ret void
}
int dummy(void) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ Interpolate_3(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int /*<<< orphan*/, int, int);
uint32_t Interp9(uint32_t c1, uint32_t c2, uint32_t c3) {
  return Interpolate_3(c1, 2, c2, 3, c3, 3, 3);
}


x86 assembly (clang, -O0):
<Interp9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
mov    $0x2,%esi
mov    $0x3,%r9d
mov    %r9d,%ecx
movl   $0x3,(%rsp)
call   1030 <Interpolate_3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp9>:
push   %rax
mov    %edx,%r8d
mov    %esi,%edx
movl   $0x3,(%rsp)
mov    $0x2,%esi
mov    $0x3,%ecx
mov    $0x3,%r9d
call   1030 <Interpolate_3@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Interp9(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 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @Interpolate_3(i32 %7, i32 2, i32 %8, i32 3, i32 %9, i32 3, i32 3)
ret i32 %10
}

LLVM IR (-O2):
define i32 @Interp9(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Interpolate_3(i32 %0, i32 2, i32 %1, i32 3, i32 %2, i32 3, i32 3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ AUTH;

/* Variables and functions */
int FALSE;
int authnone_refresh(AUTH *client) { return (FALSE); }


x86 assembly (clang, -O0):
<authnone_refresh>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@FALSE = global i32 0
define i32 @authnone_refresh(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @FALSE
ret i32 %3
}

LLVM IR (-O2):
@FALSE = global i32 0
define i32 @authnone_refresh(i32* nocapture readnone %0) {
%2 = load i32, i32* @FALSE
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_machine_id() {
  printf("NOT IMPLEMENTED:"
         "pa_machine_id"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"NOT IMPLEMENTED:pa_machine_id\0A\00"
define i32 @pa_machine_id() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_machine_id\00"
define i32 @pa_machine_id() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int CSPL_Sort_comparedoubles(const void *a, const void *b) {
  const double *da = (const double *)a;
  const double *db = (const double *)b;
  return (*da > *db) - (*da < *db);
}


x86 assembly (clang, -O0):
<CSPL_Sort_comparedoubles>:
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
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
movsd  (%rcx),%xmm1
mov    -0x20(%rbp),%rcx
movsd  (%rcx),%xmm0
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @CSPL_Sort_comparedoubles(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
%9 = fcmp olt double %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}