xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ aligned_alloc(int, int);
int /*<<< orphan*/ printf(char *, double *, int, int);
double *alloc(int *len) {
  double *p = (double *)aligned_alloc(2 * 1024 * 1024, sizeof(double) * (*len));
  printf("Allocated %p size %zu. len was %d\n", p, sizeof(double) * (*len),
         (*len));
  return p;
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
mov    %eax,%esi
mov    $0x200000,%edi
call   1040 <aligned_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%esi
shl    $0x3,%esi
mov    $0x200000,%edi
call   1040 <aligned_alloc@plt>
mov    %rax,%r14
mov    (%rbx),%ecx
lea    0x0(,%rcx,8),%edx
lea    0xeb7(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Allocated %p size %zu. len was %d\0A\00"
define double* @alloc(i32* %0) {
%2 = alloca i32*
%3 = alloca double*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = mul i64 8, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @aligned_alloc(i32 2097152, i32 %8)
%10 = inttoptr i64 %9 to double*
store double* %10, double** %3
%11 = load double*, double** %3
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = mul i64 8, %14
%16 = trunc i64 %15 to i32
%17 = load i32*, i32** %2
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double* %11, i32 %16, i32 %18)
%20 = load double*, double** %3
ret double* %20
}

LLVM IR (-O2):
@.str = [35 x i8] c"Allocated %p size %zu. len was %d\0A\00"
define double* @alloc(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 3
%4 = tail call i64 @aligned_alloc(i32 2097152, i32 %3)
%5 = inttoptr i64 %4 to double*
%6 = load i32, i32* %0
%7 = shl i32 %6, 3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double* %5, i32 %7, i32 %6)
ret double* %5
}
int aca(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @aca() {
ret i32 4
}

LLVM IR (-O2):
define i32 @aca() {
ret i32 4
}
/* Variables and functions */
int answer();
int /*<<< orphan*/ assert(int);
void life_the_universe_and_everything(void) { assert(answer() == 42); }


x86 assembly (clang, -O0):
<life_the_universe_and_everything>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <answer@plt>
cmp    $0x2a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<life_the_universe_and_everything>:
push   %rax
xor    %eax,%eax
call   1040 <answer@plt>
xor    %edi,%edi
cmp    $0x2a,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @life_the_universe_and_everything() {
%1 = call i32 (...) @answer()
%2 = icmp eq i32 %1, 42
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
ret void
}

LLVM IR (-O2):
define void @life_the_universe_and_everything() {
%1 = tail call i32 (...) @answer()
%2 = icmp eq i32 %1, 42
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Variables and functions */
bool nrf52_errata_189(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_189() {
ret i32 0
}
void handle(int irq) {
  asm volatile("movl %0, %%ebx" ::"m"(irq) : "%ebx");
  syscall(8);
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ebx
mov    $0x8,%edi
mov    $0x0,%al
call   1030 <syscall@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
mov    0xc(%rsp),%ebx
mov    $0x8,%edi
xor    %eax,%eax
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @syscall to i32 (i32, ...)*)(i32 8)
ret void
}

LLVM IR (-O2):
define void @handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @syscall to i32 (i32, ...)*)(i32 8)
ret void
}
int isreach_pawn(int dx, int dy) { return dx == 0 && dy == 1; }


