xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ free(void *);
void *malloc(unsigned int);
void *realloc(void *, int /*<<< orphan*/);
int main() {
  void *ptr = malloc(1U);
  if (!ptr)
    return EXIT_FAILURE;
  void *tmp = realloc(ptr, 0);
  if (tmp)
    free(tmp);
  free(tmp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1169 <main+0x39>
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1195 <main+0x65>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     118c <main+0x5c>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1168 <main+0x38>
xor    %ebp,%ebp
mov    %rax,%rdi
xor    %esi,%esi
call   1050 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115e <main+0x2e>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    1171 <main+0x41>
mov    0x2e71(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = load i32, i32* @EXIT_FAILURE
br label %12
5: ; preds = %0
%6 = tail call i8* @realloc(i8* %1, i32 0)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @free(i8* %6)
br label %10
10: ; preds = %8, %5
%11 = tail call i32 @free(i8* %6)
br label %12
12: ; preds = %10, %3
%13 = phi i32 [ 0, %10 ], [ %4, %3 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_free(int /*<<< orphan*/ *);
void BIO_vfree(BIO *a) { BIO_free(a); }


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

x86 assembly (clang, -O2):
<BIO_vfree>:
jmp    1030 <BIO_free@plt>

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

LLVM IR (-O2):
define void @BIO_vfree(i32* %0) {
%2 = tail call i32 @BIO_free(i32* %0)
ret void
}
void foo_2_2_2_1_1_1_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_1_1_2_2_2() {
ret void
}
/* Variables and functions */
int O_APPEND;
int O_CREAT;
int O_WRONLY;
void *doOpen(char const *, int);
void *__PHYSFS_platformOpenAppend(const char *filename) {
  return doOpen(filename, O_WRONLY | O_CREAT | O_APPEND);
}


x86 assembly (clang, -O0):
<__PHYSFS_platformOpenAppend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
or     (%rax),%esi
mov    0x2e8f(%rip),%rax
or     (%rax),%esi
call   1030 <doOpen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__PHYSFS_platformOpenAppend>:
mov    0x2eb9(%rip),%rax
mov    0x2eda(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9f(%rip),%rax
or     (%rax),%esi
jmp    1030 <doOpen@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_APPEND = global i32 0
define i8* @__PHYSFS_platformOpenAppend(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_WRONLY
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = load i32, i32* @O_APPEND
%8 = or i32 %6, %7
%9 = call i8* @doOpen(i8* %3, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_APPEND = global i32 0
define i8* @__PHYSFS_platformOpenAppend(i8* %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = load i32, i32* @O_APPEND
%6 = or i32 %4, %5
%7 = tail call i8* @doOpen(i8* %0, i32 %6)
ret i8* %7
}
/* Variables and functions */
size_t noto_malloced(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @noto_malloced() {
ret i64 0
}

LLVM IR (-O2):
define i64 @noto_malloced() {
ret i64 0
}
const char *pico_mqtt_get_protocol_version(void) { return "3.1.1"; }


x86 assembly (clang, -O0):
<pico_mqtt_get_protocol_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"3.1.1\00"
define i8* @pico_mqtt_get_protocol_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"3.1.1\00"
define i8* @pico_mqtt_get_protocol_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
char cbasic(char *a, char b, char *c) { return a[0] = b + c[0] + c[1]; }


x86 assembly (clang, -O0):
<cbasic>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
movsbl -0x9(%rbp),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    -0x18(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbasic>:
mov    %esi,%eax
add    (%rdx),%al
add    0x1(%rdx),%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define signext i8 @cbasic(i8* %0, i8 signext %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* %5
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %6
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %8, %12
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = add nsw i32 %13, %17
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 0
store i8 %19, i8* %21
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @cbasic(i8* nocapture writeonly %0, i8 signext %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = add i8 %4, %1
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = add i8 %5, %7
store i8 %8, i8* %0
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void weakfunc(void) { puts("I am a weak function."); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"I am a weak function.\00"
define void @weakfunc() {
%1 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"I am a weak function.\00"
define void @weakfunc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int I2CMasterBusy(unsigned int baseAdd) {
  return ((*((volatile unsigned int *)(baseAdd + (0xA4)))) & (0x00000400u));
}


x86 assembly (clang, -O0):
<I2CMasterBusy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa4,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x400,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterBusy>:
add    $0xa4,%edi
mov    $0x400,%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @I2CMasterBusy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 164
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 1024
ret i32 %8
}

LLVM IR (-O2):
define i32 @I2CMasterBusy(i32 %0) {
%2 = add i32 %0, 164
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 1024
ret i32 %6
}
int hIndex(int *citations, int citationsSize) {
  int cnt = 0;
  int size = citationsSize;
  for (int i = 0; i < size; i++) {
    cnt = size - i;
    if (citations[i] >= cnt) {
      return cnt;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<hIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1166 <hIndex+0x66>
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jl     1153 <hIndex+0x53>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <hIndex+0x6d>
jmp    1158 <hIndex+0x58>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111f <hIndex+0x1f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hIndex>:
xor    %eax,%eax
test   %esi,%esi
jle    1122 <hIndex+0x22>
mov    %esi,%ecx
nopl   0x0(%rax,%rax,1)
movslq (%rdi),%rdx
cmp    %rdx,%rcx
jle    1123 <hIndex+0x23>
add    $0x4,%rdi
add    $0xffffffffffffffff,%rcx
jne    1110 <hIndex+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hIndex(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %19
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %19, label %9
9: ; preds = %4, %7
%10 = phi i64 [ 0, %4 ], [ %16, %7 ]
%11 = sub nsw i64 %5, %10
%12 = getelementptr inbounds i32, i32* %0, i64 %10
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = icmp sgt i64 %11, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9
%18 = trunc i64 %11 to i32
br label %19
19: ; preds = %7, %17, %2
%20 = phi i32 [ 0, %2 ], [ %18, %17 ], [ 0, %7 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ console_nprint(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void console_print(const char *str) { console_nprint(str, strlen(str)); }


x86 assembly (clang, -O0):
<console_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <console_nprint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_print>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <console_nprint@plt>

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

LLVM IR (-O2):
define void @console_print(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @console_nprint(i8* %0, i32 %2)
ret void
}
int equal(float x, float y) {
  float diff = x - y;
  if (diff < 0.001 && diff > -0.001) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    115f <equal+0x5f>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    115f <equal+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    1166 <equal+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xef0(%rip),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
ucomisd 0xee9(%rip),%xmm0
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @equal(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fsub float %7, %8
store float %9, float* %6
%10 = load float, float* %6
%11 = fpext float %10 to double
%12 = fcmp olt double %11, 1.000000e-03
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load float, float* %6
%15 = fpext float %14 to double
%16 = fcmp ogt double %15, -1.000000e-03
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1, i32* %3
br label %19
18: ; preds = %13, %2
store i32 0, i32* %3
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @equal(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fpext float %3 to double
%5 = fcmp olt double %4, 1.000000e-03
%6 = fcmp ogt double %4, -1.000000e-03
%7 = and i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void negate_bits(char buff[]) {
  int i = 0;
  while (buff[i] != '\n') {
    char a = buff[i];
    buff[i] = ~a;
    ++i;
  }
}


x86 assembly (clang, -O0):
<negate_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     1154 <negate_bits+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <negate_bits+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<negate_bits>:
mov    (%rdi),%al
cmp    $0xa,%al
je     1120 <negate_bits+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
not    %al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
cmp    $0xa,%al
jne    1110 <negate_bits+0x10>
ret

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

LLVM IR (-O2):
define void @negate_bits(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 10
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = xor i8 %6, -1
store i8 %8, i8* %7
%9 = add nuw nsw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 10
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ EAGAIN;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *);
pid_t fork(void) {
  printf("fork\n");
  errno = EAGAIN;
  return -1;
}


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    0x2eb3(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"fork\0A\00"
@EAGAIN = global i32 0
@errno = global i32 0
define i32 @fork() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EAGAIN
store i32 %2, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EAGAIN = global i32 0
@errno = global i32 0
@str = [5 x i8] c"fork\00"
define i32 @fork() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EAGAIN
store i32 %2, i32* @errno
ret i32 -1
}
unsigned char _stdin_hook_default(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @_stdin_hook_default() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @_stdin_hook_default() {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedYX0(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op99M1X0(void) { STA8(AbsoluteIndexedYX0(2)); }


x86 assembly (clang, -O0):
<Op99M1X0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <AbsoluteIndexedYX0@plt>
mov    %eax,%edi
call   1040 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op99M1X0>:
push   %rax
mov    $0x2,%edi
call   1030 <AbsoluteIndexedYX0@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STA8@plt>

LLVM IR (-O0):
define void @Op99M1X0() {
%1 = call i32 @AbsoluteIndexedYX0(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op99M1X0() {
%1 = tail call i32 @AbsoluteIndexedYX0(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void wrapped_fred(int a, int b) { printf("wrapped fred(%d, %d)\n", a, b); }


x86 assembly (clang, -O0):
<wrapped_fred>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapped_fred>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"wrapped fred(%d, %d)\0A\00"
define void @wrapped_fred(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"wrapped fred(%d, %d)\0A\00"
define void @wrapped_fred(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, double);
void setenv_double(char *tag, double d) {
  char env[32];
  sprintf(env, "%f", d);
  setenv(tag, env, 1);
}


x86 assembly (clang, -O0):
<setenv_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setenv_double>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
lea    0xecf(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define void @setenv_double(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca [32 x i8]
store i8* %0, i8** %3
store double %1, double* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load double, double* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%11 = call i32 @setenv(i8* %9, i8* %10, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @setenv_double(i8* %0, double %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %1)
%6 = call i32 @setenv(i8* %0, i8* %4, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int main(int argc, char const *argv[]) {
  if (1 < 2) {
    perror("soloooo");
    exit(EXIT_FAILURE);
  }
  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)
lea    0xec3(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [8 x i8] c"soloooo\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"soloooo\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void skip_space(const char **sp) {
  const char *s = *sp;
  while (((*s) == '\t' || (*s) == '\n' || (*s) == '\r' || (*s) == ' '))
    s++;
  *sp = s;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x11(%rbp)
je     1162 <skip_space+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x11(%rbp)
je     1162 <skip_space+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x11(%rbp)
je     1162 <skip_space+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1172 <skip_space+0x72>
jmp    1183 <skip_space+0x83>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <skip_space+0x13>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
mov    (%rdi),%rax
movabs $0x100002600,%rcx
nopl   (%rax)
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1125 <skip_space+0x25>
bt     %rdx,%rcx
jae    1125 <skip_space+0x25>
add    $0x1,%rax
jmp    1110 <skip_space+0x10>
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @skip_space(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %2, %1 ], [ %7, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 9, label %6
i8 10, label %6
i8 13, label %6
i8 32, label %6
]
6: ; preds = %3, %3, %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3
store i8* %4, i8** %0
ret void
}
/* Variables and functions */
char *expand_envvars(char const *, int /*<<< orphan*/);
char *replace_tilde(char *const);
char *expand_path(const char path[]) {
  char *const expanded_envvars = expand_envvars(path, 0);
  return replace_tilde(expanded_envvars);
}


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

x86 assembly (clang, -O2):
<expand_path>:
push   %rax
xor    %esi,%esi
call   1040 <expand_envvars@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <replace_tilde@plt>

LLVM IR (-O0):
define i8* @expand_path(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @expand_envvars(i8* %4, i32 0)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @replace_tilde(i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @expand_path(i8* %0) {
%2 = tail call i8* @expand_envvars(i8* %0, i32 0)
%3 = tail call i8* @replace_tilde(i8* %2)
ret i8* %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int is_littleendian() {
  uint32_t v = 0x01234567;
  return ((*((uint8_t *)(&v))) == 0x67);
}


x86 assembly (clang, -O0):
<is_littleendian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1234567,-0x4(%rbp)
cmpl   $0x67,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_littleendian() {
%1 = alloca i32
store i32 19088743, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 103
%4 = zext i1 %3 to i32
ret i32 %4
}

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

/* Variables and functions */
void radio_df_iq_data_packet_set(uint8_t *buffer, size_t len) {}


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

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

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

LLVM IR (-O2):
define void @radio_df_iq_data_packet_set(i32* nocapture %0, i64 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int);
void c_fseek_(FILE **stream, long *offset, int *whence) {
  fseek(*stream, *offset, *whence);
}


x86 assembly (clang, -O0):
<c_fseek_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_fseek_>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
mov    (%rdx),%edx
jmp    1030 <fseek@plt>

LLVM IR (-O0):
define void @c_fseek_(i32** %0, i64* %1, i32* %2) {
%4 = alloca i32**
%5 = alloca i64*
%6 = alloca i32*
store i32** %0, i32*** %4
store i64* %1, i64** %5
store i32* %2, i32** %6
%7 = load i32**, i32*** %4
%8 = load i32*, i32** %7
%9 = load i64*, i64** %5
%10 = load i64, i64* %9
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = call i32 @fseek(i32* %8, i64 %10, i32 %12)
ret void
}

LLVM IR (-O2):
define void @c_fseek_(i32** nocapture %0, i64* nocapture %1, i32* nocapture %2) {
%4 = load i32*, i32** %0
%5 = load i64, i64* %1
%6 = load i32, i32* %2
%7 = tail call i32 @fseek(i32* %4, i64 %5, i32 %6)
ret void
}
/* Variables and functions */
char *getenv_thr_safe(void *);
int /*<<< orphan*/ printf(char *, void *, char *, char *);
scalar_t__ pthread_self();
void *thr_fn(void *arg) {
  char *var = getenv_thr_safe(arg);
  printf("[%p]: %s = %s\n", (void *)pthread_self(), (char *)arg, var);
  return NULL;
}


x86 assembly (clang, -O0):
<thr_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv_thr_safe@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fn>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getenv_thr_safe@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb3(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"[%p]: %s = %s\0A\00"
define i8* @thr_fn(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv_thr_safe(i8* %4)
store i8* %5, i8** %3
%6 = call i64 (...) @pthread_self()
%7 = inttoptr i64 %6 to i8*
%8 = load i8*, i8** %2
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
ret i8* null
}

LLVM IR (-O2):
@.str = [15 x i8] c"[%p]: %s = %s\0A\00"
define noalias i8* @thr_fn(i8* %0) {
%2 = tail call i8* @getenv_thr_safe(i8* %0)
%3 = tail call i64 (...) @pthread_self()
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %0, i8* %2)
ret i8* null
}
/* Variables and functions */
scalar_t__ FP_NAN;
scalar_t__ fpclassify(double);
int isnan(double x) { return fpclassify(x) == FP_NAN; }


x86 assembly (clang, -O0):
<isnan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fpclassify@plt>
mov    0x2eba(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnan>:
push   %rax
call   1030 <fpclassify@plt>
mov    0x2ecb(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FP_NAN = global i64 0
define i32 @isnan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @fpclassify(double %3)
%5 = load i64, i64* @FP_NAN
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@FP_NAN = global i64 0
define i32 @isnan(double %0) {
%2 = tail call i64 @fpclassify(double %0)
%3 = load i64, i64* @FP_NAN
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int bell_duration;
};
typedef TYPE_1__ XKeyboardControl;

/* Variables and functions */
void set_XKeyboardControl_bell_duration(void *_p, int _v) {
  ((XKeyboardControl *)_p)->bell_duration = (int)_v;
}


x86 assembly (clang, -O0):
<set_XKeyboardControl_bell_duration>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XKeyboardControl_bell_duration>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeyboardControl_bell_duration(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyboardControl_bell_duration(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_xslt_comment_entities();
int /*<<< orphan*/ test_xslt_comments();
void all_xslt_tests() {
  test_xslt_comments();
  test_xslt_comment_entities();
}


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

x86 assembly (clang, -O2):
<all_xslt_tests>:
push   %rax
xor    %eax,%eax
call   1030 <test_xslt_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_xslt_comment_entities@plt>

LLVM IR (-O0):
define void @all_xslt_tests() {
%1 = call i32 (...) @test_xslt_comments()
%2 = call i32 (...) @test_xslt_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_xslt_tests() {
%1 = tail call i32 (...) @test_xslt_comments()
%2 = tail call i32 (...) @test_xslt_comment_entities()
ret void
}
int receive_char_by_UART() { return 0; }


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

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

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

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

/* Variables and functions */
int configFiles(char *, int /*<<< orphan*/ *);
int dataFiles(char *dataConf, FILE *fScriptTmp) {
  return configFiles(dataConf, fScriptTmp);
}


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

x86 assembly (clang, -O2):
<dataFiles>:
jmp    1030 <configFiles@plt>

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

LLVM IR (-O2):
define i32 @dataFiles(i8* %0, i32* %1) {
%3 = tail call i32 @configFiles(i8* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void show_help(void) {
  printf("Usage: %s OPTION\n   or: %s PATH [PATH...]\n\nOptions:\n    -h, "
         "--help\t\tdisplay this help\n    -V, --version\tdisplay version "
         "information\n\nReport bugs to <bulliver@gmail.com>\n",
         "dirname", "dirname");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0xf8c(%rip),%rdx
mov    %rdx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [170 x i8] c"Usage: %s OPTION\0A or: %s PATH [PATH...]\0A\0AOptions:\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [8 x i8] c"dirname\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [170 x i8] c"Usage: %s OPTION\0A or: %s PATH [PATH...]\0A\0AOptions:\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [8 x i8] c"dirname\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FOURCC(char, char, char, char);
int /*<<< orphan*/ NodeUnRegisterClass(int /*<<< orphan*/);
void AVI_Done() { NodeUnRegisterClass(FOURCC('R', 'A', 'V', 'I')); }


x86 assembly (clang, -O0):
<AVI_Done>:
push   %rbp
mov    %rsp,%rbp
mov    $0x52,%edi
mov    $0x41,%esi
mov    $0x56,%edx
mov    $0x49,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
call   1040 <NodeUnRegisterClass@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AVI_Done>:
push   %rax
mov    $0x52,%edi
mov    $0x41,%esi
mov    $0x56,%edx
mov    $0x49,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <NodeUnRegisterClass@plt>

LLVM IR (-O0):
define void @AVI_Done() {
%1 = call i32 @FOURCC(i8 signext 82, i8 signext 65, i8 signext 86, i8 signext 73)
%2 = call i32 @NodeUnRegisterClass(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AVI_Done() {
%1 = tail call i32 @FOURCC(i8 signext 82, i8 signext 65, i8 signext 86, i8 signext 73)
%2 = tail call i32 @NodeUnRegisterClass(i32 %1)
ret void
}
/* Type definitions */
struct jit_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ emit_modrm(struct jit_state *, int, int, int);
void emit_modrm_reg2reg(struct jit_state *state, int r, int m) {
  emit_modrm(state, 0xc0, r, m);
}


x86 assembly (clang, -O0):
<emit_modrm_reg2reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0xc0,%esi
call   1030 <emit_modrm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_modrm_reg2reg>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0xc0,%esi
jmp    1030 <emit_modrm@plt>

LLVM IR (-O0):
%struct.jit_state = type { i32 }
define void @emit_modrm_reg2reg(%struct.jit_state* %0, i32 %1, i32 %2) {
%4 = alloca %struct.jit_state*
%5 = alloca i32
%6 = alloca i32
store %struct.jit_state* %0, %struct.jit_state** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.jit_state*, %struct.jit_state** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @emit_modrm(%struct.jit_state* %7, i32 192, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.jit_state = type { i32 }
define void @emit_modrm_reg2reg(%struct.jit_state* %0, i32 %1, i32 %2) {
%4 = tail call i32 @emit_modrm(%struct.jit_state* %0, i32 192, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char);
void displayStringUsingPointer(char *s) {
  for (; *s; s++) {
    printf("address is %p, char is %c\n", s, *s);
  }
}


x86 assembly (clang, -O0):
<displayStringUsingPointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1151 <displayStringUsingPointer+0x41>
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
lea    0xec8(%rip),%rdi
movsbl (%rax),%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <displayStringUsingPointer+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayStringUsingPointer>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114a <displayStringUsingPointer+0x3a>
mov    %rdi,%rbx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <displayStringUsingPointer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"address is %p, char is %c\0A\00"
define void @displayStringUsingPointer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %12, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %8, i8 signext %10)
br label %12
12: ; preds = %7
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"address is %p, char is %c\0A\00"
define void @displayStringUsingPointer(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %6, i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ glTexCoord1f(int /*<<< orphan*/);
void TexCoord1f(GLfloat s) { glTexCoord1f(s); }


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

x86 assembly (clang, -O2):
<TexCoord1f>:
jmp    1030 <glTexCoord1f@plt>

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

LLVM IR (-O2):
define void @TexCoord1f(i32 %0) {
%2 = tail call i32 @glTexCoord1f(i32 %0)
ret void
}
/* Variables and functions */
char const *big_int_to_text(unsigned int, int /*<<< orphan*/);
const char *int_to_text(unsigned int number) {
  return big_int_to_text(number, 0);
}


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

x86 assembly (clang, -O2):
<int_to_text>:
xor    %esi,%esi
jmp    1030 <big_int_to_text@plt>

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

LLVM IR (-O2):
define i8* @int_to_text(i32 %0) {
%2 = tail call i8* @big_int_to_text(i32 %0, i32 0)
ret i8* %2
}
void test_non_identifiers() {
  int i, x;
#pragma omp parallel
#pragma omp parallel for simd;
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel
#pragma omp parallel for simd linear(x);
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel
#pragma omp parallel for simd private(x);
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel
#pragma omp parallel for simd, private(x);
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_non_identifiers>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_non_identifiers+0x28>
jmp    111a <test_non_identifiers+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_non_identifiers+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_non_identifiers+0x4c>
jmp    113e <test_non_identifiers+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_non_identifiers+0x2f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1170 <test_non_identifiers+0x70>
jmp    1162 <test_non_identifiers+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <test_non_identifiers+0x53>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1194 <test_non_identifiers+0x94>
jmp    1186 <test_non_identifiers+0x86>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <test_non_identifiers+0x77>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_non_identifiers() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %3
10: ; preds = %3
store i32 0, i32* %1
br label %11
11: ; preds = %15, %10
%12 = load i32, i32* %1
%13 = icmp slt i32 %12, 16
br i1 %13, label %14, label %18
14: ; preds = %11
br label %15
15: ; preds = %14
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %11
18: ; preds = %11
store i32 0, i32* %1
br label %19
19: ; preds = %23, %18
%20 = load i32, i32* %1
%21 = icmp slt i32 %20, 16
br i1 %21, label %22, label %26
22: ; preds = %19
br label %23
23: ; preds = %22
%24 = load i32, i32* %1
%25 = add nsw i32 %24, 1
store i32 %25, i32* %1
br label %19
26: ; preds = %19
store i32 0, i32* %1
br label %27
27: ; preds = %31, %26
%28 = load i32, i32* %1
%29 = icmp slt i32 %28, 16
br i1 %29, label %30, label %34
30: ; preds = %27
br label %31
31: ; preds = %30
%32 = load i32, i32* %1
%33 = add nsw i32 %32, 1
store i32 %33, i32* %1
br label %27
34: ; preds = %27
ret void
}

LLVM IR (-O2):
define void @test_non_identifiers() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dot_rev_graph_end(void) { printf("}\n"); }


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"}\00"
define void @dot_rev_graph_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}