xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sys_process(char const *, int, double, int, void *);
void syscall_entry_process(const char *modname, int pass, double clock, int cpu,
                           void *args) {
  sys_process(modname + 10, pass, clock, cpu, args);
}


x86 assembly (clang, -O0):
<syscall_entry_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xa,%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1030 <sys_process@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_entry_process>:
add    $0xa,%rdi
jmp    1030 <sys_process@plt>

LLVM IR (-O0):
define void @syscall_entry_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store double %2, double* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 10
%13 = load i32, i32* %7
%14 = load double, double* %8
%15 = load i32, i32* %9
%16 = load i8*, i8** %10
%17 = call i32 @sys_process(i8* %12, i32 %13, double %14, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
define void @syscall_entry_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4) {
%6 = getelementptr inbounds i8, i8* %0, i64 10
%7 = tail call i32 @sys_process(i8* %6, i32 %1, double %2, i32 %3, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void deallocate_buffer(void *buffer) { free(buffer); }


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

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

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

LLVM IR (-O2):
define void @deallocate_buffer(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
float copysignf(float, float);
float fabsf(float);
float ra_llr_min(float a, float b) {
  float c;
  c = a * b;
  a = fabsf(a);
  b = fabsf(b);
  a = a < b ? a : b;
  return copysignf(a, c);
}


x86 assembly (clang, -O0):
<ra_llr_min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xed7(%rip),%xmm1
pand   %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
movaps 0xec2(%rip),%xmm1
pand   %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1169 <ra_llr_min+0x69>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1173 <ra_llr_min+0x73>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movaps 0xe82(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xe67(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ra_llr_min>:
movaps %xmm0,%xmm2
mulss  %xmm1,%xmm2
movaps 0xef2(%rip),%xmm3
andps  %xmm3,%xmm0
andps  %xmm3,%xmm1
minss  %xmm1,%xmm0
andps  %xmm3,%xmm0
andnps %xmm2,%xmm3
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @ra_llr_min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fmul float %6, %7
store float %8, float* %5
%9 = load float, float* %3
%10 = call float @llvm.fabs.f32(float %9)
store float %10, float* %3
%11 = load float, float* %4
%12 = call float @llvm.fabs.f32(float %11)
store float %12, float* %4
%13 = load float, float* %3
%14 = load float, float* %4
%15 = fcmp olt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load float, float* %3
br label %20
18: ; preds = %2
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
store float %21, float* %3
%22 = load float, float* %3
%23 = load float, float* %5
%24 = call float @llvm.copysign.f32(float %22, float %23)
ret float %24
}

LLVM IR (-O2):
define float @ra_llr_min(float %0, float %1) {
%3 = fmul float %0, %1
%4 = tail call float @llvm.fabs.f32(float %0)
%5 = tail call float @llvm.fabs.f32(float %1)
%6 = fcmp olt float %4, %5
%7 = select i1 %6, float %4, float %5
%8 = tail call float @llvm.copysign.f32(float %7, float %3)
ret float %8
}
/* Variables and functions */
long DeleteOneRecordWithHMACAndECMAC(int);
long DeleteOneRecordWithHMACAndCircularECMAC(int id) {
  return DeleteOneRecordWithHMACAndECMAC(id);
}


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

x86 assembly (clang, -O2):
<DeleteOneRecordWithHMACAndCircularECMAC>:
jmp    1030 <DeleteOneRecordWithHMACAndECMAC@plt>

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

LLVM IR (-O2):
define i64 @DeleteOneRecordWithHMACAndCircularECMAC(i32 %0) {
%2 = tail call i64 @DeleteOneRecordWithHMACAndECMAC(i32 %0)
ret i64 %2
}
void getClientTypeByName(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",
               73, "Function '%s' is disabled.", __func__);
}


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

x86 assembly (clang, -O2):
<getClientTypeByName>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x49,%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__.getClientTypeByName = [20 x i8] c"getClientTypeByName\00"
define void @getClientTypeByName() {
%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 73, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.getClientTypeByName, 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__.getClientTypeByName = [20 x i8] c"getClientTypeByName\00"
define void @getClientTypeByName() {
%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 73, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.getClientTypeByName, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *shortestPalindrome(char *);
int main(int argc, char *argv[]) {
  printf("%s\n", shortestPalindrome(argv[1]));
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <shortestPalindrome@plt>
lea    0xecf(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i8* @shortestPalindrome(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
unsigned int movulsrb(unsigned int x) { return (x & 255) >> 1; }


x86 assembly (clang, -O0):
<movulsrb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shr    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<movulsrb>:
mov    %edi,%eax
shr    %eax
and    $0x7f,%eax
ret

LLVM IR (-O0):
define i32 @movulsrb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = lshr i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @movulsrb(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 127
ret i32 %3
}
const char *lw_msg_id_to_str(int msg_id) {
  switch (msg_id) {
  default:
    return "Unknown";
  }
}


x86 assembly (clang, -O0):
<lw_msg_id_to_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw_msg_id_to_str>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Unknown\00"
define i8* @lw_msg_id_to_str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"Unknown\00"
define i8* @lw_msg_id_to_str(i32 %0) {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ EV_CURRENT;
scalar_t__ EV_NONE;
scalar_t__ elf_version(int /*<<< orphan*/);
int main() {
  if (elf_version(EV_CURRENT) == EV_NONE) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <elf_version@plt>
mov    0x2ea4(%rip),%rcx
cmp    (%rcx),%rax
jne    1149 <main+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1150 <main+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <elf_version@plt>
mov    0x2eb2(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EV_CURRENT = global i32 0
@EV_NONE = global i64 0
define i32 @main() {
%1 = load i32, i32* @EV_CURRENT
%2 = tail call i64 @elf_version(i32 %1)
%3 = load i64, i64* @EV_NONE
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
size_t strlen(char const *);
int strncmp(char const *, char const *, size_t);
int hasPrefix(const char *str, const char *pre) {
  size_t lenpre = strlen(pre), lenstr = strlen(str);
  return lenstr < lenpre ? -1 : strncmp(pre, str, lenpre);
}


x86 assembly (clang, -O0):
<hasPrefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1165 <hasPrefix+0x45>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1179 <hasPrefix+0x59>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasPrefix>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
cmp    %rbx,%rax
jae    114e <hasPrefix+0x2e>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @hasPrefix(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = load i64, i64* %5
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %2
br label %20
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = load i8*, i8** %3
%18 = load i64, i64* %5
%19 = call i32 @strncmp(i8* %16, i8* %17, i64 %18)
br label %20
20: ; preds = %15, %14
%21 = phi i32 [ -1, %14 ], [ %19, %15 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @hasPrefix(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp ult i64 %4, %3
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @strncmp(i8* %1, i8* %0, i64 %3)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ -1, %2 ]
ret i32 %9
}
int f(int a, int b) {
  a = (a & ~(0xfffffull << 0)) | ((b << 0) & (0xfffffull << 0));
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
and    $0xfffffffffff00000,%rax
mov    -0x8(%rbp),%ecx
shl    $0x0,%ecx
movslq %ecx,%rcx
and    $0xfffff,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
and    $0xfff00000,%edi
and    $0xfffff,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = and i64 %6, -1048576
%8 = load i32, i32* %4
%9 = shl i32 %8, 0
%10 = sext i32 %9 to i64
%11 = and i64 %10, 1048575
%12 = or i64 %7, %11
%13 = trunc i64 %12 to i32
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = and i32 %0, -1048576
%4 = and i32 %1, 1048575
%5 = or i32 %4, %3
ret i32 %5
}
int Cyc_SlowDict_get_largest(void *x, void *y) { return 1; }


x86 assembly (clang, -O0):
<Cyc_SlowDict_get_largest>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Cyc_SlowDict_get_largest(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ test_function();
int main(void) {
  while (1) {
    test_function();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_function@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <test_function@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @test_function()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @test_function()
br label %1
}
int do_427() { return 427; }


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

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

LLVM IR (-O0):
define i32 @do_427() {
ret i32 427
}

LLVM IR (-O2):
define i32 @do_427() {
ret i32 427
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  struct timeval current_time;
  gettimeofday(&current_time, NULL);
  printf("seconds : %ld\n micro seconds : %ld\n", current_time.tv_sec,
         current_time.tv_usec);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    (%rsp),%edx
mov    0x4(%rsp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [36 x i8] c"seconds : %ld\0A micro seconds : %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
store i32 0, i32* %1
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@.str = [36 x i8] c"seconds : %ld\0A micro seconds : %ld\0A\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *getFileExt(const char *filename) {
  const char *dot = strrchr(filename, '.');
  if (!dot || dot == filename)
    return "";
  return dot + 1;
}


x86 assembly (clang, -O0):
<getFileExt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <getFileExt+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1157 <getFileExt+0x47>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <getFileExt+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @getFileExt(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9, %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
14: ; preds = %9
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %2
br label %17
17: ; preds = %14, %13
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @getFileExt(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = icmp eq i8* %2, %0
%5 = or i1 %3, %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %6
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ log_add_fmt(int, char *, char *);
int gpio(char *direction) {
  log_add_fmt(100, "gpio, direction: %s", direction);
  return 100;
}


x86 assembly (clang, -O0):
<gpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x64,%edi
lea    0xed4(%rip),%rsi
call   1030 <log_add_fmt@plt>
mov    $0x64,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rsi
mov    $0x64,%edi
call   1030 <log_add_fmt@plt>
mov    $0x64,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"gpio, direction: %s\00"
define i32 @gpio(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @log_add_fmt(i32 100, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 100
}

LLVM IR (-O2):
@.str = [20 x i8] c"gpio, direction: %s\00"
define i32 @gpio(i8* %0) {
%2 = tail call i32 @log_add_fmt(i32 100, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 100
}
void dist_barrier() { return; }


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

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

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

LLVM IR (-O2):
define void @dist_barrier() {
ret void
}
void test_one(int x) {
#pragma omp distribute
  for (int i = 0; i < x; i++)
    ;
}


x86 assembly (clang, -O0):
<test_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <test_one+0x2d>
jmp    111f <test_one+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <test_one+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_one(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_long_max_to_all(long *target, long *source, int nreduce,
                                  int PE_start, int logPE_stride, int PE_size,
                                  long *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_long_max_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_long_max_to_all(i64* %0, i64* %1, i32 %2, i32 %3, i32 %4, i32 %5, i64* %6, i64* %7) {
%9 = alloca i64*
%10 = alloca i64*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i64*
%16 = alloca i64*
store i64* %0, i64** %9
store i64* %1, i64** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i64* %6, i64** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_long_max_to_all(i64* nocapture readnone %0, i64* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i64* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double current_or_zero_math(double value, double last, bool absolute,
                            bool missing) {
  if (missing)
    if (absolute)
      return last;
    else
      return +0.0E+0;
  else
    return value;
}


x86 assembly (clang, -O0):
<current_or_zero_math>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1144 <current_or_zero_math+0x44>
cmpl   $0x0,-0x1c(%rbp)
je     1137 <current_or_zero_math+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114e <current_or_zero_math+0x4e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114e <current_or_zero_math+0x4e>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_or_zero_math>:
xorps  %xmm2,%xmm2
test   %edi,%edi
jne    110c <current_or_zero_math+0xc>
test   %esi,%esi
jne    1113 <current_or_zero_math+0x13>
ret
movaps %xmm1,%xmm2
test   %esi,%esi
je     110b <current_or_zero_math+0xb>
movaps %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @current_or_zero_math(double %0, double %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = icmp eq i32 %2, 0
%7 = select i1 %6, double 0.000000e+00, double %1
%8 = select i1 %5, double %0, double %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ USBUART_LoadEP0();
void USBUART_ControlReadDataStage(void) { USBUART_LoadEP0(); }


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

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

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

LLVM IR (-O2):
define void @USBUART_ControlReadDataStage() {
%1 = tail call i32 (...) @USBUART_LoadEP0()
ret void
}
/* Variables and functions */
int is_in_set(char, char *);
int is_gap(char x) { return (is_in_set(x, "-.#*~")); }


x86 assembly (clang, -O0):
<is_gap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rsi
movsbl -0x1(%rbp),%edi
call   1030 <is_in_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_gap>:
lea    0xee9(%rip),%rsi
jmp    1030 <is_in_set@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"-.#*~\00"
define i32 @is_gap(i8 signext %0) {
%2 = tail call i32 @is_in_set(i8 signext %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int mylib_aa();
int mylib_bb();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("aa() = %d", mylib_aa());
  printf("bb() = %d", mylib_bb());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <mylib_aa@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <mylib_bb@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <mylib_aa@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <mylib_bb@plt>
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"aa() = %d\00"
@.str.1 = [10 x i8] c"bb() = %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @mylib_aa()
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @mylib_bb()
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"aa() = %d\00"
@.str.1 = [10 x i8] c"bb() = %d\00"
define i32 @main() {
%1 = tail call i32 (...) @mylib_aa()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @mylib_bb()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
void TcclibInitialize() {}


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

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

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

LLVM IR (-O2):
define void @TcclibInitialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int logDebug(char *message) {
  if (1) {
    printf("[!] %s\n", message);
  }
}


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

x86 assembly (clang, -O2):
<logDebug>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"[!] %s\0A\00"
define i32 @logDebug(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(size_t);
void *realloc(void *optr, size_t size) {
  void *nptr = malloc(size);
  if (NULL != optr) {
    free(optr);
  }
  return nptr;
}


x86 assembly (clang, -O0):
<realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1152 <realloc+0x32>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     113f <realloc+0x1f>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @realloc(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void stop_count(void) {
  extern int sigalarm;
  sigalarm = 1;
}


x86 assembly (clang, -O0):
<stop_count>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_count>:
mov    0x2ed9(%rip),%rax
movl   $0x1,(%rax)
ret

LLVM IR (-O0):
@sigalarm = external global i32
define void @stop_count() {
store i32 1, i32* @sigalarm
ret void
}

LLVM IR (-O2):
@sigalarm = external global i32
define void @stop_count() {
store i32 1, i32* @sigalarm
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void _show_usage(const char *prog_name) {
  fprintf(stderr, "%s: cylinders headers sectors_per_track image_name\n",
          prog_name);
}


x86 assembly (clang, -O0):
<_show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_show_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"%s: cylinders headers sectors_per_track image_name\0A\00"
define void @_show_usage(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 ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"%s: cylinders headers sectors_per_track image_name\0A\00"
define void @_show_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void send() {
  for (;;) {
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <send+0x9>
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1119 <send+0x9>

x86 assembly (clang, -O2):
<send>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <send+0x10>

LLVM IR (-O0):
define void @send() {
br label %1
1: ; preds = %1, %0
%2 = call i32 @sleep(i32 1)
br label %1
}

LLVM IR (-O2):
define void @send() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
scalar_t__ ispunct(char);
scalar_t__ isspace(char);
int isseparator(char c) { return isspace(c) || ispunct(c); }


x86 assembly (clang, -O0):
<isseparator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <isseparator+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isseparator>:
push   %rbx
mov    %edi,%ebx
call   1040 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isseparator+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <ispunct@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isseparator(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isspace(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @ispunct(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isseparator(i8 signext %0) {
%2 = tail call i64 @isspace(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ispunct(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xbe() {
  Assert_real((islower(190) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              955, ("islower should be 0 for 0xbe"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xbe>:
push   %rax
mov    $0xbe,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3bb,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xbe\00"
define void @t_islower_0xbe() {
%1 = call i64 @islower(i32 190)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 955, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xbe\00"
define void @t_islower_0xbe() {
%1 = tail call i64 @islower(i32 190)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 955, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int tester(int);
void main() {
  int a = tester(17);
  printf("%d ---\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x11,%edi
call   1040 <tester@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x11,%edi
call   1040 <tester@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d ---\0A\00"
define void @main() {
%1 = tail call i32 @tester(i32 17)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct szl_obj {
  int dummy;
};
struct szl_interp {
  int dummy;
};

/* Variables and functions */
scalar_t__ szl_float_to_str(struct szl_interp *, struct szl_obj *);
scalar_t__ szl_str_to_code(struct szl_interp *, struct szl_obj *);
int szl_float_to_code(struct szl_interp *interp, struct szl_obj *obj) {
  return szl_float_to_str(interp, obj) && szl_str_to_code(interp, obj);
}


x86 assembly (clang, -O0):
<szl_float_to_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <szl_float_to_str@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1166 <szl_float_to_code+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <szl_str_to_code@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<szl_float_to_code>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <szl_float_to_str@plt>
test   %rax,%rax
je     114c <szl_float_to_code+0x2c>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <szl_str_to_code@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    114e <szl_float_to_code+0x2e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.szl_interp = type { i32 }
%struct.szl_obj = type { i32 }
define i32 @szl_float_to_code(%struct.szl_interp* %0, %struct.szl_obj* %1) {
%3 = alloca %struct.szl_interp*
%4 = alloca %struct.szl_obj*
store %struct.szl_interp* %0, %struct.szl_interp** %3
store %struct.szl_obj* %1, %struct.szl_obj** %4
%5 = load %struct.szl_interp*, %struct.szl_interp** %3
%6 = load %struct.szl_obj*, %struct.szl_obj** %4
%7 = call i64 @szl_float_to_str(%struct.szl_interp* %5, %struct.szl_obj* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load %struct.szl_interp*, %struct.szl_interp** %3
%11 = load %struct.szl_obj*, %struct.szl_obj** %4
%12 = call i64 @szl_str_to_code(%struct.szl_interp* %10, %struct.szl_obj* %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ false, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
%struct.szl_interp = type { i32 }
%struct.szl_obj = type { i32 }
define i32 @szl_float_to_code(%struct.szl_interp* %0, %struct.szl_obj* %1) {
%3 = tail call i64 @szl_float_to_str(%struct.szl_interp* %0, %struct.szl_obj* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @szl_str_to_code(%struct.szl_interp* %0, %struct.szl_obj* %1)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
void pthread_attr_getstack() {}


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

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

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

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

/* Variables and functions */
void c_pomp_init_lock_(omp_lock_t *s) { (void)0; }


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

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

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

LLVM IR (-O2):
define void @c_pomp_init_lock_(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AuxMagSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void AuxMagSettingsRequestUpdate() {
  UAVObjRequestUpdate(AuxMagSettingsHandle());
}


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

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

LLVM IR (-O0):
define void @AuxMagSettingsRequestUpdate() {
%1 = call i32 (...) @AuxMagSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AuxMagSettingsRequestUpdate() {
%1 = tail call i32 (...) @AuxMagSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ drop_nlink(struct inode *);
int /*<<< orphan*/ mark_inode_dirty(struct inode *);
__attribute__((always_)) void inode_dec_link_count(struct inode *inode) {
  drop_nlink(inode);
  mark_inode_dirty(inode);
}


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

x86 assembly (clang, -O2):
<inode_dec_link_count>:
push   %rbx
mov    %rdi,%rbx
call   1040 <drop_nlink@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <mark_inode_dirty@plt>

LLVM IR (-O0):
%struct.inode = type { i32 }
define void @inode_dec_link_count(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
%3 = load %struct.inode*, %struct.inode** %2
%4 = call i32 @drop_nlink(%struct.inode* %3)
%5 = load %struct.inode*, %struct.inode** %2
%6 = call i32 @mark_inode_dirty(%struct.inode* %5)
ret void
}

LLVM IR (-O2):
%struct.inode = type { i32 }
define void @inode_dec_link_count(%struct.inode* %0) {
%2 = tail call i32 @drop_nlink(%struct.inode* %0)
%3 = tail call i32 @mark_inode_dirty(%struct.inode* %0)
ret void
}
int t(int a, int b, int c) {
  if (a > 0 && b > 0 && c > 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1137 <t+0x37>
cmpl   $0x0,-0xc(%rbp)
jle    1137 <t+0x37>
cmpl   $0x0,-0x10(%rbp)
jle    1137 <t+0x37>
movl   $0x0,-0x4(%rbp)
jmp    113e <t+0x3e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
test   %edi,%edi
setle  %al
test   %esi,%esi
setle  %cl
or     %al,%cl
test   %edx,%edx
setle  %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @t(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
%5 = icmp sgt i32 %1, 0
%6 = and i1 %4, %5
%7 = icmp sgt i32 %2, 0
%8 = and i1 %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}