xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __rev_mix(int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t krhash_mod(uint32_t hash, uint32_t prevValue, uint32_t newValue,
                    uint32_t counter) {
  hash ^= __rev_mix(prevValue, counter);
  hash ^= __rev_mix(newValue, counter);
  return hash;
}


x86 assembly (clang, -O0):
<krhash_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <__rev_mix@plt>
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <__rev_mix@plt>
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<krhash_mod>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %edi,%r15d
mov    %esi,%edi
mov    %ecx,%esi
call   1030 <__rev_mix@plt>
mov    %eax,%ebp
xor    %r15d,%ebp
mov    %r14d,%edi
mov    %ebx,%esi
call   1030 <__rev_mix@plt>
xor    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @krhash_mod(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @__rev_mix(i32 %1, i32 %3)
%6 = xor i32 %5, %0
%7 = tail call i32 @__rev_mix(i32 %2, i32 %3)
%8 = xor i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_ldrsb(int /*<<< orphan*/);
int /*<<< orphan*/ t16_memio_reg_op();
void t16_ldrsb_reg() { arm_memio_ldrsb(t16_memio_reg_op()); }


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

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

LLVM IR (-O0):
define void @t16_ldrsb_reg() {
%1 = call i32 (...) @t16_memio_reg_op()
%2 = call i32 @arm_memio_ldrsb(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_ldrsb_reg() {
%1 = tail call i32 (...) @t16_memio_reg_op()
%2 = tail call i32 @arm_memio_ldrsb(i32 %1)
ret void
}
void cvt_d_s(float *source, double *dest) { *dest = *source; }


x86 assembly (clang, -O0):
<cvt_d_s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_d_s>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @cvt_d_s(float* %0, double* %1) {
%3 = alloca float*
%4 = alloca double*
store float* %0, float** %3
store double* %1, double** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = fpext float %6 to double
%8 = load double*, double** %4
store double %7, double* %8
ret void
}

LLVM IR (-O2):
define void @cvt_d_s(float* nocapture %0, double* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = fpext float %3 to double
store double %4, double* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_printf_fd(int, char *);
int ft_error_retint(char *str, int code) {
  ft_printf_fd(2, str);
  return (code);
}


x86 assembly (clang, -O0):
<ft_error_retint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x2,%edi
call   1030 <ft_printf_fd@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_error_retint>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
mov    $0x2,%edi
call   1030 <ft_printf_fd@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_error_retint(i8* %0, i32 returned %1) {
%3 = tail call i32 @ft_printf_fd(i32 2, i8* %0)
ret i32 %1
}
/* Variables and functions */
size_t get_capacity(size_t length) { return length + 1; }


x86 assembly (clang, -O0):
<get_capacity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_capacity>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @get_capacity(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 1
ret i64 %4
}

LLVM IR (-O2):
define i64 @get_capacity(i64 %0) {
%2 = add i64 %0, 1
ret i64 %2
}
int do_251() { return 251; }


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

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

LLVM IR (-O0):
define i32 @do_251() {
ret i32 251
}

LLVM IR (-O2):
define i32 @do_251() {
ret i32 251
}
int strp2c(char *cstr, char *pstr) {
  int i;
  for (i = 0; i < pstr[0]; i++)
    cstr[i] = pstr[i + 1];
  cstr[i] = '\0';
  return i;
}


x86 assembly (clang, -O0):
<strp2c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    114e <strp2c+0x4e>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strp2c+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strp2c>:
cmpb   $0x0,(%rsi)
jle    1127 <strp2c+0x27>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
movsbq (%rsi),%rcx
cmp    %rcx,%rax
jl     1110 <strp2c+0x10>
jmp    1129 <strp2c+0x29>
xor    %eax,%eax
mov    %eax,%ecx
movb   $0x0,(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define i32 @strp2c(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp sgt i8 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %2, %5
%6 = phi i64 [ %7, %5 ], [ 0, %2 ]
%7 = add nuw nsw i64 %6, 1
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %9, i8* %10
%11 = load i8, i8* %1
%12 = sext i8 %11 to i64
%13 = icmp slt i64 %7, %12
br i1 %13, label %5, label %14
14: ; preds = %5
%15 = trunc i64 %7 to i32
br label %16
16: ; preds = %14, %2
%17 = phi i32 [ 0, %2 ], [ %15, %14 ]
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %0, i64 %18
store i8 0, i8* %19
ret i32 %17
}
/* Variables and functions */
unsigned int FNVHash(unsigned char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strlen(unsigned char *);
int main(int argc, char *argv[]) {
  unsigned char *str = argv[1];
  unsigned int hash = FNVHash(str, strlen(str));
  if (hash == 0xee3c81d4)
    printf("You win!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1030 <FNVHash@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xee3c81d4,-0x1c(%rbp)
jne    118a <main+0x5a>
lea    0xe7b(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <FNVHash@plt>
cmp    $0xee3c81d4,%eax
jne    115a <main+0x2a>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"You win!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @FNVHash(i8* %11, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, -298024492
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"You win!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strlen(i8* %4)
%6 = tail call i32 @FNVHash(i8* %4, i32 %5)
%7 = icmp eq i32 %6, -298024492
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 0
}
void foo(void) {
  int a, b[100];
  int n;
#pragma acc enter data copyin(a, b) async wait
#pragma acc enter data create(b [20:30]) async wait
#pragma acc enter data(a)
#pragma acc enter data create(b(1 : 10))
#pragma acc exit data delete (a) if (0)
#pragma acc exit data copyout(b) if (a)
#pragma acc exit data delete (b)
#pragma acc enter
#pragma acc exit
#pragma acc enter data
#pragma acc exit data
#pragma acc enter Data
#pragma acc exit copyout(b)
#pragma acc enter for
#pragma acc enter data2
}


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

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int fputc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int putchar(int ch) { return fputc(ch, stdout); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputc(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputc(i32 %0, i32 %2)
ret i32 %3
}
/* Type definitions */
struct htmlPage {
  int dummy;
};
struct htmlCookie {
  int dummy;
};

/* Variables and functions */
struct htmlPage *htmlPageParse(char *, char *);
char *htmlSlurpWithCookies(char *, struct htmlCookie *);
struct htmlPage *htmlPageGetWithCookies(char *url, struct htmlCookie *cookies) {
  char *buf = htmlSlurpWithCookies(url, cookies);
  return htmlPageParse(url, buf);
}


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

x86 assembly (clang, -O2):
<htmlPageGetWithCookies>:
push   %rbx
mov    %rdi,%rbx
call   1040 <htmlSlurpWithCookies@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <htmlPageParse@plt>

LLVM IR (-O0):
%struct.htmlPage = type { i32 }
%struct.htmlCookie = type { i32 }
define %struct.htmlPage* @htmlPageGetWithCookies(i8* %0, %struct.htmlCookie* %1) {
%3 = alloca i8*
%4 = alloca %struct.htmlCookie*
%5 = alloca i8*
store i8* %0, i8** %3
store %struct.htmlCookie* %1, %struct.htmlCookie** %4
%6 = load i8*, i8** %3
%7 = load %struct.htmlCookie*, %struct.htmlCookie** %4
%8 = call i8* @htmlSlurpWithCookies(i8* %6, %struct.htmlCookie* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %5
%11 = call %struct.htmlPage* @htmlPageParse(i8* %9, i8* %10)
ret %struct.htmlPage* %11
}

LLVM IR (-O2):
%struct.htmlPage = type { i32 }
%struct.htmlCookie = type { i32 }
define %struct.htmlPage* @htmlPageGetWithCookies(i8* %0, %struct.htmlCookie* %1) {
%3 = tail call i8* @htmlSlurpWithCookies(i8* %0, %struct.htmlCookie* %1)
%4 = tail call %struct.htmlPage* @htmlPageParse(i8* %0, i8* %3)
ret %struct.htmlPage* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main() {
  double a, b;
  scanf("%lf %lf", &a, &b);
  printf("MEDIA = %.5lf\n", (3.5 * a + 7.5 * b) / (3.5 + 7.5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xeab(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeed(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xeb2(%rip),%xmm1
mulsd  0xeb2(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xeae(%rip),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [15 x i8] c"MEDIA = %.5lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%5 = load double, double* %2
%6 = load double, double* %3
%7 = fmul double 7.500000e+00, %6
%8 = call double @llvm.fmuladd.f64(double 3.500000e+00, double %5, double %7)
%9 = fdiv double %8, 1.100000e+01
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [15 x i8] c"MEDIA = %.5lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = fmul double %7, 7.500000e+00
%9 = call double @llvm.fmuladd.f64(double %6, double 3.500000e+00, double %8)
%10 = fdiv double %9, 1.100000e+01
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printOddInts(int n) {
  if (n == 0)
    return;
  if (n % 2 != 0) {
    printf("%d\n", n);
  }
  printOddInts(n - 1);
}


x86 assembly (clang, -O0):
<printOddInts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <printOddInts+0x1a>
jmp    1168 <printOddInts+0x48>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     115d <printOddInts+0x3d>
mov    -0x4(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <printOddInts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printOddInts>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     1146 <printOddInts+0x36>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
jmp    1135 <printOddInts+0x25>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xffffffff,%ebx
je     1146 <printOddInts+0x36>
test   $0x1,%bl
je     1130 <printOddInts+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <printOddInts+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @printOddInts(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %9
%4 = phi i32 [ %10, %9 ], [ %0, %1 ]
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %9
9: ; preds = %7, %3
%10 = add nsw i32 %4, -1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %9, %1
ret void
}
int test_imm_69int64_highword_reg(long long val) {
  return ((val >> 32) & (0x69 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_69int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 105
%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_69int64_highword_reg(i64 %0) {
%2 = and i64 %0, 450971566080
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
unsigned int syscall(int /*<<< orphan*/);
unsigned int process_get_thread_id() { return syscall(SYS_gettid); }


x86 assembly (clang, -O0):
<process_get_thread_id>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_get_thread_id>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i32 @process_get_thread_id() {
%1 = load i32, i32* @SYS_gettid
%2 = call i32 @syscall(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i32 @process_get_thread_id() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i32 @syscall(i32 %1)
ret i32 %2
}
int DB_InitReadSortedIndex_Native(void *db) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DB_InitReadSortedIndex_Native(i8* nocapture readnone %0) {
ret i32 0
}
void led_off() { *((volatile unsigned long *)0x7f008824) = 0x0f; }


x86 assembly (clang, -O0):
<led_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008824,%eax
movq   $0xf,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_off>:
movq   $0xf,0x7f008824
ret

LLVM IR (-O0):
define void @led_off() {
store volatile i64 15, i64* inttoptr (i64 2130741284 to i64*)
ret void
}

LLVM IR (-O2):
define void @led_off() {
store volatile i64 15, i64* inttoptr (i64 2130741284 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __FHHashStringReleaseCallback(const void *key) { free((void *)key); }


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

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

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

LLVM IR (-O2):
define void @__FHHashStringReleaseCallback(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
void f4(int size) {
  if (size > 0) {
    void *ptr = malloc(size);
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114a <f4+0x2a>
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
test   %edi,%edi
jle    1133 <f4+0x13>
push   %rax
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @f4(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i8* @malloc(i32 %0)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int PN5180A_writeRegister(int, int /*<<< orphan*/);
bool PN5180A_clearIRQStatus(uint32_t irqMask) {
  return PN5180A_writeRegister((0x03), irqMask);
}


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

x86 assembly (clang, -O2):
<PN5180A_clearIRQStatus>:
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <PN5180A_writeRegister@plt>

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

LLVM IR (-O2):
define i32 @PN5180A_clearIRQStatus(i32 %0) {
%2 = tail call i32 @PN5180A_writeRegister(i32 3, i32 %0)
ret i32 %2
}
void switch_init(void) {
  *(volatile unsigned int *)(0xB2000000 + (0x0028)) = (0x3F << 0);
  *(volatile unsigned int *)(0xB2000000 + (0x0024)) = (1 << 0);
  *(volatile unsigned int *)(0xB2000000 + (0x00B8)) = 0;
  *(volatile unsigned int *)(0xB2000000 + (0x00BC)) = 0;
  *(volatile unsigned int *)(0xB2000000 + (0x0100)) = 0;
  *(volatile unsigned int *)(0xB2000000 + (0x0104)) = 0;
  *(volatile unsigned int *)(0xB2000000 + (0x0108)) = 0;
  *(volatile unsigned int *)(0xB2000000 + (0x010C)) = 0;
  *(volatile unsigned int *)(0xB2000000 + (0x0110)) = 0;
}


x86 assembly (clang, -O0):
<switch_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb2000028,%eax
movl   $0x3f,(%rax)
mov    $0xb2000024,%eax
movl   $0x1,(%rax)
mov    $0xb20000b8,%eax
movl   $0x0,(%rax)
mov    $0xb20000bc,%eax
movl   $0x0,(%rax)
mov    $0xb2000100,%eax
movl   $0x0,(%rax)
mov    $0xb2000104,%eax
movl   $0x0,(%rax)
mov    $0xb2000108,%eax
movl   $0x0,(%rax)
mov    $0xb200010c,%eax
movl   $0x0,(%rax)
mov    $0xb2000110,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_init>:
mov    $0xb2000024,%eax
movl   $0x3f,0x4(%rax)
movl   $0x1,(%rax)
movl   $0x0,0x94(%rax)
movl   $0x0,0x98(%rax)
movl   $0x0,0xdc(%rax)
movl   $0x0,0xe0(%rax)
movl   $0x0,0xe4(%rax)
movl   $0x0,0xe8(%rax)
movl   $0x0,0xec(%rax)
ret

LLVM IR (-O0):
define void @switch_init() {
store volatile i32 63, i32* inttoptr (i64 2986344488 to i32*)
store volatile i32 1, i32* inttoptr (i64 2986344484 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344632 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344636 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344704 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344708 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344712 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344716 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344720 to i32*)
ret void
}

LLVM IR (-O2):
define void @switch_init() {
store volatile i32 63, i32* inttoptr (i64 2986344488 to i32*)
store volatile i32 1, i32* inttoptr (i64 2986344484 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344632 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344636 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344704 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344708 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344712 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344716 to i32*)
store volatile i32 0, i32* inttoptr (i64 2986344720 to i32*)
ret void
}
main() {
  int a;
  int b, c;
  b + 1;
  b = c;
  int *p;
  b = *p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = load i32, i32* %3
store i32 %7, i32* %2
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
store i32 %9, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_gettid(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_gettid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_gettid>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_gettid(i32 %0, %struct.target* %1) {
%3 = alloca i32
%4 = alloca %struct.target*
%5 = alloca i8*
store i32 %0, i32* %3
store %struct.target* %1, %struct.target** %4
%6 = call i8* @malloc(i32 5)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @snprintf(i8* %7, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_gettid(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void system_error(const char *message) {
  perror(message);
  exit(1);
}


x86 assembly (clang, -O0):
<system_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<system_error>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @system_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @system_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printchar(int /*<<< orphan*/, char);
int printf(char const *);
int puts(const char *s) {
  int result = printf(s);
  printchar(0, '\n');
  printchar(0, '\r');
  return result;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <printf@plt>
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
mov    $0xa,%esi
call   1030 <printchar@plt>
xor    %edi,%edi
mov    $0xd,%esi
call   1030 <printchar@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
call   1040 <printf@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    $0xa,%esi
call   1030 <printchar@plt>
xor    %edi,%edi
mov    $0xd,%esi
call   1030 <printchar@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* %4)
store i32 %5, i32* %3
%6 = call i32 @printchar(i32 0, i8 signext 10)
%7 = call i32 @printchar(i32 0, i8 signext 13)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @printchar(i32 0, i8 signext 10)
%4 = tail call i32 @printchar(i32 0, i8 signext 13)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr,
          "usage: %s -1 <otp1> -2 <otp2> [-u <user>] [-k <key>] [-c "
          "<challenge>] [-i <counter>] [-f <counter>] [-d]\n",
          progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [106 x i8] c"usage: %s -1 <otp1> -2 <otp2> [-u <user>] [-k <key>] [-c <challenge>] [-i <counter>] [-f <counter>] [-d]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [106 x i8] c"usage: %s -1 <otp1> -2 <otp2> [-u <user>] [-k <key>] [-c <challenge>] [-i <counter>] [-f <counter>] [-d]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ r_info;
};
typedef TYPE_1__ Elf32_Rel;

/* Variables and functions */
int /*<<< orphan*/ ELF32_R_INFO(unsigned int, unsigned int);
int /*<<< orphan*/ w(int /*<<< orphan*/);
void fn_ELF32_R_INFO(Elf32_Rel *const rp, unsigned sym, unsigned type) {
  rp->r_info = w(ELF32_R_INFO(sym, type));
}


x86 assembly (clang, -O0):
<fn_ELF32_R_INFO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <ELF32_R_INFO@plt>
mov    %eax,%edi
call   1040 <w@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_ELF32_R_INFO>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <ELF32_R_INFO@plt>
mov    %eax,%edi
call   1040 <w@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define void @fn_ELF32_R_INFO(%struct.TYPE_3__* %0, i32 %1, i32 %2) {
%4 = alloca %struct.TYPE_3__*
%5 = alloca i32
%6 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = call i32 @ELF32_R_INFO(i32 %7, i32 %8)
%10 = call i32 @w(i32 %9)
%11 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i32 0, i32 0
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define void @fn_ELF32_R_INFO(%struct.TYPE_3__* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = tail call i32 @ELF32_R_INFO(i32 %1, i32 %2)
%5 = tail call i32 @w(i32 %4)
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
float max(float, double);
float brightness(float v, float brightness_value) {
  return max(v + brightness_value, 0.0);
}


x86 assembly (clang, -O0):
<brightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
call   1030 <max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brightness>:
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
jmp    1030 <max@plt>

LLVM IR (-O0):
define float @brightness(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
%8 = call float @max(float %7, double 0.000000e+00)
ret float %8
}

LLVM IR (-O2):
define float @brightness(float %0, float %1) {
%3 = fadd float %0, %1
%4 = tail call float @max(float %3, double 0.000000e+00)
ret float %4
}
/* Type definitions */
struct cmdline_opt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ usage(int /*<<< orphan*/);
void do_help(const struct cmdline_opt *opt __attribute__((unused)), ...) {
  usage(stdout);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<do_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <usage@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<do_help>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <usage@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.cmdline_opt = type { i32 }
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @do_help(%struct.cmdline_opt* %0, ...) {
%2 = alloca %struct.cmdline_opt*
store %struct.cmdline_opt* %0, %struct.cmdline_opt** %2
%3 = load i32, i32* @stdout
%4 = call i32 @usage(i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
%struct.cmdline_opt = type { i32 }
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @do_help(%struct.cmdline_opt* nocapture readnone %0, ...) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @usage(i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
long double __floatdixf(int64_t a) { return (long double)a; }


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

x86 assembly (clang, -O2):
<__floatdixf>:
mov    %rdi,-0x8(%rsp)
fildll -0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @__floatdixf(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @__floatdixf(i64 %0) {
%2 = sitofp i64 %0 to x86_fp80
ret x86_fp80 %2
}
/* Variables and functions */
size_t align(size_t, size_t);
void *resize(void *, size_t, size_t);
void *relot(void *p, size_t old_n, size_t new_n, size_t unit_sz,
            size_t log_lot) {
  return resize(p, align(old_n, log_lot) * unit_sz,
                align(new_n, log_lot) * unit_sz);
}


x86 assembly (clang, -O0):
<relot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <align@plt>
imul   -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <align@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
imul   -0x20(%rbp),%rdx
call   1040 <resize@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<relot>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r13
mov    %rdx,%r15
mov    %rdi,%r12
mov    %rsi,%rdi
mov    %r8,%rsi
call   1030 <align@plt>
mov    %rax,%rbx
imul   %r13,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <align@plt>
imul   %rax,%r13
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1040 <resize@plt>

LLVM IR (-O0):
define i8* @relot(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i64, i64* %10
%14 = call i64 @align(i64 %12, i64 %13)
%15 = load i64, i64* %9
%16 = mul i64 %14, %15
%17 = load i64, i64* %8
%18 = load i64, i64* %10
%19 = call i64 @align(i64 %17, i64 %18)
%20 = load i64, i64* %9
%21 = mul i64 %19, %20
%22 = call i8* @resize(i8* %11, i64 %16, i64 %21)
ret i8* %22
}

LLVM IR (-O2):
define i8* @relot(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 @align(i64 %1, i64 %4)
%7 = mul i64 %6, %3
%8 = tail call i64 @align(i64 %2, i64 %4)
%9 = mul i64 %8, %3
%10 = tail call i8* @resize(i8* %0, i64 %7, i64 %9)
ret i8* %10
}
/* Variables and functions */
char const *inet_ntop4(void const *, char *, size_t);
char const *inet_ntop6(void const *, char *, size_t);
const char *inet_ntop(int af, const void *src, char *dst, size_t size) {
  switch (af) {
  case 2:
    return (inet_ntop4(src, dst, size));
  case 28:
    return (inet_ntop6(src, dst, size));
  default:
    return (NULL);
  }
}


x86 assembly (clang, -O0):
<inet_ntop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x2,%eax
je     115c <inet_ntop+0x3c>
jmp    114b <inet_ntop+0x2b>
mov    -0x2c(%rbp),%eax
sub    $0x1c,%eax
je     1176 <inet_ntop+0x56>
jmp    1190 <inet_ntop+0x70>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <inet_ntop4@plt>
mov    %rax,-0x8(%rbp)
jmp    1198 <inet_ntop+0x78>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <inet_ntop6@plt>
mov    %rax,-0x8(%rbp)
jmp    1198 <inet_ntop+0x78>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_ntop>:
cmp    $0x1c,%edi
je     1138 <inet_ntop+0x18>
cmp    $0x2,%edi
jne    1146 <inet_ntop+0x26>
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1040 <inet_ntop4@plt>
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <inet_ntop6@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @inet_ntop(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
%10 = load i32, i32* %6
switch i32 %10, label %21 [
i32 2, label %11
i32 28, label %16
]
11: ; preds = %4
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = call i8* @inet_ntop4(i8* %12, i8* %13, i64 %14)
store i8* %15, i8** %5
br label %22
16: ; preds = %4
%17 = load i8*, i8** %7
%18 = load i8*, i8** %8
%19 = load i64, i64* %9
%20 = call i8* @inet_ntop6(i8* %17, i8* %18, i64 %19)
store i8* %20, i8** %5
br label %22
21: ; preds = %4
store i8* null, i8** %5
br label %22
22: ; preds = %21, %16, %11
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
define i8* @inet_ntop(i32 %0, i8* %1, i8* %2, i64 %3) {
switch i32 %0, label %9 [
i32 2, label %5
i32 28, label %7
]
5: ; preds = %4
%6 = tail call i8* @inet_ntop4(i8* %1, i8* %2, i64 %3)
br label %9
7: ; preds = %4
%8 = tail call i8* @inet_ntop6(i8* %1, i8* %2, i64 %3)
br label %9
9: ; preds = %4, %7, %5
%10 = phi i8* [ %8, %7 ], [ %6, %5 ], [ null, %4 ]
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ Util_FreeList(void **, int /*<<< orphan*/);
void Util_FreeStringList(char **list, ssize_t length) {
  Util_FreeList((void **)list, length);
}


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

x86 assembly (clang, -O2):
<Util_FreeStringList>:
jmp    1030 <Util_FreeList@plt>

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

LLVM IR (-O2):
define void @Util_FreeStringList(i8** %0, i32 %1) {
%3 = tail call i32 @Util_FreeList(i8** %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foobar(int);
int main() {
  if (foobar(1) != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <foobar@plt>
cmp    $0x1,%eax
je     1149 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <foobar@plt>
cmp    $0x1,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foobar(i32 1)
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foobar(i32 1)
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void darwin_arm_init_thread_exception_port() {}


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

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

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

LLVM IR (-O2):
define void @darwin_arm_init_thread_exception_port() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delayMicroseconds(int);
int /*<<< orphan*/ digitalWrite(int, int);
void sendBit(int pin, int b) {
  if (b) {
    digitalWrite(pin, 1);
    delayMicroseconds(310);
    digitalWrite(pin, 0);
    delayMicroseconds(1340);
  } else {
    digitalWrite(pin, 1);
    delayMicroseconds(310);
    digitalWrite(pin, 0);
    delayMicroseconds(310);
  }
}


x86 assembly (clang, -O0):
<sendBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1168 <sendBit+0x48>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <digitalWrite@plt>
mov    $0x136,%edi
call   1040 <delayMicroseconds@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <digitalWrite@plt>
mov    $0x53c,%edi
call   1040 <delayMicroseconds@plt>
jmp    1193 <sendBit+0x73>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <digitalWrite@plt>
mov    $0x136,%edi
call   1040 <delayMicroseconds@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <digitalWrite@plt>
mov    $0x136,%edi
call   1040 <delayMicroseconds@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendBit>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1,%esi
call   1030 <digitalWrite@plt>
mov    $0x136,%r14d
mov    $0x136,%edi
call   1040 <delayMicroseconds@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1030 <digitalWrite@plt>
test   %ebx,%ebx
mov    $0x53c,%edi
cmove  %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <delayMicroseconds@plt>

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

LLVM IR (-O2):
define void @sendBit(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = tail call i32 @digitalWrite(i32 %0, i32 1)
%5 = tail call i32 @delayMicroseconds(i32 310)
%6 = tail call i32 @digitalWrite(i32 %0, i32 0)
%7 = select i1 %3, i32 310, i32 1340
%8 = tail call i32 @delayMicroseconds(i32 %7)
ret void
}