xunge/DecIR huggingface dataset:
void EFlash_ErasePage(unsigned int waddr) {
  *(unsigned int *)(0x40009000 + 0x028) = waddr;
  ;
  *(unsigned int *)(0x40009000 + 0x014) = (1 << 2);
  ;
  while ((*(volatile unsigned int *)(0x40009000 + 0x018) & 1) == 1)
    ;
}


x86 assembly (clang, -O0):
<EFlash_ErasePage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x40009028,%eax
mov    %ecx,(%rax)
mov    $0x40009014,%eax
movl   $0x4,(%rax)
mov    $0x40009018,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1134 <EFlash_ErasePage+0x34>
jmp    111c <EFlash_ErasePage+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EFlash_ErasePage>:
mov    %edi,0x40009028
movl   $0x4,0x40009014
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x40009018,%eax
test   $0x1,%al
jne    1120 <EFlash_ErasePage+0x20>
ret

LLVM IR (-O0):
define void @EFlash_ErasePage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* inttoptr (i64 1073778728 to i32*)
store i32 4, i32* inttoptr (i64 1073778708 to i32*)
br label %4
4: ; preds = %8, %1
%5 = load volatile i32, i32* inttoptr (i64 1073778712 to i32*)
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @EFlash_ErasePage(i32 %0) {
store i32 %0, i32* inttoptr (i64 1073778728 to i32*)
store i32 4, i32* inttoptr (i64 1073778708 to i32*)
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 1073778712 to i32*)
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("unknown\n");
  exit(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"unknown\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"unknown\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(void const *);
size_t hash_string(const void *string) {
  const char *str = (const char *)string;
  register size_t hash = 5381;
  assert(string);
  while (*str) {
    hash = (hash << 5) + hash + *str++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x1505,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <hash_string+0x5d>
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
add    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1135 <hash_string+0x25>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    (%rbx),%cl
test   %cl,%cl
je     114e <hash_string+0x3e>
add    $0x1,%rbx
mov    $0x1505,%eax
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <hash_string+0x20>
pop    %rbx
ret
mov    $0x1505,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @hash_string(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %13, %5 ], [ %3, %1 ]
%7 = phi i64 [ %12, %5 ], [ 5381, %1 ]
%8 = phi i8* [ %10, %5 ], [ %0, %1 ]
%9 = mul i64 %7, 33
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = sext i8 %6 to i64
%12 = add i64 %9, %11
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %1
%16 = phi i64 [ 5381, %1 ], [ %12, %5 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ error(int);
scalar_t__ ioctl(int, int, void *);
void Ioctl(int fd, int request, void *argp) {
  if (ioctl(fd, request, argp) < 0)
    error(fd);
}


x86 assembly (clang, -O0):
<Ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1153 <Ioctl+0x33>
mov    -0x4(%rbp),%edi
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ioctl>:
push   %rbx
mov    %edi,%ebx
call   1030 <ioctl@plt>
test   %rax,%rax
js     112f <Ioctl+0xf>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1040 <error@plt>

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

LLVM IR (-O2):
define void @Ioctl(i32 %0, i32 %1, i8* %2) {
%4 = tail call i64 @ioctl(i32 %0, i32 %1, i8* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error(i32 %0)
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
float expf(float);
float gb_exp(float x) { return expf(x); }


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

x86 assembly (clang, -O2):
<gb_exp>:
jmp    1030 <expf@plt>

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

LLVM IR (-O2):
define float @gb_exp(float %0) {
%2 = tail call float @expf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x78() {
  Assert_real((isbdigit(120) == 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_isbdigit.c",
              605, ("isbdigit should be 0 for x"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x78>:
push   %rax
mov    $0x78,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x25d,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for x\00"
define void @t_isbdigit_0x78() {
%1 = call i64 @isbdigit(i32 120)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 605, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for x\00"
define void @t_isbdigit_0x78() {
%1 = tail call i64 @isbdigit(i32 120)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 605, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.regulator = type opaque
define i32 @regulator_set_voltage(%struct.regulator* %0, i32 %1, i32 %2) {
%4 = alloca %struct.regulator*
%5 = alloca i32
%6 = alloca i32
store %struct.regulator* %0, %struct.regulator** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.regulator = type opaque
define i32 @regulator_set_voltage(%struct.regulator* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
int gl2psPrintPDFCompressorType(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gl2psPrintPDFCompressorType() {
ret i32 0
}
/* Variables and functions */
int IFF_RUNNING;
int IFF_UP;
int set_if_flag(char *, int, int /*<<< orphan*/);
int if_down(char *ifname) {
  return set_if_flag(ifname, IFF_UP | IFF_RUNNING, 0);
}


x86 assembly (clang, -O0):
<if_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
or     (%rax),%esi
xor    %edx,%edx
call   1030 <set_if_flag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_down>:
mov    0x2ec9(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
xor    %edx,%edx
jmp    1030 <set_if_flag@plt>

LLVM IR (-O0):
@IFF_UP = global i32 0
@IFF_RUNNING = global i32 0
define i32 @if_down(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @IFF_UP
%5 = load i32, i32* @IFF_RUNNING
%6 = or i32 %4, %5
%7 = call i32 @set_if_flag(i8* %3, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
@IFF_UP = global i32 0
@IFF_RUNNING = global i32 0
define i32 @if_down(i8* %0) {
%2 = load i32, i32* @IFF_UP
%3 = load i32, i32* @IFF_RUNNING
%4 = or i32 %3, %2
%5 = tail call i32 @set_if_flag(i8* %0, i32 %4, i32 0)
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ sleep_until(scalar_t__);
scalar_t__ time(int /*<<< orphan*/);
void sleep_for(time_t interval) { sleep_until(time(0) + interval); }


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

x86 assembly (clang, -O2):
<sleep_for>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
add    %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <sleep_until@plt>

LLVM IR (-O0):
define void @sleep_for(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 @time(i32 0)
%4 = load i64, i64* %2
%5 = add nsw i64 %3, %4
%6 = call i32 @sleep_until(i64 %5)
ret void
}

LLVM IR (-O2):
define void @sleep_for(i64 %0) {
%2 = tail call i64 @time(i32 0)
%3 = add nsw i64 %2, %0
%4 = tail call i32 @sleep_until(i64 %3)
ret void
}
extern void link_error(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ edie(char *);
scalar_t__ sched_setaffinity(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
void setaffinity(int core) {
  cpu_set_t cpuset;
  CPU_ZERO(&cpuset);
  CPU_SET(core, &cpuset);
  if (sched_setaffinity(0, sizeof(cpuset), &cpuset) < 0)
    edie("setaffinity, sched_setaffinity failed");
}


x86 assembly (clang, -O0):
<setaffinity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <CPU_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1060 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setaffinity@plt>
cmp    $0x0,%rax
jge    1186 <setaffinity+0x46>
lea    0xe7f(%rip),%rdi
call   1040 <edie@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setaffinity>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <CPU_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1060 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    %r14,%rdx
call   1030 <sched_setaffinity@plt>
test   %rax,%rax
jns    117d <setaffinity+0x3d>
lea    0xe88(%rip),%rdi
call   1040 <edie@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [38 x i8] c"setaffinity, sched_setaffinity failed\00"
define void @setaffinity(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @CPU_ZERO(i32* %2)
%5 = call i32 @CPU_SET(i32 %0, i32* %2)
%6 = call i64 @sched_setaffinity(i32 0, i32 4, i32* %2)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @edie(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ get_line(char *, int /*<<< orphan*/ *);
char *fifo_get(FILE *input_pipe) {
  static char string[1024];
  if (get_line(string, input_pipe))
    return string;
  else
    return (char *)0;
}


x86 assembly (clang, -O0):
<fifo_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0x2f19(%rip),%rdi
call   1030 <get_line@plt>
cmp    $0x0,%rax
je     1146 <fifo_get+0x36>
lea    0x2f03(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <fifo_get+0x3e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifo_get>:
push   %rbx
mov    %rdi,%rsi
lea    0x2f25(%rip),%rbx
mov    %rbx,%rdi
call   1030 <get_line@plt>
test   %rax,%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@fifo_get.string = internal global [1024 x i8] zeroinitializer
define i8* @fifo_get(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i64 @get_line(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @fifo_get.string, i64 0, i64 0), i32* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @fifo_get.string, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* null, i8** %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@fifo_get.string = internal global [1024 x i8] zeroinitializer
define i8* @fifo_get(i32* %0) {
%2 = tail call i64 @get_line(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @fifo_get.string, i64 0, i64 0), i32* %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @fifo_get.string, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
double abs(double);
double calculoModuloAB(double raizA, double raizB) {
  return abs(raizA - raizB);
}


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

x86 assembly (clang, -O2):
<calculoModuloAB>:
subsd  %xmm1,%xmm0
jmp    1030 <abs@plt>

LLVM IR (-O0):
define double @calculoModuloAB(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 = fsub double %5, %6
%8 = call double @abs(double %7)
ret double %8
}

LLVM IR (-O2):
define double @calculoModuloAB(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @abs(double %3)
ret double %4
}
/* Variables and functions */
scalar_t__ posix_read_write_test();
scalar_t__ stdc_read_write_test();
int read_write_test(void) {
  if (stdc_read_write_test()) {
    return -1;
  }
  if (posix_read_write_test()) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<read_write_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <stdc_read_write_test@plt>
cmp    $0x0,%rax
je     1145 <read_write_test+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <read_write_test+0x49>
mov    $0x0,%al
call   1030 <posix_read_write_test@plt>
cmp    $0x0,%rax
je     1162 <read_write_test+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <read_write_test+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_write_test>:
push   %rax
xor    %eax,%eax
call   1040 <stdc_read_write_test@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1137 <read_write_test+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <posix_read_write_test@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @read_write_test() {
%1 = tail call i64 (...) @stdc_read_write_test()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @posix_read_write_test()
%5 = icmp ne i64 %4, 0
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ -1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int f174(int *);
int f175(int *p) { return f174(p); }


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

x86 assembly (clang, -O2):
<f175>:
jmp    1030 <f174@plt>

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

LLVM IR (-O2):
define i32 @f175(i32* %0) {
%2 = tail call i32 @f174(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ v_kset(int, char const *, int);
int v_lookup(int, char const *);
int v_set(int vs, const char *name, const char *value, int pos) {
  int key = v_lookup(vs, name);
  v_kset(key, value, pos);
  return key;
}


x86 assembly (clang, -O0):
<v_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <v_lookup@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <v_kset@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_set>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
call   1040 <v_lookup@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <v_kset@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @v_set(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i32 @v_lookup(i32 %10, i8* %11)
store i32 %12, i32* %9
%13 = load i32, i32* %9
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @v_kset(i32 %13, i8* %14, i32 %15)
%17 = load i32, i32* %9
ret i32 %17
}

LLVM IR (-O2):
define i32 @v_set(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @v_lookup(i32 %0, i8* %1)
%6 = tail call i32 @v_kset(i32 %5, i8* %2, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_load_sd(double const *);
__m128d test_mm_load_sd(double const *A) { return _mm_load_sd(A); }


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

x86 assembly (clang, -O2):
<test_mm_load_sd>:
jmp    1030 <_mm_load_sd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_load_sd(double* %0) {
%2 = tail call i32 @_mm_load_sd(double* %0)
ret i32 %2
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
int /*<<< orphan*/ EPERM;
int /*<<< orphan*/ errno;
int seteuid(uid_t euid) {
  if (euid == 1)
    return 0;
  errno = EPERM;
  return -1;
}


x86 assembly (clang, -O0):
<seteuid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <seteuid+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1136 <seteuid+0x36>
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb3(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seteuid>:
xor    %eax,%eax
cmp    $0x1,%edi
je     111e <seteuid+0x1e>
mov    0x2ec2(%rip),%rax
mov    (%rax),%eax
mov    0x2ec9(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@EPERM = global i32 0
@errno = global i32 0
define i32 @seteuid(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* @EPERM
store i32 %4, i32* @errno
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ -1, %3 ], [ 0, %1 ]
ret i32 %6
}
unsigned int _enHash(char *str) {
  unsigned int hash = 5381;
  unsigned int retHash;
  int c;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  retHash = hash % 128000;
  return retHash;
}


x86 assembly (clang, -O0):
<_enHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1141 <_enHash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <_enHash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x1f400,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_enHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113d <_enHash+0x3d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <_enHash+0x10>
mov    %eax,%ecx
imul   $0x10624dd3,%rcx,%rcx
shr    $0x2d,%rcx
imul   $0x1f400,%ecx,%ecx
sub    %ecx,%eax
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @_enHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %11, 128000
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 5381, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
void finally(void) {
  char buf[sizeof(int)];
  fprintf(stderr, "\nPress <ENTER> to terminate...");
  fgets(buf, sizeof(buf), stdin);
}


x86 assembly (clang, -O0):
<finally>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1040 <fprintf@plt>
lea    -0x4(%rbp),%rdi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%esi
call   1030 <fgets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finally>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <fgets@plt>
pop    %rax
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"\0APress <ENTER> to terminate...\00"
@stdin = global i32 0
define void @finally() {
%1 = alloca [4 x i8]
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 4, i32 %5)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"\0APress <ENTER> to terminate...\00"
@stdin = global i32 0
define void @finally() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %2, i32 4, i32 %5)
ret void
}
int gcd(int a, int b) {
  int c;
  c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1139 <gcd+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
jmp    1114 <gcd+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1120 <gcd+0x20>
nopl   0x0(%rax)
mov    %edx,%ecx
mov    %esi,%eax
cltd
idiv   %ecx
mov    %ecx,%esi
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %3, %2 ]
%7 = phi i32 [ %6, %5 ], [ %1, %2 ]
%8 = srem i32 %7, %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i32 [ %1, %2 ], [ %6, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int stub1(char *, char const *, ...);
void tst_adr(int (*fp)(char *, const char *, ...)) {
  char buf[10];
  (*fp)(buf, "%.0f", 5.0);
  printf("tst_adr %s\n", buf);
}


x86 assembly (clang, -O0):
<tst_adr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x12(%rbp),%rdi
lea    0xedd(%rip),%rsi
movsd  0xecd(%rip),%xmm0
mov    $0x1,%al
call   *%rcx
lea    -0x12(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_adr>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rcx
lea    0xee9(%rip),%rsi
lea    0x6(%rsp),%rbx
movsd  0xed4(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   *%rcx
lea    0xed3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.0f\00"
@.str.1 = [12 x i8] c"tst_adr %s\0A\00"
define void @tst_adr(i32 (i8*, i8*, ...)* %0) {
%2 = alloca i32 (i8*, i8*, ...)*
%3 = alloca [10 x i8]
store i32 (i8*, i8*, ...)* %0, i32 (i8*, i8*, ...)** %2
%4 = load i32 (i8*, i8*, ...)*, i32 (i8*, i8*, ...)** %2
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = call i32 (i8*, i8*, ...) %4(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 5.000000e+00)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.0f\00"
@.str.1 = [12 x i8] c"tst_adr %s\0A\00"
define void @tst_adr(i32 (i8*, i8*, ...)* nocapture %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) %0(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 5.000000e+00)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int *relSearch16Bit(char *, char *, int);
int *relSearch8Bit(char *, char *);
int *relSearch(char *filePath, char *strToSearch, int bits, bool bigEndian) {
  if (bits == 8) {
    return relSearch8Bit(filePath, strToSearch);
  } else {
    return relSearch16Bit(filePath, strToSearch, bigEndian);
  }
}


x86 assembly (clang, -O0):
<relSearch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jne    1156 <relSearch+0x36>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <relSearch8Bit@plt>
mov    %rax,-0x8(%rbp)
jmp    116a <relSearch+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1040 <relSearch16Bit@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<relSearch>:
cmp    $0x8,%edx
jne    112a <relSearch+0xa>
jmp    1030 <relSearch8Bit@plt>
mov    %ecx,%edx
jmp    1040 <relSearch16Bit@plt>

LLVM IR (-O0):
define i32* @relSearch(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %8
%11 = icmp eq i32 %10, 8
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = call i32* @relSearch8Bit(i8* %13, i8* %14)
store i32* %15, i32** %5
br label %21
16: ; preds = %4
%17 = load i8*, i8** %6
%18 = load i8*, i8** %7
%19 = load i32, i32* %9
%20 = call i32* @relSearch16Bit(i8* %17, i8* %18, i32 %19)
store i32* %20, i32** %5
br label %21
21: ; preds = %16, %12
%22 = load i32*, i32** %5
ret i32* %22
}

LLVM IR (-O2):
define i32* @relSearch(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, 8
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32* @relSearch8Bit(i8* %0, i8* %1)
br label %10
8: ; preds = %4
%9 = tail call i32* @relSearch16Bit(i8* %0, i8* %1, i32 %3)
br label %10
10: ; preds = %8, %6
%11 = phi i32* [ %7, %6 ], [ %9, %8 ]
ret i32* %11
}
/* Variables and functions */
float cblas_sasum(int const, float const *, int const);
float c_sasum(const int N, const float *X, const int stride) {
  return cblas_sasum(N, X, stride);
}


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

x86 assembly (clang, -O2):
<c_sasum>:
jmp    1030 <cblas_sasum@plt>

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

LLVM IR (-O2):
define float @c_sasum(i32 %0, float* %1, i32 %2) {
%4 = tail call float @cblas_sasum(i32 %0, float* %1, i32 %2)
ret float %4
}
/* Variables and functions */
double atof(int /*<<< orphan*/);
int /*<<< orphan*/ option(char *, char *, char *);
double option_double(char *opt, char *dflt, char *descr) {
  return atof(option(opt, dflt, descr));
}


x86 assembly (clang, -O0):
<option_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <option@plt>
mov    %eax,%edi
call   1030 <atof@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @option_double(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @option(i8* %7, i8* %8, i8* %9)
%11 = call double @atof(i32 %10)
ret double %11
}

LLVM IR (-O2):
define double @option_double(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @option(i8* %0, i8* %1, i8* %2)
%5 = tail call double @atof(i32 %4)
ret double %5
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int64_t cfs_stub_removexattr(const char *path, const char *name) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<cfs_stub_removexattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfs_stub_removexattr>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @cfs_stub_removexattr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @cfs_stub_removexattr(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
void av_guess_codec() {}


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

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

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

LLVM IR (-O2):
define void @av_guess_codec() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ someFunction(int *, int /*<<< orphan*/, int);
int main(void) {
  int a[10] = {8, 3, 1, 2, 6, 0, 9, 7, 4, 5};
  printf("Answer is:\n");
  someFunction(a, 0, 10);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <someFunction@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <someFunction@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 8, i32 3, i32 1, i32 2, i32 6, i32 0, i32 9, i32 7, i32 4, i32 5]
@.str = [12 x i8] c"Answer is:\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i32 @someFunction(i32* %5, i32 0, i32 10)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 8, i32 3, i32 1, i32 2, i32 6, i32 0, i32 9, i32 7, i32 4, i32 5]
@str = [11 x i8] c"Answer is:\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @someFunction(i32* %4, i32 0, i32 10)
%6 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
size_t base64_encoded_len(size_t decoded_len) {
  return ((4u * decoded_len / 3u) + 3u) & ~3u;
}


x86 assembly (clang, -O0):
<base64_encoded_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
add    $0x3,%rax
movabs $0xfffffffc,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encoded_len>:
lea    0x0(,%rdi,4),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
shr    %rdx
lea    0x3(%rdx),%eax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i64 @base64_encoded_len(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 4, %3
%5 = udiv i64 %4, 3
%6 = add i64 %5, 3
%7 = and i64 %6, 4294967292
ret i64 %7
}

LLVM IR (-O2):
define i64 @base64_encoded_len(i64 %0) {
%2 = shl i64 %0, 2
%3 = udiv i64 %2, 3
%4 = add nuw nsw i64 %3, 3
%5 = and i64 %4, 4294967292
ret i64 %5
}
__attribute__((always_)) int zone_span_seqretry(struct zone *zone,
                                                unsigned iv) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.zone = type opaque
define i32 @zone_span_seqretry(%struct.zone* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mystrcat(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char dest[100] = "Hello, ";
  mystrcat(dest, "World!");
  printf("%s\n", dest);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rdi
lea    0xf05(%rip),%rsi
call   1050 <mystrcat@plt>
lea    -0x70(%rbp),%rsi
lea    0xefc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
movaps 0xf24(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf08(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe98(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0xee9(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <mystrcat@plt>
lea    0xede(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.dest = [100 x i8] c"Hello, \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [7 x i8] c"World!\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = bitcast [100 x i8]* %2 to i8*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @mystrcat(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.dest = [100 x i8] c"Hello, \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [7 x i8] c"World!\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @mystrcat(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ ENOENT;
scalar_t__ errno;
int execvp(char *, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void exec_child(char **argv) {
  int r = execvp(*argv, argv);
  if (r == -1) {
    perror("executing command");
    exit(errno == ENOENT ? 127 : 126);
  }
}


x86 assembly (clang, -O0):
<exec_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <execvp@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    118e <exec_child+0x5e>
lea    0xea0(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%rcx
mov    0x2e5a(%rip),%rax
mov    (%rax),%rdx
mov    $0x7e,%edi
mov    $0x7f,%eax
cmp    %rdx,%rcx
cmove  %eax,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_child>:
push   %rax
mov    %rdi,%rsi
mov    (%rdi),%rdi
call   1040 <execvp@plt>
cmp    $0xffffffff,%eax
je     1143 <exec_child+0x13>
pop    %rax
ret
lea    0xeb6(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%rax
mov    0x2e70(%rip),%rcx
xor    %edi,%edi
cmp    (%rcx),%rax
sete   %dil
or     $0x7e,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"executing command\00"
@errno = global i64 0
@ENOENT = global i64 0
define void @exec_child(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %2
%7 = call i32 @execvp(i8* %5, i8** %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %18
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%12 = load i64, i64* @errno
%13 = load i64, i64* @ENOENT
%14 = icmp eq i64 %12, %13
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 127, i32 126
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"executing command\00"
@errno = global i64 0
@ENOENT = global i64 0
define void @exec_child(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @execvp(i8* %2, i8** %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = load i64, i64* @errno
%8 = load i64, i64* @ENOENT
%9 = icmp eq i64 %7, %8
%10 = select i1 %9, i32 127, i32 126
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
ret void
}