x86 assembly (clang, -O0):
<isreach_pawn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <isreach_pawn+0x23>
cmpl   $0x1,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isreach_pawn>:
xor    $0x1,%esi
xor    %eax,%eax
or     %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @isreach_pawn(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isreach_pawn(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 1
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, float);
int /*<<< orphan*/ stdout;
void cutils_cout_float_print(float number) { fprintf(stdout, "%ff\n", number); }


x86 assembly (clang, -O0):
<cutils_cout_float_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
movss  -0x4(%rbp),%xmm0
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cout_float_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"%ff\0A\00"
define void @cutils_cout_float_print(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load i32, i32* @stdout
%4 = load float, float* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"%ff\0A\00"
define void @cutils_cout_float_print(float %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
int test_imm_A2uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xA2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A2uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xa2,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A2uint64_highword_reg>:
movabs $0xa200000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A2uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 695784701952
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__typeof__(ispunct((void *)1)) test_ispunct_51(void) {
  return ispunct((void *)1);
}


x86 assembly (clang, -O0):
<test_ispunct_51>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
mov    %eax,%edi
call   1030 <ispunct@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ispunct_51>:
mov    $0x1,%edi
jmp    1030 <ispunct@plt>

LLVM IR (-O0):
define i32 @test_ispunct_51() {
%1 = call i32 @ispunct(i32 ptrtoint (i8* inttoptr (i64 1 to i8*) to i32))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_ispunct_51() {
%1 = tail call i32 @ispunct(i32 1)
ret i32 %1
}
void isr_fault(void) {
  while (1)
    ;
  ;
}


x86 assembly (clang, -O0):
<isr_fault>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <isr_fault+0x9>
jmp    1109 <isr_fault+0x9>

x86 assembly (clang, -O2):
<isr_fault>:
jmp    1100 <isr_fault>

LLVM IR (-O0):
define void @isr_fault() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @isr_fault() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exec();
int main(void) {
  exec();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <exec@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @exec()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @exec()
ret i32 0
}
/* Variables and functions */
int AF_INET;
int AF_INET6;
scalar_t__ strchr(char const *, char);
int get_addr_family(const char *addr) {
  if (strchr(addr, ':'))
    return AF_INET6;
  else
    return AF_INET;
}


x86 assembly (clang, -O0):
<get_addr_family>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1145 <get_addr_family+0x35>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <get_addr_family+0x41>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_addr_family>:
push   %rax
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1129 <get_addr_family+0x19>
mov    0x2ec1(%rip),%rax
jmp    1130 <get_addr_family+0x20>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@AF_INET6 = global i32 0
@AF_INET = global i32 0
define i32 @get_addr_family(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strchr(i8* %4, i8 signext 58)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* @AF_INET6
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* @AF_INET
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@AF_INET6 = global i32 0
@AF_INET = global i32 0
define i32 @get_addr_family(i8* %0) {
%2 = tail call i64 @strchr(i8* %0, i8 signext 58)
%3 = icmp eq i64 %2, 0
%4 = load i32, i32* @AF_INET
%5 = load i32, i32* @AF_INET6
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ get_tokens(char *);
int main() {
  char *path = "./test/test.c";
  get_tokens(path);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"./test/test.c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @get_tokens(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"./test/test.c\00"
define i32 @main() {
%1 = tail call i32 @get_tokens(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int rl_forward(count, key)
int count, key;
{ return (rl_forward_char(count, key)); }


x86 assembly (clang, -O0):
<rl_forward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <rl_forward_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rl_forward(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 (i32, i32, ...) bitcast (i32 (...)* @rl_forward_char to i32 (i32, i32, ...)*)(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @rl_forward(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_forward_char to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int INT_MAX;
int stbi__mul2sizes_valid(int a, int b) {
  if (a < 0 || b < 0)
    return 0;
  if (b == 0)
    return 1;
  return a <= INT_MAX / b;
}


x86 assembly (clang, -O0):
<stbi__mul2sizes_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111e <stbi__mul2sizes_valid+0x1e>
cmpl   $0x0,-0xc(%rbp)
jge    112a <stbi__mul2sizes_valid+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1165 <stbi__mul2sizes_valid+0x65>
cmpl   $0x0,-0xc(%rbp)
jne    1140 <stbi__mul2sizes_valid+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1165 <stbi__mul2sizes_valid+0x65>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi__mul2sizes_valid>:
mov    %esi,%eax
or     %edi,%eax
js     1120 <stbi__mul2sizes_valid+0x20>
test   %esi,%esi
je     1123 <stbi__mul2sizes_valid+0x23>
mov    0x2ed7(%rip),%rax
mov    (%rax),%eax
cltd
idiv   %esi
mov    %eax,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
setge  %al
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @stbi__mul2sizes_valid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 0, i32* %3
br label %23
12: ; preds = %8
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 1, i32* %3
br label %23
16: ; preds = %12
%17 = load i32, i32* %4
%18 = load i32, i32* @INT_MAX
%19 = load i32, i32* %5
%20 = sdiv i32 %18, %19
%21 = icmp sle i32 %17, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %16, %15, %11
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @stbi__mul2sizes_valid(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = icmp eq i32 %1, 0
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = load i32, i32* @INT_MAX
%9 = sdiv i32 %8, %1
%10 = icmp sge i32 %9, %0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %5, %2, %7
%13 = phi i32 [ %11, %7 ], [ 0, %2 ], [ 1, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ error_not_enough_args();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error_missing_output() {
  fprintf(stderr, "No output file.\n");
  error_not_enough_args();
}


x86 assembly (clang, -O0):
<error_missing_output>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <error_not_enough_args@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_missing_output>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <error_not_enough_args@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"No output file.\0A\00"
define void @error_missing_output() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @error_not_enough_args()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"No output file.\0A\00"
define void @error_missing_output() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @error_not_enough_args()
ret void
}
void InitRemoteServer() {}


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

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

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

LLVM IR (-O2):
define void @InitRemoteServer() {
ret void
}
void checksys() { return; }


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

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

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

LLVM IR (-O2):
define void @checksys() {
ret void
}
double my_pow_10(int x) {
  double result = 1;
  while (x) {
    if (x > 0) {
      result *= 10;
      --x;
    } else {
      result /= 10;
      ++x;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<my_pow_10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116c <my_pow_10+0x6c>
cmpl   $0x0,-0x4(%rbp)
jle    1148 <my_pow_10+0x48>
movsd  0xed8(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <my_pow_10+0x67>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1114 <my_pow_10+0x14>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pow_10>:
movsd  0xef8(%rip),%xmm0
test   %edi,%edi
je     113e <my_pow_10+0x3e>
movsd  0xef4(%rip),%xmm1
jmp    112d <my_pow_10+0x2d>
cs nopw 0x0(%rax,%rax,1)
divsd  %xmm1,%xmm0
mov    $0x1,%eax
add    %eax,%edi
je     113e <my_pow_10+0x3e>
test   %edi,%edi
jle    1120 <my_pow_10+0x20>
mulsd  %xmm1,%xmm0
mov    $0xffffffff,%eax
add    %eax,%edi
jne    112d <my_pow_10+0x2d>
ret

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

LLVM IR (-O2):
define double @my_pow_10(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %16, label %3
3: ; preds = %1, %11
%4 = phi double [ %13, %11 ], [ 1.000000e+00, %1 ]
%5 = phi i32 [ %14, %11 ], [ %0, %1 ]
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = fmul double %4, 1.000000e+01
br label %11
9: ; preds = %3
%10 = fdiv double %4, 1.000000e+01
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ 1, %9 ], [ -1, %7 ]
%13 = phi double [ %10, %9 ], [ %8, %7 ]
%14 = add nsw i32 %5, %12
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %3
16: ; preds = %11, %1
%17 = phi double [ 1.000000e+00, %1 ], [ %13, %11 ]
ret double %17
}
/* Variables and functions */
double clock();
double getCpuTime() {
  double c;
  c = clock();
  return c;
}


x86 assembly (clang, -O0):
<getCpuTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @getCpuTime() {
%1 = alloca double
%2 = call double (...) @clock()
store double %2, double* %1
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @getCpuTime() {
%1 = tail call double (...) @clock()
ret double %1
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int fstatat(int /*<<< orphan*/, char const *, struct stat *,
            int /*<<< orphan*/);
int stat(const char *restrict path, struct stat *restrict buf) {
  return fstatat(AT_FDCWD, path, buf, 0);
}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <fstatat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
jmp    1030 <fstatat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@AT_FDCWD = global i32 0
define i32 @stat(i8* noalias %0, %struct.stat* noalias %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @AT_FDCWD
%6 = load i8*, i8** %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = call i32 @fstatat(i32 %5, i8* %6, %struct.stat* %7, i32 0)
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@AT_FDCWD = global i32 0
define i32 @stat(i8* noalias %0, %struct.stat* noalias %1) {
%3 = load i32, i32* @AT_FDCWD
%4 = tail call i32 @fstatat(i32 %3, i8* %0, %struct.stat* %1, i32 0)
ret i32 %4
}
short test_72_2(short *mem) { return __atomic_nand_fetch(mem + 0, -1, 4); }


x86 assembly (clang, -O0):
<test_72_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0xffff,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    (%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x28(%rbp)
and    %esi,%edx
mov    %edx,-0x24(%rbp)
not    %edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    1162 <test_72_2+0x62>
jmp    1125 <test_72_2+0x25>
mov    -0x10(%rbp),%cx
mov    -0x1a(%rbp),%ax
and    %cx,%ax
xor    $0xffff,%ax
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_72_2>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
not    %ecx
lock cmpxchg %cx,(%rdi)
jne    1110 <test_72_2+0x10>
not    %eax
ret

LLVM IR (-O0):
define signext i16 @test_72_2(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 0
store i16 -1, i16* %3
%7 = load i16, i16* %3
%8 = atomicrmw nand i16* %6, i16 %7 acq_rel
%9 = and i16 %8, %7
%10 = xor i16 %9, -1
store i16 %10, i16* %4
%11 = load i16, i16* %4
ret i16 %11
}

LLVM IR (-O2):
define signext i16 @test_72_2(i16* nocapture %0) {
%2 = atomicrmw nand i16* %0, i16 -1 acq_rel
%3 = xor i16 %2, -1
ret i16 %3
}
int cfunc_test_func4(int a, int b) { return a * b; }


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

x86 assembly (clang, -O2):
<cfunc_test_func4>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @cfunc_test_func4(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @cfunc_test_func4(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int enable_setting(char *);
int enable_mptcp() {
  return enable_setting("/proc/sys/net/mptcp/mptcp_enabled");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"/proc/sys/net/mptcp/mptcp_enabled\00"
define i32 @enable_mptcp() {
%1 = call i32 @enable_setting(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [34 x i8] c"/proc/sys/net/mptcp/mptcp_enabled\00"
define i32 @enable_mptcp() {
%1 = tail call i32 @enable_setting(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
struct array {
  int dummy;
};

/* Variables and functions */
void *arrayIndex(struct array *, int /*<<< orphan*/);
void *arrayTop(struct array *a) { return arrayIndex(a, 0); }


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

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

LLVM IR (-O0):
%struct.array = type { i32 }
define i8* @arrayTop(%struct.array* %0) {
%2 = alloca %struct.array*
store %struct.array* %0, %struct.array** %2
%3 = load %struct.array*, %struct.array** %2
%4 = call i8* @arrayIndex(%struct.array* %3, i32 0)
ret i8* %4
}

LLVM IR (-O2):
%struct.array = type { i32 }
define i8* @arrayTop(%struct.array* %0) {
%2 = tail call i8* @arrayIndex(%struct.array* %0, i32 0)
ret i8* %2
}
void SSL_library_init(void) {}


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

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

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

LLVM IR (-O2):
define void @SSL_library_init() {
ret void
}
/* Variables and functions */
double strtod(char *, char **);
double reverse_number(char *str, int *error) {
  *error = 0;
  char *remainder;
  double reverseNumber;
  reverseNumber = strtod(str, &remainder);
  if (*remainder != '\0') {
    *error = 1;
    return 0;
  }
  return reverseNumber;
}


x86 assembly (clang, -O0):
<reverse_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1163 <reverse_number+0x53>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116d <reverse_number+0x5d>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_number>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movl   $0x0,(%rsi)
lea    0x8(%rsp),%rsi
call   1030 <strtod@plt>
mov    0x8(%rsp),%rax
cmpb   $0x0,(%rax)
je     113b <reverse_number+0x2b>
movl   $0x1,(%rbx)
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define double @reverse_number(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast i8** %3 to i8*
%5 = call double @strtod(i8* %0, i8** %3)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
store i32 1, i32* %1
br label %10
10: ; preds = %2, %9
%11 = phi double [ 0.000000e+00, %9 ], [ %5, %2 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ parse(long, int *, int *, int *);
int get_pday(long day) {
  int y, m, d;
  parse(day, &y, &m, &d);
  return d;
}


x86 assembly (clang, -O0):
<get_pday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1030 <parse@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pday>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <parse@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @get_pday(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %2
%6 = load i64, i64* %2
%7 = call i32 @parse(i64 %6, i32* %3, i32* %4, i32* %5)
%8 = load i32, i32* %5
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_pday(i64 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @parse(i64 %0, i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %4
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ MyIprtPrintf(char *, ...);
void foo(void) {
  MyIprtPrintf(0);
  MyIprtPrintf("%RX32 %d %s\n", 10, 42, "string");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
mov    $0x0,%al
call   1030 <MyIprtPrintf@plt>
lea    0xeda(%rip),%rdi
mov    $0xa,%esi
mov    $0x2a,%edx
lea    0xed6(%rip),%rcx
mov    $0x0,%al
call   1030 <MyIprtPrintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <MyIprtPrintf@plt>
lea    0xedf(%rip),%rdi
lea    0xee5(%rip),%rcx
mov    $0xa,%esi
mov    $0x2a,%edx
xor    %eax,%eax
pop    %r8
jmp    1030 <MyIprtPrintf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%RX32 %d %s\0A\00"
@.str.1 = [7 x i8] c"string\00"
define void @foo() {
%1 = call i32 (i8*, ...) @MyIprtPrintf(i8* null)
%2 = call i32 (i8*, ...) @MyIprtPrintf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 10, i32 42, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%RX32 %d %s\0A\00"
@.str.1 = [7 x i8] c"string\00"
define void @foo() {
%1 = tail call i32 (i8*, ...) @MyIprtPrintf(i8* null)
%2 = tail call i32 (i8*, ...) @MyIprtPrintf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 10, i32 42, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char hexdigit(char c) { return c > 9 ? c - 10 + 'a' : c + '0'; }


x86 assembly (clang, -O0):
<hexdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jle    1129 <hexdigit+0x29>
movsbl -0x1(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <hexdigit+0x33>
movsbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdigit>:
cmp    $0xa,%dil
mov    $0x57,%ecx
mov    $0x30,%eax
cmovge %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @hexdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sgt i32 %4, 9
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 10
%10 = add nsw i32 %9, 97
br label %15
11: ; preds = %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 48
br label %15
15: ; preds = %11, %6
%16 = phi i32 [ %10, %6 ], [ %14, %11 ]
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @hexdigit(i8 signext %0) {
%2 = icmp sgt i8 %0, 9
%3 = select i1 %2, i8 87, i8 48
%4 = add i8 %3, %0
ret i8 %4
}
void f2() {
#pragma omp declare reduction(foo                                              \
                              : struct S                                       \
                              : omp_out.s += omp_in.s)                         \
    initializer(bar(&omp_priv))
#pragma omp declare reduction(bar                                              \
                              : struct S                                       \
                              : omp_out.s += omp_in.s)                         \
    initializer(bar(&omp_orig))
}


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

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

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

LLVM IR (-O2):
define void @f2() {
ret void
}
void rop3_99_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_99_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_99_0_0>:
not    %dl
or     (%rdi),%dl
xor    %sil,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_99_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = xor i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_99_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = xor i8 %6, %1
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mock_push(int /*<<< orphan*/);
int /*<<< orphan*/ pack_glPushMatrix(int /*<<< orphan*/ *);
void gles_glPushMatrix() {
  { mock_push(pack_glPushMatrix(NULL)); };
}


x86 assembly (clang, -O0):
<gles_glPushMatrix>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pack_glPushMatrix@plt>
mov    %eax,%edi
call   1030 <mock_push@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gles_glPushMatrix() {
%1 = call i32 @pack_glPushMatrix(i32* null)
%2 = call i32 @mock_push(i32 %1)
ret void
}

LLVM IR (-O2):
define void @gles_glPushMatrix() {
%1 = tail call i32 @pack_glPushMatrix(i32* null)
%2 = tail call i32 @mock_push(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ strlen(char const *);
int write(int, char const *, scalar_t__);
int Serialize_WriteName(int Stream, const char *Name) {
  return write(Stream, Name, strlen(Name) + 1);
}


x86 assembly (clang, -O0):
<Serialize_WriteName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Serialize_WriteName>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @Serialize_WriteName(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i32 @write(i32 %5, i8* %6, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @Serialize_WriteName(i32 %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @write(i32 %0, i8* %1, i64 %4)
ret i32 %5
}
double jac_chain_nm8_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<jac_chain_nm8_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm8_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @jac_chain_nm8_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @jac_chain_nm8_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fstat(int, struct stat *);
mode_t mode(int fd) {
  struct stat st;
  if (fstat(fd, &st) == -1) {
    exit(EXIT_FAILURE);
  }
  return st.st_mode;
}


x86 assembly (clang, -O0):
<mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
jne    114e <mode+0x2e>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode>:
push   %rax
mov    %rsp,%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
je     1133 <mode+0x13>
mov    (%rsp),%eax
pop    %rcx
ret
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@EXIT_FAILURE = global i32 0
define i32 @mode(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fstat(i32 %4, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@EXIT_FAILURE = global i32 0
define i32 @mode(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ monitor_send_info(char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
void monitor_send_details_version(void) {
  char buf[256];
  snprintf(buf, sizeof(buf), "[V-0000]version=%s, build=%s, system=%s\n",
           "1.20-unstable_svn", "test", "unknown");
  monitor_send_info(buf, 1);
}


x86 assembly (clang, -O0):
<monitor_send_details_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
lea    0xec2(%rip),%rdx
lea    0xee4(%rip),%rcx
lea    0xeef(%rip),%r8
lea    0xeed(%rip),%r9
call   1030 <snprintf@plt>
lea    -0x100(%rbp),%rdi
mov    $0x1,%esi
call   1040 <monitor_send_info@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monitor_send_details_version>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rdx
lea    0xef3(%rip),%rcx
lea    0xefe(%rip),%r8
lea    0xefc(%rip),%r9
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <monitor_send_info@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"[V-0000]version=%s, build=%s, system=%s\0A\00"
@.str.1 = [18 x i8] c"1.20-unstable_svn\00"
@.str.2 = [5 x i8] c"test\00"
@.str.3 = [8 x i8] c"unknown\00"
define void @monitor_send_details_version() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 256, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @monitor_send_info(i8* %4, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"[V-0000]version=%s, build=%s, system=%s\0A\00"
@.str.1 = [18 x i8] c"1.20-unstable_svn\00"
@.str.2 = [5 x i8] c"test\00"
@.str.3 = [8 x i8] c"unknown\00"
define void @monitor_send_details_version() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 256, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @monitor_send_info(i8* %2, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
size_t write_FD_BE(int, int /*<<< orphan*/ const *, int);
size_t uint64WriteToFD(int fd, const uint64_t *data) {
  return write_FD_BE(fd, data, sizeof(uint64_t));
}


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

x86 assembly (clang, -O2):
<uint64WriteToFD>:
mov    $0x4,%edx
jmp    1030 <write_FD_BE@plt>

LLVM IR (-O0):
define i64 @uint64WriteToFD(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 i64 @write_FD_BE(i32 %5, i32* %6, i32 4)
ret i64 %7
}

LLVM IR (-O2):
define i64 @uint64WriteToFD(i32 %0, i32* %1) {
%3 = tail call i64 @write_FD_BE(i32 %0, i32* %1, i32 4)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int inotify_rm_watch(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int inotify_glue_ignore(int fd, uint32_t wd) {
  int ret;
  ret = inotify_rm_watch(fd, wd);
  if (ret < 0)
    perror("inotify_rm_watch");
  return ret;
}


x86 assembly (clang, -O0):
<inotify_glue_ignore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <inotify_rm_watch@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1152 <inotify_glue_ignore+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inotify_glue_ignore>:
push   %rbx
call   1040 <inotify_rm_watch@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1130 <inotify_glue_ignore+0x10>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1030 <perror@plt>
jmp    112c <inotify_glue_ignore+0xc>

LLVM IR (-O0):
@.str = [17 x i8] c"inotify_rm_watch\00"
define i32 @inotify_glue_ignore(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @inotify_rm_watch(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
@.str = [17 x i8] c"inotify_rm_watch\00"
define i32 @inotify_glue_ignore(i32 %0, i32 %1) {
%3 = tail call i32 @inotify_rm_watch(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int isFragmented(unsigned char b) {
  int tmp = b >> 5;
  if (tmp & 0x01) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isFragmented>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
sar    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112f <isFragmented+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <isFragmented+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFragmented>:
shr    $0x5,%dil
and    $0x1,%dil
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @isFragmented(i8 zeroext %0) {
%2 = lshr i8 %0, 5
%3 = and i8 %2, 1
%4 = zext i8 %3 to i32
ret i32 %4
}