xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(unsigned int);
char *nalloc(char *p, unsigned nbytes) {
  char *q, *r;
  q = r = malloc(nbytes);
  if (q == 0)
    return (0);
  while (nbytes--)
    *q++ = *p++;
  return (r);
}


x86 assembly (clang, -O0):
<nalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1147 <nalloc+0x37>
movq   $0x0,-0x8(%rbp)
jmp    118f <nalloc+0x7f>
jmp    114c <nalloc+0x3c>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1187 <nalloc+0x77>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    114c <nalloc+0x3c>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nalloc>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <nalloc+0x29>
test   %ebp,%ebp
je     1149 <nalloc+0x29>
mov    %ebp,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @nalloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i32, i32* %5
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %7
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i8* null, i8** %3
br label %26
13: ; preds = %2
br label %14
14: ; preds = %18, %13
%15 = load i32, i32* %5
%16 = add i32 %15, -1
store i32 %16, i32* %5
%17 = icmp ne i32 %15, 0
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %4
%21 = load i8, i8* %19
%22 = load i8*, i8** %6
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %6
store i8 %21, i8* %22
br label %14
24: ; preds = %14
%25 = load i8*, i8** %7
store i8* %25, i8** %3
br label %26
26: ; preds = %24, %12
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
define noalias i8* @nalloc(i8* nocapture %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = icmp eq i8* %3, null
%5 = icmp eq i32 %1, 0
%6 = or i1 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %2
ret i8* %3
}
int umax(int check, int ncheck) {
  if (check > ncheck)
    return check;
  return ncheck;
}


