xunge/DecIR huggingface dataset:
/* Variables and functions */
int foo(int);
int /*<<< orphan*/ printf(char *, double, int);
int wiz(double);
int main() {
  printf("foo(%d): %d\n", 1, foo(1));
  printf("Success! wiz(%f): %d\n", 1.0, wiz(1.0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <foo@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
movsd  0xea6(%rip),%xmm0
call   1030 <printf@plt>
movsd  0xe99(%rip),%xmm0
call   1050 <wiz@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
movsd  0xe83(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <foo@plt>
lea    0xec6(%rip),%rdi
movsd  0xeb6(%rip),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
movsd  0xea7(%rip),%xmm0
call   1050 <wiz@plt>
lea    0xeb0(%rip),%rdi
movsd  0xe93(%rip),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"foo(%d): %d\0A\00"
@.str.1 = [22 x i8] c"Success! wiz(%f): %d\0A\00"
define i32 @main() {
%1 = tail call i32 @foo(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double 1.000000e+00, i32 %1)
%3 = tail call i32 @wiz(double 1.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double 1.000000e+00, i32 %3)
ret i32 0
}
int string_count_chr(const char *string, int c) {
  int count;
  for (count = 0; *string; string++)
    if (*string == c)
      count++;
  return count;
}


x86 assembly (clang, -O0):
<string_count_chr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <string_count_chr+0x4e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1138 <string_count_chr+0x38>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <string_count_chr+0x3d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <string_count_chr+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_count_chr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <string_count_chr+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
xor    %edx,%edx
cmp    %esi,%ecx
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <string_count_chr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_count_chr(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %13, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = icmp eq i32 %9, %1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ vt100_EscSeq(int, unsigned char *, long long);
void vt100_CUD(int n) { vt100_EscSeq(n, (unsigned char *)"B", (long long)2); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x2,%edx
call   1030 <vt100_EscSeq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    0xee9(%rip),%rsi
mov    $0x2,%edx
jmp    1030 <vt100_EscSeq@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"B\00"
define void @vt100_CUD(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @vt100_EscSeq(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"B\00"
define void @vt100_CUD(i32 %0) {
%2 = tail call i32 @vt100_EscSeq(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void XFree(void *ptr) {
  if (!ptr)
    while (1)
      ;
  free(ptr);
}


x86 assembly (clang, -O0):
<XFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1131 <XFree+0x21>
jmp    112c <XFree+0x1c>
jmp    112c <XFree+0x1c>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XFree>:
test   %rdi,%rdi
je     1120 <XFree+0x10>
jmp    1030 <free@plt>
nopw   0x0(%rax,%rax,1)
jmp    1120 <XFree+0x10>

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

LLVM IR (-O2):
define void @XFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
%5 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main(int /*<<< orphan*/);
void start() { main(0); }


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <main@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @start() {
%1 = call i32 @main(i32 0)
ret void
}

LLVM IR (-O2):
define void @start() {
%1 = tail call i32 @main(i32 0)
ret void
}
void arch_ftrace_nmi_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @arch_ftrace_nmi_exit() {
ret void
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
long tdiff_micros(struct timespec t0, struct timespec t1) {
  return (long)(t1.tv_sec - t0.tv_sec) * 1000000 +
         (t1.tv_nsec - t0.tv_nsec) / 1000;
}


x86 assembly (clang, -O0):
<tdiff_micros>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %edx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x8(%rbp),%rax
imul   $0xf4240,%rax,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdiff_micros>:
sub    %rsi,%rcx
imul   $0xf4240,%rcx,%rcx
sub    %edi,%edx
movslq %edx,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i64 @tdiff_micros(i32 %0, i64 %1, i32 %2, i64 %3) {
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = bitcast %struct.timespec* %5 to { i32, i64 }*
%8 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %7, i32 0, i32 0
store i32 %0, i32* %8
%9 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.timespec* %6 to { i32, i64 }*
%11 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %10, i32 0, i32 0
store i32 %2, i32* %11
%12 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%16 = load i64, i64* %15
%17 = sub nsw i64 %14, %16
%18 = mul nsw i64 %17, 1000000
%19 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%20 = load i32, i32* %19
%21 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%22 = load i32, i32* %21
%23 = sub nsw i32 %20, %22
%24 = sdiv i32 %23, 1000
%25 = sext i32 %24 to i64
%26 = add nsw i64 %18, %25
ret i64 %26
}

LLVM IR (-O2):
define i64 @tdiff_micros(i32 %0, i64 %1, i32 %2, i64 %3) {
%5 = sub nsw i64 %3, %1
%6 = mul nsw i64 %5, 1000000
%7 = sub nsw i32 %2, %0
%8 = sdiv i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %6, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, double);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ set_setting(char *, char *, char *);
void set_setting_DOUBLE(char *filename, char *settingname, double value) {
  char *tempstr;
  asprintf(&tempstr, "%f", value);
  set_setting(filename, settingname, tempstr);
  free(tempstr);
}


x86 assembly (clang, -O0):
<set_setting_DOUBLE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    -0x20(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1040 <asprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <set_setting@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_setting_DOUBLE>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
mov    %rsp,%rdi
call   1040 <asprintf@plt>
mov    (%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <set_setting@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define void @set_setting_DOUBLE(i8* %0, i8* %1, double %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store double %2, double* %6
%8 = load double, double* %6
%9 = call i32 @asprintf(i8** %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %8)
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i8*, i8** %7
%13 = call i32 @set_setting(i8* %10, i8* %11, i8* %12)
%14 = load i8*, i8** %7
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @set_setting_DOUBLE(i8* %0, i8* %1, double %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i32 @asprintf(i8** %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %2)
%7 = load i8*, i8** %4
%8 = call i32 @set_setting(i8* %0, i8* %1, i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @free(i8* %9)
ret void
}
void xencons_resume(void) {}


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

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

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

LLVM IR (-O2):
define void @xencons_resume() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CloseCachedFile(char const *);
void ModelicaStreams_closeFile(const char *fileName) {
  CloseCachedFile(fileName);
}


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

x86 assembly (clang, -O2):
<ModelicaStreams_closeFile>:
jmp    1030 <CloseCachedFile@plt>

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

LLVM IR (-O2):
define void @ModelicaStreams_closeFile(i8* %0) {
%2 = tail call i32 @CloseCachedFile(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void Key(unsigned char c, int x, int y) {
  switch (c) {
  case 27:
    exit(0);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<Key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113b <Key+0x2b>
jmp    1134 <Key+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
jmp    1140 <Key+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Key>:
cmp    $0x1b,%dil
je     1117 <Key+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @Key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
br label %12
12: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @Key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
void test5(void) {
  int a = 1;
  __asm__("add $1, %0 \n" : "+rm"(a));
  assert(a == 2);
  __asm__("add $1, %0 \n" : "+rm"(a) :);
  assert(a == 3);
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    $0x1,%eax
add    $0x1,%eax
mov    %eax,0x4(%rsp)
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
xor    %eax,%eax
call   1030 <assert@plt>
mov    0x4(%rsp),%eax
add    $0x1,%eax
mov    %eax,0x4(%rsp)
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
xor    %eax,%eax
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test5() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 2
%5 = zext i1 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %10)
ret void
}

LLVM IR (-O2):
define void @test5() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 2
%5 = zext i1 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void core_dump(int sigid) { abort(); }


x86 assembly (clang, -O0):
<core_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<core_dump>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @core_dump(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @core_dump(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
__attribute__((always_)) int unregister_cpu_under_node(unsigned int cpu,
                                                       unsigned int nid) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @unregister_cpu_under_node(i32 %0, i32 %1) {
ret i32 0
}
void RTEnvClone(void) {}


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

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

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

LLVM IR (-O2):
define void @RTEnvClone() {
ret void
}
/* Variables and functions */
char *strchr(char *, int);
char *strrchr(const char *s, int c) {
  char *last = NULL;
  char *test = (char *)s;
  while (test != NULL) {
    test = strchr(test, c);
    if (test != NULL) {
      last = test;
      ++test;
    }
  }
  return last;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     116e <strrchr+0x5e>
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1169 <strrchr+0x59>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112f <strrchr+0x1f>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1135 <strrchr+0x25>
mov    %esi,%ebp
xor    %eax,%eax
nopl   0x0(%rax)
mov    %rax,%rbx
mov    %ebp,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rdi
test   %rax,%rax
jne    1120 <strrchr+0x10>
jmp    1137 <strrchr+0x27>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %9, %4 ], [ %0, %2 ]
%6 = phi i8* [ %7, %4 ], [ null, %2 ]
%7 = tail call i8* @strchr(i8* %5, i32 %1)
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
br i1 %8, label %10, label %4
10: ; preds = %4, %2
%11 = phi i8* [ null, %2 ], [ %6, %4 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ usage();
void help() {
  usage();
  exit(0);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <usage@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
xor    %eax,%eax
call   1030 <usage@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @help() {
%1 = call i32 (...) @usage()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @help() {
%1 = tail call i32 (...) @usage()
%2 = tail call i32 @exit(i32 0)
unreachable
}
double func_(double x) {
  if (x < 3.14159265)
    return 0;
  if (x < (3 * 3.14159265) / 2)
    return x - 3.14159265;
  return -x + 2 * 3.14159265;
}


x86 assembly (clang, -O0):
<func_>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1129 <func_+0x29>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <func_+0x84>
movsd  0xed7(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1157 <func_+0x57>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <func_+0x84>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe95(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_>:
xorpd  %xmm1,%xmm1
movsd  0xef4(%rip),%xmm2
ucomisd %xmm0,%xmm2
ja     1135 <func_+0x35>
movsd  0xeee(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1129 <func_+0x29>
addsd  0xef0(%rip),%xmm0
ret
movsd  0xedf(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @func_(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0x400921FB53C8D4F1
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %17
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, 0x4012D97C7ED69FB5
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load double, double* %3
%12 = fsub double %11, 0x400921FB53C8D4F1
store double %12, double* %2
br label %17
13: ; preds = %7
%14 = load double, double* %3
%15 = fneg double %14
%16 = fadd double %15, 0x401921FB53C8D4F1
store double %16, double* %2
br label %17
17: ; preds = %13, %10, %6
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @func_(double %0) {
%2 = fcmp olt double %0, 0x400921FB53C8D4F1
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = fcmp olt double %0, 0x4012D97C7ED69FB5
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = fadd double %0, 0xC00921FB53C8D4F1
br label %9
7: ; preds = %3
%8 = fsub double 0x401921FB53C8D4F1, %0
br label %9
9: ; preds = %1, %7, %5
%10 = phi double [ %6, %5 ], [ %8, %7 ], [ 0.000000e+00, %1 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hell! O' world, why won't my code compile?\n\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"Hell! O' world, why won't my code compile?\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [44 x i8] c"Hell! O' world, why won't my code compile?\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ timeval;
struct timeval {
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVTIMEO;
int /*<<< orphan*/ memset(struct timeval *, int /*<<< orphan*/, int);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, struct timeval *,
               int);
int sock_set_recvtimeout(int sock, int seconds) {
  struct timeval timeval;
  memset(&timeval, 0, sizeof(timeval));
  timeval.tv_sec = 1;
  return setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &timeval, sizeof(timeval));
}


x86 assembly (clang, -O0):
<sock_set_recvtimeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_set_recvtimeout>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
movl   $0x1,(%rsp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
mov    %r14,%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@SOL_SOCKET = global i32 0
@SO_RCVTIMEO = global i32 0
define i32 @sock_set_recvtimeout(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timeval
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @memset(%struct.timeval* %5, i32 0, i32 4)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
store i32 1, i32* %7
%8 = load i32, i32* %3
%9 = load i32, i32* @SOL_SOCKET
%10 = load i32, i32* @SO_RCVTIMEO
%11 = call i32 @setsockopt(i32 %8, i32 %9, i32 %10, %struct.timeval* %5, i32 4)
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@SOL_SOCKET = global i32 0
@SO_RCVTIMEO = global i32 0
define i32 @sock_set_recvtimeout(i32 %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @memset(%struct.timeval* %3, i32 0, i32 4)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 1, i32* %6
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_RCVTIMEO
%9 = call i32 @setsockopt(i32 %0, i32 %7, i32 %8, %struct.timeval* %3, i32 4)
ret i32 %9
}
void CalcCols(unsigned char *col) {
  unsigned char i;
  for (i = 4; i > 0; i--) {
    *col = (*col << 1) ^ (*col & 0x80 ? 0x1b : 0);
    col++;
  }
}


x86 assembly (clang, -O0):
<CalcCols>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x4,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jle    1160 <CalcCols+0x60>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%esi
and    $0x80,%esi
xor    %ecx,%ecx
mov    $0x1b,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
xor    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x9(%rbp),%al
add    $0xff,%al
mov    %al,-0x9(%rbp)
jmp    110c <CalcCols+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcCols>:
mov    (%rdi),%al
mov    0x1(%rdi),%cl
lea    (%rax,%rax,1),%edx
sar    $0x7,%al
and    $0x1b,%al
xor    %dl,%al
mov    %al,(%rdi)
lea    (%rcx,%rcx,1),%eax
sar    $0x7,%cl
and    $0x1b,%cl
xor    %al,%cl
mov    %cl,0x1(%rdi)
mov    0x2(%rdi),%al
lea    (%rax,%rax,1),%ecx
sar    $0x7,%al
and    $0x1b,%al
xor    %cl,%al
mov    %al,0x2(%rdi)
mov    0x3(%rdi),%al
lea    (%rax,%rax,1),%ecx
sar    $0x7,%al
and    $0x1b,%al
xor    %cl,%al
mov    %al,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @CalcCols(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = shl i8 %2, 1
%4 = icmp slt i8 %2, 0
%5 = select i1 %4, i8 27, i8 0
%6 = xor i8 %5, %3
store i8 %6, i8* %0
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = shl i8 %8, 1
%10 = icmp slt i8 %8, 0
%11 = select i1 %10, i8 27, i8 0
%12 = xor i8 %11, %9
store i8 %12, i8* %7
%13 = getelementptr inbounds i8, i8* %0, i64 2
%14 = load i8, i8* %13
%15 = shl i8 %14, 1
%16 = icmp slt i8 %14, 0
%17 = select i1 %16, i8 27, i8 0
%18 = xor i8 %17, %15
store i8 %18, i8* %13
%19 = getelementptr inbounds i8, i8* %0, i64 3
%20 = load i8, i8* %19
%21 = shl i8 %20, 1
%22 = icmp slt i8 %20, 0
%23 = select i1 %22, i8 27, i8 0
%24 = xor i8 %23, %21
store i8 %24, i8* %19
ret void
}
/* Variables and functions */
int /*<<< orphan*/ allocator_default();
int /*<<< orphan*/ allocator_traced_init_stderr(int /*<<< orphan*/,
                                                int /*<<< orphan*/);
void _ensure_allocator_traced_init_stderr_copes_with_null_allocator(void) {
  allocator_traced_init_stderr(0, allocator_default());
}


x86 assembly (clang, -O0):
<_ensure_allocator_traced_init_stderr_copes_with_null_allocator>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <allocator_default@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <allocator_traced_init_stderr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ensure_allocator_traced_init_stderr_copes_with_null_allocator>:
push   %rax
xor    %eax,%eax
call   1040 <allocator_default@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <allocator_traced_init_stderr@plt>

LLVM IR (-O0):
define void @_ensure_allocator_traced_init_stderr_copes_with_null_allocator() {
%1 = call i32 (...) @allocator_default()
%2 = call i32 @allocator_traced_init_stderr(i32 0, i32 %1)
ret void
}

LLVM IR (-O2):
define void @_ensure_allocator_traced_init_stderr_copes_with_null_allocator() {
%1 = tail call i32 (...) @allocator_default()
%2 = tail call i32 @allocator_traced_init_stderr(i32 0, i32 %1)
ret void
}
/* Variables and functions */
int syscall(int, int, int /*<<< orphan*/);
int continue_dynamically(void) { return syscall(295, 1, 0); }


x86 assembly (clang, -O0):
<continue_dynamically>:
push   %rbp
mov    %rsp,%rbp
mov    $0x127,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<continue_dynamically>:
mov    $0x127,%edi
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @continue_dynamically() {
%1 = call i32 @syscall(i32 295, i32 1, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @continue_dynamically() {
%1 = tail call i32 @syscall(i32 295, i32 1, i32 0)
ret i32 %1
}
/* Variables and functions */
scalar_t__ strlen(char *);
scalar_t__ strspn(char *, char *);
int validate_argtypes(char *linha) {
  return strspn(linha, "d"
                       "l"
                       "f"
                       "i"
                       "w"
                       "c"
                       "s") == strlen(linha);
}


x86 assembly (clang, -O0):
<validate_argtypes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strspn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_argtypes>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1040 <strspn@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    %rax,%r14
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"dlfiwcs\00"
define i32 @validate_argtypes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strspn(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [8 x i8] c"dlfiwcs\00"
define i32 @validate_argtypes(i8* nocapture %0) {
%2 = tail call i64 @strspn(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ testsignifd_(int *);
unsigned int get_significand(void) {
  int significand_length = 0;
  testsignifd_(&significand_length);
  return (significand_length);
}


x86 assembly (clang, -O0):
<get_significand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <testsignifd_@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_significand>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <testsignifd_@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_significand() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @testsignifd_(i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_active_img(void) {
  mbus_remote_register_write(0x8, 0x16,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (7 << 9) | (7 << 5) | (16)));
  delay(200);
  mbus_remote_register_write(0x8, 0x1A,
                             ((0 << 13) | (8 << 9) | (8 << 5) | (16)));
  delay(200);
}


x86 assembly (clang, -O0):
<set_pmu_active_img>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x16,%esi
mov    $0xcef0,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
mov    $0x8,%edi
mov    $0x1a,%esi
mov    $0x1110,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_active_img>:
push   %rax
mov    $0x8,%edi
mov    $0x16,%esi
mov    $0xcef0,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
mov    $0x8,%edi
mov    $0x1a,%esi
mov    $0x1110,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_active_img() {
%1 = call i32 @mbus_remote_register_write(i32 8, i32 22, i32 52976)
%2 = call i32 @delay(i32 200)
%3 = call i32 @mbus_remote_register_write(i32 8, i32 26, i32 4368)
%4 = call i32 @delay(i32 200)
ret void
}

LLVM IR (-O2):
define void @set_pmu_active_img() {
%1 = tail call i32 @mbus_remote_register_write(i32 8, i32 22, i32 52976)
%2 = tail call i32 @delay(i32 200)
%3 = tail call i32 @mbus_remote_register_write(i32 8, i32 26, i32 4368)
%4 = tail call i32 @delay(i32 200)
ret void
}
/* Variables and functions */
char *__st_strtok_r1(char *, char const *, char **);
char *st_strtok_r1(char *s, const char *delim, char **s2) {
  return __st_strtok_r1(s, delim, s2);
}


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

x86 assembly (clang, -O2):
<st_strtok_r1>:
jmp    1030 <__st_strtok_r1@plt>

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

LLVM IR (-O2):
define i8* @st_strtok_r1(i8* %0, i8* %1, i8** %2) {
%4 = tail call i8* @__st_strtok_r1(i8* %0, i8* %1, i8** %2)
ret i8* %4
}
/* Variables and functions */
int *malloc(int);
void *getfoo(void) {
  int *x = malloc(sizeof(int));
  *x = 42;
  return (void *)x;
}


x86 assembly (clang, -O0):
<getfoo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfoo>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0x2a,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @getfoo() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 4)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
store i32 42, i32* %3
%4 = load i32*, i32** %1
%5 = bitcast i32* %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @getfoo() {
%1 = tail call i32* @malloc(i32 4)
store i32 42, i32* %1
%2 = bitcast i32* %1 to i8*
ret i8* %2
}
unsigned int mcd(unsigned int a, unsigned int b) {
  while (a != b) {
    if (a > b)
      a -= b;
    else
      b -= a;
  }
  return a;
}


x86 assembly (clang, -O0):
<mcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1142 <mcd+0x42>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1132 <mcd+0x32>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <mcd+0x3d>
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    110a <mcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcd>:
mov    %edi,%eax
cmp    %esi,%edi
je     1127 <mcd+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %eax,%esi
mov    $0x0,%edx
cmovb  %esi,%edx
mov    %eax,%edi
cmovb  %ecx,%edi
sub    %edx,%eax
sub    %edi,%esi
cmp    %esi,%eax
jne    1110 <mcd+0x10>
ret

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

LLVM IR (-O2):
define i32 @mcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = icmp ult i32 %5, %6
%8 = select i1 %7, i32 %5, i32 0
%9 = sub i32 %6, %8
%10 = select i1 %7, i32 0, i32 %6
%11 = sub i32 %5, %10
%12 = icmp eq i32 %9, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ %0, %2 ], [ %9, %4 ]
ret i32 %14
}
void load() {
  asm volatile("movq $0x2d, %%rdi\n\t"
               "movq %%rsp, %%r13\n\t"
               "movq %%r15, %%rsp\n\t"
               "callq *%%r12\n\t"
               "movq %%r13, %%rsp\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<load>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%rdi
mov    %rsp,%r13
mov    %r15,%rsp
call   *%r12
mov    %r13,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load>:
mov    $0x2d,%rdi
mov    %rsp,%r13
mov    %r15,%rsp
call   *%r12
mov    %r13,%rsp
ret

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

LLVM IR (-O2):
define void @load() {
tail call void asm sideeffect "movq $$0x2d, %rdi\0A\09movq %rsp, %r13\0A\09movq %r15, %rsp\0A\09callq *%r12\0A\09movq %r13, %rsp\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void foo137(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo137(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutForceJoystickFunc();
int /*<<< orphan*/ printf(char *);
void joyPoll(void) {
  printf("force\n");
  glutForceJoystickFunc();
}


x86 assembly (clang, -O0):
<joyPoll>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <glutForceJoystickFunc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<joyPoll>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutForceJoystickFunc@plt>

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

LLVM IR (-O2):
@str = [6 x i8] c"force\00"
define void @joyPoll() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @glutForceJoystickFunc()
ret void
}
const char *get_notename(const char *NotesTexts[], float notenum) {
  if ((int)notenum >= 131)
    return "-H";
  else if ((int)notenum < 0)
    return "-L";
  else
    return NotesTexts[(int)notenum];
}


x86 assembly (clang, -O0):
<get_notename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
cvttss2si -0x14(%rbp),%eax
cmp    $0x83,%eax
jl     112d <get_notename+0x2d>
lea    0xedc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <get_notename+0x5f>
cvttss2si -0x14(%rbp),%eax
cmp    $0x0,%eax
jge    114b <get_notename+0x4b>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <get_notename+0x5f>
mov    -0x10(%rbp),%rax
cvttss2si -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_notename>:
cvttss2si %xmm0,%eax
cmp    $0x82,%eax
jle    1113 <get_notename+0x13>
lea    0xeee(%rip),%rax
ret
test   %eax,%eax
js     111e <get_notename+0x1e>
mov    %eax,%eax
mov    (%rdi,%rax,8),%rax
ret
lea    0xede(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-H\00"
@.str.1 = [3 x i8] c"-L\00"
define i8* @get_notename(i8** %0, float %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca float
store i8** %0, i8*** %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fptosi float %6 to i32
%8 = icmp sge i32 %7, 131
br i1 %8, label %9, label %10
9: ; preds = %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3
br label %22
10: ; preds = %2
%11 = load float, float* %5
%12 = fptosi float %11 to i32
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %22
15: ; preds = %10
%16 = load i8**, i8*** %4
%17 = load float, float* %5
%18 = fptosi float %17 to i32
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %16, i64 %19
%21 = load i8*, i8** %20
store i8* %21, i8** %3
br label %22
22: ; preds = %15, %14, %9
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
@.str = [3 x i8] c"-H\00"
@.str.1 = [3 x i8] c"-L\00"
define i8* @get_notename(i8** nocapture %0, float %1) {
%3 = fptosi float %1 to i32
%4 = icmp sgt i32 %3, 130
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = icmp slt i32 %3, 0
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = zext i32 %3 to i64
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
br label %11
11: ; preds = %5, %2, %7
%12 = phi i8* [ %10, %7 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %5 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void eighteen(const int k) {
  int k2;
  k2 = k * k;
  k2 += k2;
  k2 *= k2;
  k2 -= 1;
  printf("Result: %d\n", k2);
}


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

x86 assembly (clang, -O2):
<eighteen>:
imul   %edi,%edi
lea    (%rdi,%rdi,1),%esi
imul   %esi,%esi
add    $0xffffffff,%esi
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Result: %d\0A\00"
define void @eighteen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Result: %d\0A\00"
define void @eighteen(i32 %0) {
%2 = shl i32 %0, 1
%3 = mul i32 %2, %0
%4 = mul nsw i32 %3, %3
%5 = add nsw i32 %4, -1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int n = 5;
  printf("Fact(%d) = %d\n", n, fact(n));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Fact(%d) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @fact(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 5, i32 %1)
ret i32 0
}
int foo(void) {
  int i;
  if (0)
    i = 1;
  else
    i = 26;
  return i;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1a,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
store i32 26, i32* %1
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 26
}