x86 assembly (clang, -O0):
<umax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <umax+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <umax+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @umax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char str[5];
  strcpy(str, "0123456789abcdef");
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789abcdef\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int INT_MIN;
int abs(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = INT_MIN;
  printf("a:%d, abs(%d)=%d\n", a, a, abs(a));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
mov    %edx,%ecx
neg    %ecx
cmovs  %edx,%ecx
lea    0xed8(%rip),%rdi
mov    %edx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@INT_MIN = global i32 0
@.str = [18 x i8] c"a:%d, abs(%d)=%d\0A\00"
define i32 @main() {
%1 = load i32, i32* @INT_MIN
%2 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ writeFile(char *);
int main() { writeFile("Blargh"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Blargh\00"
define i32 @main() {
%1 = call i32 @writeFile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Blargh\00"
define i32 @main() {
%1 = tail call i32 @writeFile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CodecWrapper_Pause(int /*<<< orphan*/);
void InstructCodec_Pause(void *rslObj) {
  ;
  CodecWrapper_Pause(0);
}


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

x86 assembly (clang, -O2):
<InstructCodec_Pause>:
xor    %edi,%edi
jmp    1030 <CodecWrapper_Pause@plt>

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

LLVM IR (-O2):
define void @InstructCodec_Pause(i8* nocapture readnone %0) {
%2 = tail call i32 @CodecWrapper_Pause(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void nids_no_mem(char *func) {
  fprintf(stderr, "Out of memory in %s.\n", func);
  exit(1);
}


x86 assembly (clang, -O0):
<nids_no_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nids_no_mem>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Out of memory in %s.\0A\00"
define void @nids_no_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Out of memory in %s.\0A\00"
define void @nids_no_mem(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x78() {
  Assert_real((isalnum(120)),
              "/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_isalnum.c",
              605, ("isalnum should be 1 for x"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x78>:
push   %rbp
mov    %rsp,%rbp
mov    $0x78,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x25d,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x78>:
push   %rax
mov    $0x78,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x25d,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for x\00"
define void @t_isalnum_0x78() {
%1 = call i32 @isalnum(i32 120)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 605, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for x\00"
define void @t_isalnum_0x78() {
%1 = tail call i32 @isalnum(i32 120)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 605, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int do_237() { return 237; }


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

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

LLVM IR (-O0):
define i32 @do_237() {
ret i32 237
}

LLVM IR (-O2):
define i32 @do_237() {
ret i32 237
}
/* Variables and functions */
int /*<<< orphan*/ atan2f(unsigned short, unsigned short);
unsigned short roundf(int /*<<< orphan*/);
unsigned short phase_fun_complexOf_ushort(unsigned a) {
  unsigned short re = (a >> 16);
  unsigned short im = (a & 0x0000ffff);
  if (re == 0 && im == 0)
    return 0;
  else
    return roundf(atan2f(im, re));
}


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

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

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

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


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

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

LLVM IR (-O0):
define i32 @sig2int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @sig2int(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gethostname(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *strchr(char *, char);
void get_hostname(char *buf) {
  char tmp[11];
  char *dot;
  gethostname(tmp, 11);
  dot = strchr(tmp, '.');
  tmp[dot - tmp] = 0;
  sprintf(buf, "\x06%s", tmp);
}


x86 assembly (clang, -O0):
<get_hostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x13(%rbp),%rdi
mov    $0xb,%esi
call   1040 <gethostname@plt>
lea    -0x13(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
lea    -0x13(%rbp),%rcx
sub    %rcx,%rax
movb   $0x0,-0x13(%rbp,%rax,1)
mov    -0x8(%rbp),%rdi
lea    -0x13(%rbp),%rdx
lea    0xe85(%rip),%rsi
call   1050 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hostname>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xd(%rsp),%r14
mov    %r14,%rdi
mov    $0xb,%esi
call   1040 <gethostname@plt>
mov    %r14,%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
movb   $0x0,(%rax)
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\06%s\00"
define void @get_hostname(i8* %0) {
%2 = alloca i8*
%3 = alloca [11 x i8]
%4 = alloca i8*
store i8* %0, i8** %2
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%6 = call i32 @gethostname(i8* %5, i32 11)
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%8 = call i8* @strchr(i8* %7, i8 signext 46)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
%14 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %2
%16 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%17 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\06%s\00"
define void @get_hostname(i8* nocapture writeonly %0) {
%2 = alloca [11 x i8]
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%4 = call i32 @gethostname(i8* %3, i32 11)
%5 = call i8* @strchr(i8* %3, i8 signext 46)
%6 = ptrtoint i8* %5 to i64
%7 = ptrtoint [11 x i8]* %2 to i64
%8 = sub i64 %6, %7
%9 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 %8
store i8 0, i8* %9
%10 = call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
__attribute__((unused)) char *strcpy(char *dest, char *src) {
  char *s = src;
  char *d = dest;
  while (d && s) {
    *d++ = *s;
    if (!*s)
      break;
    s++;
  }
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x21(%rbp)
je     1137 <strcpy+0x37>
cmpq   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1147 <strcpy+0x47>
jmp    1181 <strcpy+0x81>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1170 <strcpy+0x70>
jmp    1181 <strcpy+0x81>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <strcpy+0x1c>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
test   %rdi,%rdi
je     1131 <strcpy+0x31>
test   %rsi,%rsi
je     1131 <strcpy+0x31>
mov    (%rsi),%cl
mov    %cl,(%rax)
cmpb   $0x0,(%rsi)
je     1131 <strcpy+0x31>
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
cmpb   $0x0,(%rsi,%rcx,1)
lea    0x1(%rcx),%rcx
jne    1120 <strcpy+0x20>
ret

LLVM IR (-O0):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
store i8* %7, i8** %5
%8 = load i8*, i8** %3
store i8* %8, i8** %6
br label %9
9: ; preds = %26, %2
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i8*, i8** %5
%14 = icmp ne i8* %13, null
br label %15
15: ; preds = %12, %9
%16 = phi i1 [ false, %9 ], [ %14, %12 ]
br i1 %16, label %17, label %29
17: ; preds = %15
%18 = load i8*, i8** %5
%19 = load i8, i8* %18
%20 = load i8*, i8** %6
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %6
store i8 %19, i8* %20
%22 = load i8*, i8** %5
%23 = load i8, i8* %22
%24 = icmp ne i8 %23, 0
br i1 %24, label %26, label %25
25: ; preds = %17
br label %29
26: ; preds = %17
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %5
br label %9
29: ; preds = %25, %15
%30 = load i8*, i8** %3
ret i8* %30
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %18
6: ; preds = %2
%7 = load i8, i8* %1
store i8 %7, i8* %0
%8 = load i8, i8* %1
%9 = icmp eq i8 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %6, %10
%11 = phi i8* [ %14, %10 ], [ %1, %6 ]
%12 = phi i8* [ %13, %10 ], [ %0, %6 ]
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = getelementptr inbounds i8, i8* %11, i64 1
%15 = load i8, i8* %14
store i8 %15, i8* %13
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %10
18: ; preds = %10, %6, %2
ret i8* %0
}
/* Variables and functions */
scalar_t__ is_nan(double);
int count_nans(double *x, int n) {
  int i;
  int num_nans = 0;
  for (i = 0; i < n; i++) {
    num_nans += is_nan(x[i]);
  }
  return num_nans;
}


x86 assembly (clang, -O0):
<count_nans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1166 <count_nans+0x56>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <is_nan@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <count_nans+0x1d>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_nans>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1148 <count_nans+0x38>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%r14,%rbx,8),%xmm0
call   1030 <is_nan@plt>
add    %eax,%ebp
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <count_nans+0x20>
jmp    114a <count_nans+0x3a>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @count_nans(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %6
store i32 0, i32* %5
br label %7
7: ; preds = %22, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %25
11: ; preds = %7
%12 = load double*, double** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
%16 = load double, double* %15
%17 = call i64 @is_nan(double %16)
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = add nsw i64 %19, %17
%21 = trunc i64 %20 to i32
store i32 %21, i32* %6
br label %22
22: ; preds = %11
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %7
25: ; preds = %7
%26 = load i32, i32* %6
ret i32 %26
}

LLVM IR (-O2):
define i32 @count_nans(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %14, %6 ]
%8 = phi i32 [ 0, %4 ], [ %13, %6 ]
%9 = getelementptr inbounds double, double* %0, i64 %7
%10 = load double, double* %9
%11 = tail call i64 @is_nan(double %10)
%12 = trunc i64 %11 to i32
%13 = add i32 %8, %12
%14 = add nuw nsw i64 %7, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %16, label %6
16: ; preds = %6, %2
%17 = phi i32 [ 0, %2 ], [ %13, %6 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ const *);
struct tm *localtime_r(const time_t *t, struct tm *ptm) {
  struct tm *ptms = localtime(t);
  if (ptms) {
    *ptm = *ptms;
    return ptm;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<localtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1151 <localtime_r+0x41>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <localtime_r+0x49>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<localtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <localtime@plt>
test   %rax,%rax
je     1124 <localtime_r+0x14>
mov    (%rax),%eax
mov    %eax,(%rbx)
jmp    1126 <localtime_r+0x16>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* %0, %struct.tm* writeonly %1) {
%3 = tail call %struct.tm* @localtime(i32* %0)
%4 = icmp eq %struct.tm* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = getelementptr %struct.tm, %struct.tm* %3, i64 0, i32 0
%7 = getelementptr %struct.tm, %struct.tm* %1, i64 0, i32 0
%8 = load i32, i32* %6
store i32 %8, i32* %7
br label %9
9: ; preds = %2, %5
%10 = phi %struct.tm* [ %1, %5 ], [ null, %2 ]
ret %struct.tm* %10
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void int_destroy(void *daInt) {
  int *truc = daInt;
  free(truc);
}


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

x86 assembly (clang, -O2):
<int_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @int_destroy(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @free(i32* %2)
ret void
}
int test_imm_EFuint32_reg(unsigned int val) {
  return ((val) & (0xEF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EFuint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 239
%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_EFuint32_reg(i32 %0) {
%2 = and i32 %0, 239
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int gpioLedSet(int, int, int, int, int, int);
int ledAlways(int gpio, int on) {
  if (on)
    return gpioLedSet(gpio, 4000, 0, 1, 1, 4000);
  else
    return gpioLedSet(gpio, 0, 4000, 1, 1, 4000);
}


x86 assembly (clang, -O0):
<ledAlways>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114c <ledAlways+0x3c>
mov    -0x8(%rbp),%edi
mov    $0xfa0,%r9d
xor    %edx,%edx
mov    $0x1,%r8d
mov    %r9d,%esi
mov    %r8d,%ecx
call   1030 <gpioLedSet@plt>
mov    %eax,-0x4(%rbp)
jmp    116b <ledAlways+0x5b>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
mov    $0xfa0,%r9d
mov    $0x1,%r8d
mov    %r9d,%edx
mov    %r8d,%ecx
call   1030 <gpioLedSet@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ledAlways>:
test   %esi,%esi
je     111d <ledAlways+0xd>
mov    $0xfa0,%esi
xor    %edx,%edx
jmp    1124 <ledAlways+0x14>
xor    %esi,%esi
mov    $0xfa0,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
mov    $0xfa0,%r9d
jmp    1030 <gpioLedSet@plt>

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

LLVM IR (-O2):
define i32 @ledAlways(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @gpioLedSet(i32 %0, i32 4000, i32 0, i32 1, i32 1, i32 4000)
br label %8
6: ; preds = %2
%7 = tail call i32 @gpioLedSet(i32 %0, i32 0, i32 4000, i32 1, i32 1, i32 4000)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __gnttab_dma_map_page(struct page *);
void gnttab_dma_use_page(struct page *page) { __gnttab_dma_map_page(page); }


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

x86 assembly (clang, -O2):
<gnttab_dma_use_page>:
jmp    1030 <__gnttab_dma_map_page@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define void @gnttab_dma_use_page(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = load %struct.page*, %struct.page** %2
%4 = call i32 @__gnttab_dma_map_page(%struct.page* %3)
ret void
}

LLVM IR (-O2):
%struct.page = type { i32 }
define void @gnttab_dma_use_page(%struct.page* %0) {
%2 = tail call i32 @__gnttab_dma_map_page(%struct.page* %0)
ret void
}
void i86_cpu_shutdown() {}


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

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

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

LLVM IR (-O2):
define void @i86_cpu_shutdown() {
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  const char *wrk = str;
  int retval;
  for (retval = 0; *wrk != '\0'; wrk++)
    retval++;
  return retval;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <strlen+0x41>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <strlen+0x17>
movslq -0x14(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = zext i32 %7 to i64
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 0, %1 ], [ %12, %11 ]
ret i64 %14
}
int rtl839x_dma_if_rx_cur(int i) { return (0x782c) + (i << 2); }


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

x86 assembly (clang, -O2):
<rtl839x_dma_if_rx_cur>:
lea    0x782c(,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @rtl839x_dma_if_rx_cur(i32 %0) {
%2 = shl i32 %0, 2
%3 = add nsw i32 %2, 30764
ret i32 %3
}
void av_buffer_get_opaque() {}


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

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

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

LLVM IR (-O2):
define void @av_buffer_get_opaque() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XGCValues;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XGCValues(void) {
  XGCValues *_p = (XGCValues *)malloc(sizeof(XGCValues));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XGCValues>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XGCValues+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XGCValues>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XGCValues+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XGCValues() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XGCValues() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
imm0regx1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (22 <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0regx1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    $0x16,%eax
cmp    (%rcx,%rdx,4),%eax
ja     113a <imm0regx1+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <imm0regx1+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0regx1>:
movslq %ecx,%rcx
xor    %eax,%eax
cmpl   $0x16,(%r9,%rcx,4)
setae  %al
ret

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

LLVM IR (-O2):
define i32 @imm0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = icmp ugt i32 %9, 21
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ link(char *, char *);
int /*<<< orphan*/ symlink(char *, char *);
int main(void) {
  link("link", "link1");
  symlink("link1", "link2");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1040 <link@plt>
lea    0xebc(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1030 <symlink@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rbx
mov    %rbx,%rsi
call   1040 <link@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <symlink@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"link\00"
@.str.1 = [6 x i8] c"link1\00"
@.str.2 = [6 x i8] c"link2\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @link(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @symlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"link\00"
@.str.1 = [6 x i8] c"link1\00"
@.str.2 = [6 x i8] c"link2\00"
define i32 @main() {
%1 = tail call i32 @link(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @symlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cdoDefineZaxis(char *);
scalar_t__ getoptname(char *, char const *, int /*<<< orphan*/);
void defineZaxis(const char *zaxisarg) {
  char zaxisfile[4096];
  int nfile = 0;
  while (getoptname(zaxisfile, zaxisarg, nfile++) == 0) {
    (void)cdoDefineZaxis(zaxisfile);
  }
}


x86 assembly (clang, -O0):
<defineZaxis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x1014(%rbp)
lea    -0x1010(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x1014(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x1014(%rbp)
call   1030 <getoptname@plt>
cmp    $0x0,%rax
jne    1175 <defineZaxis+0x55>
lea    -0x1010(%rbp),%rdi
call   1040 <cdoDefineZaxis@plt>
jmp    1139 <defineZaxis+0x19>
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defineZaxis>:
push   %rbp
push   %r14
push   %rbx
sub    $0x1000,%rsp
mov    %rdi,%r14
mov    %rsp,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <getoptname@plt>
test   %rax,%rax
jne    116d <defineZaxis+0x4d>
mov    $0x1,%ebp
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <cdoDefineZaxis@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <getoptname@plt>
add    $0x1,%ebp
test   %rax,%rax
je     1150 <defineZaxis+0x30>
add    $0x1000,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @defineZaxis(i8* %0) {
%2 = alloca i8*
%3 = alloca [4096 x i8]
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
br label %5
5: ; preds = %12, %1
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
%10 = call i64 @getoptname(i8* %6, i8* %7, i32 %8)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %5
%13 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%14 = call i32 @cdoDefineZaxis(i8* %13)
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @defineZaxis(i8* %0) {
%2 = alloca [4096 x i8]
%3 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%4 = call i64 @getoptname(i8* %3, i8* %0, i32 0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1, %6
%7 = phi i32 [ %8, %6 ], [ 0, %1 ]
%8 = add nuw nsw i32 %7, 1
%9 = call i32 @cdoDefineZaxis(i8* %3)
%10 = call i64 @getoptname(i8* %3, i8* %0, i32 %8)
%11 = icmp eq i64 %10, 0
br i1 %11, label %6, label %12
12: ; preds = %6, %1
ret void
}
int lenOfNumber(long n) {
  int len = 1;
  while (n / 10 > 0) {
    n /= 10;
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<lenOfNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rax
jle    1147 <lenOfNumber+0x47>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <lenOfNumber+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lenOfNumber>:
mov    $0x1,%ecx
cmp    $0xa,%rdi
jl     1136 <lenOfNumber+0x36>
mov    $0x1,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
nopw   0x0(%rax,%rax,1)
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
add    $0x1,%ecx
cmp    $0x63,%rdi
mov    %rdx,%rdi
ja     1120 <lenOfNumber+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @lenOfNumber(i64 %0) {
%2 = icmp sgt i64 %0, 9
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i64 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = icmp ugt i64 %5, 99
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
void bioPendingJobsOfType(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",
               49, "Function '%s' is disabled.", __func__);
}


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

x86 assembly (clang, -O2):
<bioPendingJobsOfType>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x31,%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__.bioPendingJobsOfType = [21 x i8] c"bioPendingJobsOfType\00"
define void @bioPendingJobsOfType() {
%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 49, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.bioPendingJobsOfType, 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__.bioPendingJobsOfType = [21 x i8] c"bioPendingJobsOfType\00"
define void @bioPendingJobsOfType() {
%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 49, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.bioPendingJobsOfType, i64 0, i64 0))
ret void
}
unsigned char _SetGammaValue(unsigned char u8Channel, unsigned short u16Offset,
                             unsigned short u16GammaValue) {
  unsigned char bResult = 0;
  return bResult;
}


x86 assembly (clang, -O0):
<_SetGammaValue>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movb   $0x0,-0x7(%rbp)
movzbl -0x7(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @_SetGammaValue(i8 zeroext %0, i16 zeroext %1, i16 zeroext %2) {
ret i8 0
}
float paraMetrosPorSegundo(float v) { return v / 3.6; }


x86 assembly (clang, -O0):
<paraMetrosPorSegundo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<paraMetrosPorSegundo>:
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @paraMetrosPorSegundo(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 3.600000e+00
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @paraMetrosPorSegundo(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 3.600000e+00
%4 = fptrunc double %3 to float
ret float %4
}
int test_imm_A1int32_mem(int *val) {
  return ((*val) & (0xA1 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A1int32_mem>:
testb  $0xa1,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A1int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 161
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ is_normal_char(char);
char is_token_char(char c) { return !is_normal_char(c); }


x86 assembly (clang, -O0):
<is_token_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <is_normal_char@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_token_char>:
push   %rax
call   1030 <is_normal_char@plt>
test   %eax,%eax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @is_token_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @is_normal_char(i8 signext %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @is_token_char(i8 signext %0) {
%2 = tail call i32 @is_normal_char(i8 signext %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i8
ret i8 %4
}