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

/* Variables and functions */
void _mm256_storeu_epi16(void *, int /*<<< orphan*/);
void test_mm256_storeu_epi16(void *__P, __m256i __A) {
  return _mm256_storeu_epi16(__P, __A);
}


x86 assembly (clang, -O0):
<test_mm256_storeu_epi16>:
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 <_mm256_storeu_epi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm256_storeu_epi16>:
jmp    1030 <_mm256_storeu_epi16@plt>

LLVM IR (-O0):
define void @test_mm256_storeu_epi16(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
ret void
}

LLVM IR (-O2):
define void @test_mm256_storeu_epi16(i8* %0, i32 %1) {
tail call void @_mm256_storeu_epi16(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_SET_BIT(int, int);
void xburst_cgm_gate_ahb_mon() { MIPS_SET_BIT((0xB0000000 + 0x28), 11); }


x86 assembly (clang, -O0):
<xburst_cgm_gate_ahb_mon>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
mov    $0xb,%esi
call   1030 <MIPS_SET_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_gate_ahb_mon>:
mov    $0xb0000028,%edi
mov    $0xb,%esi
jmp    1030 <MIPS_SET_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_gate_ahb_mon() {
%1 = call i32 @MIPS_SET_BIT(i32 -1342177240, i32 11)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_gate_ahb_mon() {
%1 = tail call i32 @MIPS_SET_BIT(i32 -1342177240, i32 11)
ret void
}
void megalog_init(flags) int flags;
{}


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

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

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

LLVM IR (-O2):
define void @megalog_init(i32 %0) {
ret void
}
int upper_case(int l) {
  int upper_letter = l - 32;
  return upper_letter;
}


x86 assembly (clang, -O0):
<upper_case>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<upper_case>:
lea    -0x20(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @upper_case(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 32
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @upper_case(i32 %0) {
%2 = add nsw i32 %0, -32
ret i32 %2
}
double cos(double x) { return 4; }


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

x86 assembly (clang, -O2):
<cos>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @cos(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @cos(double %0) {
ret double 4.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(long long, int);
void ft_putdigit_fd(long long n, int fd) {
  if ((n / 10) > 0)
    ft_putdigit_fd(n / 10, fd);
  ft_putchar_fd(((n % 10) + '0'), fd);
}


x86 assembly (clang, -O0):
<ft_putdigit_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rax
jle    1160 <ft_putdigit_fd+0x40>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0xc(%rbp),%esi
call   1030 <ft_putdigit_fd@plt>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rdx,%rdi
add    $0x30,%rdi
mov    -0xc(%rbp),%esi
call   1040 <ft_putchar_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putdigit_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
cmp    $0xa,%rdi
jl     114c <ft_putdigit_fd+0x2c>
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mov    %rbx,%rax
mul    %rcx
mov    %rdx,%rdi
shr    $0x3,%rdi
mov    %ebp,%esi
call   1030 <ft_putdigit_fd@plt>
movabs $0x6666666666666667,%rcx
66 66 66
mov    %rbx,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
add    %rdx,%rdx
lea    (%rdx,%rdx,4),%rax
neg    %rax
lea    (%rbx,%rax,1),%rdi
add    $0x30,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ft_putchar_fd@plt>

LLVM IR (-O0):
define void @ft_putdigit_fd(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = sdiv i64 %5, 10
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i64, i64* %3
%10 = sdiv i64 %9, 10
%11 = load i32, i32* %4
br label %12
12: ; preds = %8, %2
%13 = load i64, i64* %3
%14 = srem i64 %13, 10
%15 = add nsw i64 %14, 48
%16 = load i32, i32* %4
%17 = call i32 @ft_putchar_fd(i64 %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @ft_putdigit_fd(i64 %0, i32 %1) {
%3 = icmp sgt i64 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = udiv i64 %0, 10
tail call void @ft_putdigit_fd(i64 %5, i32 %1)
br label %6
6: ; preds = %4, %2
%7 = srem i64 %0, 10
%8 = add nsw i64 %7, 48
%9 = tail call i32 @ft_putchar_fd(i64 %8, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void wait_for_zombie(int s) {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<wait_for_zombie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <wait_for_zombie+0x31>
jmp    111b <wait_for_zombie+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_zombie>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <wait_for_zombie+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @wait_for_zombie(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @wait_for_zombie(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int setreuid(int /*<<< orphan*/, int);
int setruid(uid_t ruid) { return (setreuid(ruid, -1)); }


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

x86 assembly (clang, -O2):
<setruid>:
mov    $0xffffffff,%esi
jmp    1030 <setreuid@plt>

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

LLVM IR (-O2):
define i32 @setruid(i32 %0) {
%2 = tail call i32 @setreuid(i32 %0, i32 -1)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t atoi(const char *s) {
  uint32_t n = 0;
  while (((*s) >= '0' && (*s) <= '9'))
    n = 10 * n + *s++ - '0';
  return n;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     1134 <atoi+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <atoi+0x44>
jmp    1167 <atoi+0x67>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <atoi+0x20>
ret

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 48
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 57
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %25
16: ; preds = %14
%17 = load i32, i32* %3
%18 = mul nsw i32 10, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
%21 = load i8, i8* %19
%22 = sext i8 %21 to i32
%23 = add nsw i32 %18, %22
%24 = sub nsw i32 %23, 48
store i32 %24, i32* %3
br label %4
25: ; preds = %14
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %13, %5 ], [ 0, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = add i32 %10, -48
%13 = add i32 %12, %9
%14 = load i8, i8* %11
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mm_free(void *mem_addr) {
  ;
  free(mem_addr);
}


x86 assembly (clang, -O0):
<mm_free>:
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):
<mm_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mm_free(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 @mm_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void report(char *str) {}


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

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

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

LLVM IR (-O2):
define void @report(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  int c, nl;
  nl = 0;
  while ((c = getchar()) != EOF)
    if (c == '\n')
      ++nl;
  printf("%d\n", nl);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     1167 <main+0x47>
cmpl   $0xa,-0x8(%rbp)
jne    1162 <main+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb4(%rip),%r14
cmp    (%r14),%eax
je     1156 <main+0x36>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}
/* Variables and functions */
char toupper(char);
void mem_toupper(char *f, size_t len) {
  while (len) {
    *f = toupper(*f);
    f++;
    len--;
  }
}


x86 assembly (clang, -O0):
<mem_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <mem_toupper+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <mem_toupper+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_toupper>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1147 <mem_toupper+0x37>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <mem_toupper+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @mem_toupper(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
br label %5
5: ; preds = %8, %2
%6 = load i64, i64* %4
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call signext i8 @toupper(i8 signext %10)
%12 = load i8*, i8** %3
store i8 %11, i8* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i64, i64* %4
%16 = add i64 %15, -1
store i64 %16, i64* %4
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @mem_toupper(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ %1, %2 ]
%6 = phi i8* [ %9, %4 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = add i64 %5, -1
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int execve(char const *, char *const *, char *const *);
int _execve(const char *path, char *const argv[], char *const envp[]) {
  return execve(path, argv, envp);
}


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

x86 assembly (clang, -O2):
<_execve>:
jmp    1030 <execve@plt>

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

LLVM IR (-O2):
define i32 @_execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @execve(i8* %0, i8** %1, i8** %2)
ret i32 %4
}
void XtError() {}


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

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

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

LLVM IR (-O2):
define void @XtError() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_options();
int /*<<< orphan*/ init_options(int *);
int /*<<< orphan*/ load_options_defaults();
void init_option_handlers(void) {
  static int opt_changed;
  init_options(&opt_changed);
  load_options_defaults();
  add_options();
}


x86 assembly (clang, -O0):
<init_option_handlers>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f01(%rip),%rdi
call   1030 <init_options@plt>
mov    $0x0,%al
call   1050 <load_options_defaults@plt>
mov    $0x0,%al
call   1040 <add_options@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_option_handlers>:
push   %rax
lea    0x2f04(%rip),%rdi
call   1030 <init_options@plt>
xor    %eax,%eax
call   1050 <load_options_defaults@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <add_options@plt>

LLVM IR (-O0):
@init_option_handlers.opt_changed = internal global i32 0
define void @init_option_handlers() {
%1 = call i32 @init_options(i32* @init_option_handlers.opt_changed)
%2 = call i32 (...) @load_options_defaults()
%3 = call i32 (...) @add_options()
ret void
}

LLVM IR (-O2):
@init_option_handlers.opt_changed = internal global i32 0
define void @init_option_handlers() {
%1 = tail call i32 @init_options(i32* @init_option_handlers.opt_changed)
%2 = tail call i32 (...) @load_options_defaults()
%3 = tail call i32 (...) @add_options()
ret void
}
void ohci_dump(struct ohci_hcd *controller, int verbose) {}


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

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

LLVM IR (-O0):
%struct.ohci_hcd = type opaque
define void @ohci_dump(%struct.ohci_hcd* %0, i32 %1) {
%3 = alloca %struct.ohci_hcd*
%4 = alloca i32
store %struct.ohci_hcd* %0, %struct.ohci_hcd** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.ohci_hcd = type opaque
define void @ohci_dump(%struct.ohci_hcd* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void _Q_uxtoq(void) {
  printf("Unimplemented %s called, exiting\n", "_Q_uxtoq");
  exit(-1);
}


x86 assembly (clang, -O0):
<_Q_uxtoq>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xef0(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_Q_uxtoq>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef3(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [9 x i8] c"_Q_uxtoq\00"
define void @_Q_uxtoq() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [9 x i8] c"_Q_uxtoq\00"
define void @_Q_uxtoq() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
int test_imm_61uint32_mem(unsigned int *val) {
  return ((*val) & (0x61 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_61uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x61,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_61uint32_mem>:
testb  $0x61,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_61uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 97
%6 = icmp ne i32 %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_61uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 97
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void RS485_Cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @RS485_Cleanup() {
ret void
}
unsigned long lumod(unsigned long a, unsigned long b) { return a % b; }


x86 assembly (clang, -O0):
<lumod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lumod>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1118 <lumod+0x18>
xor    %edx,%edx
div    %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @lumod(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = urem i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @lumod(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (foo() != 42) {
    return 1;
  }
  fprintf(stderr, "ok\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x2a,%eax
je     1152 <main+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116e <main+0x4e>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2a,%ecx
jne    114b <main+0x2b>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"ok\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @foo()
%7 = icmp ne i32 %6, 42
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"ok\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
%4 = icmp eq i32 %3, 42
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fun(char *, char *);
int /*<<< orphan*/ puts(char *);
void main() {
  char a[] = "abcedf", b[] = "fk";
  fun(a, b);
  puts(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec4(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    0xeb3(%rip),%al
mov    %al,-0x8(%rbp)
lea    -0x7(%rbp),%rdi
lea    -0xa(%rbp),%rsi
call   1040 <fun@plt>
lea    -0x7(%rbp),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x666465,0xb(%rsp)
movl   $0x65636261,0x8(%rsp)
65
movb   $0x0,0x6(%rsp)
movw   $0x6b66,0x4(%rsp)
lea    0x8(%rsp),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <fun@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [7 x i8] c"abcedf\00"
@__const.main.b = [3 x i8] c"fk\00"
define void @main() {
%1 = alloca [7 x i8]
%2 = alloca [3 x i8]
%3 = bitcast [7 x i8]* %1 to i8*
%4 = bitcast [3 x i8]* %2 to i8*
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%7 = call i32 @fun(i8* %5, i8* %6)
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
ret void
}

LLVM IR (-O2):
@__const.main.a = [7 x i8] c"abcedf\00"
@__const.main.b = [3 x i8] c"fk\00"
define void @main() {
%1 = alloca [7 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @fun(i8* %3, i8* %4)
%6 = call i32 @puts(i8* %3)
ret void
}
void foo671() {}


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

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

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

LLVM IR (-O2):
define void @foo671() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cgdec2ib(void) { ngen("%s\t(%%edx)", "decb", 0); }


x86 assembly (clang, -O0):
<cgdec2ib>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %edx,%edx
call   1030 <ngen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdec2ib>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09(%%edx)\00"
@.str.1 = [5 x i8] c"decb\00"
define void @cgdec2ib() {
%1 = call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09(%%edx)\00"
@.str.1 = [5 x i8] c"decb\00"
define void @cgdec2ib() {
%1 = tail call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 7, 12);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0xc,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0xc,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 12)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 12)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ binom(int, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  printf("%lu\n", binom(7, 3));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i32 @binom(i32 7, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Lcd_Draw_Pixel(int, int, int);
void Lcd_Draw_Vine(int col, int row1, int row2, int color) {
  int i;
  for (i = row1; i <= row2; i++)
    Lcd_Draw_Pixel(i, col, color);
}


x86 assembly (clang, -O0):
<Lcd_Draw_Vine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1152 <Lcd_Draw_Vine+0x42>
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <Lcd_Draw_Pixel@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <Lcd_Draw_Vine+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lcd_Draw_Vine>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jg     1144 <Lcd_Draw_Vine+0x34>
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
mov    %edi,%r15d
add    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r15d,%esi
mov    %r14d,%edx
call   1030 <Lcd_Draw_Pixel@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1130 <Lcd_Draw_Vine+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Lcd_Draw_Vine(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, %2
br i1 %5, label %11, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %1, %4 ]
%8 = tail call i32 @Lcd_Draw_Pixel(i32 %7, i32 %0, i32 %3)
%9 = add i32 %7, 1
%10 = icmp eq i32 %7, %2
br i1 %10, label %11, label %6
11: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ w_pawns_able_to_double_push(int, int);
void w_pawns_able_to_double_push_test(void **state) {
  assert_int_equal(0, w_pawns_able_to_double_push(0x000000001422C100ul,
                                                  0x00000000C1000000ul));
  assert_int_equal(
      0x0000000000008100ul,
      w_pawns_able_to_double_push(0x000000001422C100ul, 0x00000000C1810000ul));
}


x86 assembly (clang, -O0):
<w_pawns_able_to_double_push_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1422c100,%edi
mov    $0xc1000000,%esi
call   1030 <w_pawns_able_to_double_push@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <assert_int_equal@plt>
mov    $0x1422c100,%edi
mov    $0xc1810000,%esi
call   1030 <w_pawns_able_to_double_push@plt>
mov    %eax,%esi
mov    $0x8100,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_pawns_able_to_double_push_test>:
push   %rax
mov    $0x1422c100,%edi
mov    $0xc1000000,%esi
call   1030 <w_pawns_able_to_double_push@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1040 <assert_int_equal@plt>
mov    $0x1422c100,%edi
mov    $0xc1810000,%esi
call   1030 <w_pawns_able_to_double_push@plt>
mov    $0x8100,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @w_pawns_able_to_double_push_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @w_pawns_able_to_double_push(i32 337821952, i32 -1056964608)
%4 = call i32 @assert_int_equal(i32 0, i32 %3)
%5 = call i32 @w_pawns_able_to_double_push(i32 337821952, i32 -1048510464)
%6 = call i32 @assert_int_equal(i32 33024, i32 %5)
ret void
}

LLVM IR (-O2):
define void @w_pawns_able_to_double_push_test(i8** nocapture readnone %0) {
%2 = tail call i32 @w_pawns_able_to_double_push(i32 337821952, i32 -1056964608)
%3 = tail call i32 @assert_int_equal(i32 0, i32 %2)
%4 = tail call i32 @w_pawns_able_to_double_push(i32 337821952, i32 -1048510464)
%5 = tail call i32 @assert_int_equal(i32 33024, i32 %4)
ret void
}
/* Variables and functions */
double T0(double const);
double epsilon(const double et) { return 23.439 - 0.013 * T0(et); }


x86 assembly (clang, -O0):
<epsilon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <T0@plt>
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecd(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epsilon>:
push   %rax
call   1030 <T0@plt>
mulsd  0xee2(%rip),%xmm0
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @epsilon(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @T0(double %3)
%5 = call double @llvm.fmuladd.f64(double -1.300000e-02, double %4, double 2.343900e+01)
ret double %5
}

LLVM IR (-O2):
define double @epsilon(double %0) {
%2 = tail call double @T0(double %0)
%3 = tail call double @llvm.fmuladd.f64(double %2, double -1.300000e-02, double 2.343900e+01)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprint_octet_string(int /*<<< orphan*/ *, unsigned char *,
                                       unsigned char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void dump_pdu(FILE *f, unsigned char *p, unsigned char *e) {
  fprintf(f, "D: ");
  fprint_octet_string(f, p, e);
  fprintf(f, "\n");
}


x86 assembly (clang, -O0):
<dump_pdu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <fprint_octet_string@plt>
mov    -0x8(%rbp),%rdi
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_pdu>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xebb(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <fprint_octet_string@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"D: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @dump_pdu(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @fprint_octet_string(i32* %9, i8* %10, i8* %11)
%13 = load i32*, i32** %4
%14 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"D: \00"
define void @dump_pdu(i32* %0, i8* %1, i8* %2) {
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %0)
%5 = tail call i32 @fprint_octet_string(i32* %0, i8* %1, i8* %2)
%6 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}
int round2(long index) {
  index -= 1;
  index |= index >> 1;
  index |= index >> 2;
  index |= index >> 4;
  index |= index >> 8;
  index |= index >> 16;
  index |= index >> 32;
  return index + 1;
}


x86 assembly (clang, -O0):
<round2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x20,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round2>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
sar    %rcx
or     %rax,%rcx
mov    %rcx,%rax
sar    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
sar    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rax
sar    $0x8,%rax
or     %rcx,%rax
mov    %rax,%rcx
sar    $0x10,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x20,%rax
or     %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @round2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 1
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = ashr i64 %5, 1
%7 = load i64, i64* %2
%8 = or i64 %7, %6
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = ashr i64 %9, 2
%11 = load i64, i64* %2
%12 = or i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = ashr i64 %13, 4
%15 = load i64, i64* %2
%16 = or i64 %15, %14
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = ashr i64 %17, 8
%19 = load i64, i64* %2
%20 = or i64 %19, %18
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = ashr i64 %21, 16
%23 = load i64, i64* %2
%24 = or i64 %23, %22
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = ashr i64 %25, 32
%27 = load i64, i64* %2
%28 = or i64 %27, %26
store i64 %28, i64* %2
%29 = load i64, i64* %2
%30 = add nsw i64 %29, 1
%31 = trunc i64 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @round2(i64 %0) {
%2 = add nsw i64 %0, -1
%3 = ashr i64 %2, 1
%4 = or i64 %3, %2
%5 = ashr i64 %4, 2
%6 = or i64 %5, %4
%7 = ashr i64 %6, 4
%8 = or i64 %7, %6
%9 = ashr i64 %8, 8
%10 = or i64 %9, %8
%11 = ashr i64 %10, 16
%12 = or i64 %11, %10
%13 = lshr i64 %12, 32
%14 = or i64 %13, %12
%15 = trunc i64 %14 to i32
%16 = add i32 %15, 1
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fork();
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ wait(int /*<<< orphan*/);
void main() {
  int i;
  for (i = 0; i < 3; i++) {
    fork();
    wait(0);
  }
  printf("PID = %d\n", getpid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1185 <main+0x35>
mov    $0x0,%al
call   1070 <fork@plt>
xor    %edi,%edi
call   1060 <wait@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115f <main+0xf>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <fork@plt>
xor    %edi,%edi
call   1060 <wait@plt>
xor    %eax,%eax
call   1070 <fork@plt>
xor    %edi,%edi
call   1060 <wait@plt>
xor    %eax,%eax
call   1070 <fork@plt>
xor    %edi,%edi
call   1060 <wait@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe77(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"PID = %d\0A\00"
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 3
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = call i32 (...) @fork()
%7 = call i32 @wait(i32 0)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
%12 = call i32 (...) @getpid()
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"PID = %d\0A\00"
define void @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @wait(i32 0)
%3 = tail call i32 (...) @fork()
%4 = tail call i32 @wait(i32 0)
%5 = tail call i32 (...) @fork()
%6 = tail call i32 @wait(i32 0)
%7 = tail call i32 (...) @getpid()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_8Euint16_mem(unsigned short *val) {
  return ((*val) & (-0x8E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Euint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff72,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Euint16_mem>:
movzwl (%rdi),%eax
test   $0xff72,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Euint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -142
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *ds9_connect(char *tmpl) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @ds9_connect(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int VOLUME_MOD_TO_GB(int v) { return ((v) == 64 ? 0xF : ((v) >> 2)); }


x86 assembly (clang, -O0):
<VOLUME_MOD_TO_GB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jne    111e <VOLUME_MOD_TO_GB+0x1e>
mov    $0xf,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <VOLUME_MOD_TO_GB+0x27>
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VOLUME_MOD_TO_GB>:
mov    %edi,%ecx
sar    $0x2,%ecx
cmp    $0x40,%edi
mov    $0xf,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @VOLUME_MOD_TO_GB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 64
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = ashr i32 %7, 2
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ 15, %5 ], [ %8, %6 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @VOLUME_MOD_TO_GB(i32 %0) {
%2 = icmp eq i32 %0, 64
%3 = ashr i32 %0, 2
%4 = select i1 %2, i32 15, i32 %3
ret i32 %4
}
/* Type definitions */
typedef char *uint64_t;
typedef char *int64_t;

/* Variables and functions */
uint64_t rdtsc(void) {
  int64_t tsc;
  __asm __volatile("rdtsc" : "=A"(tsc));
  return (tsc);
}


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

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

LLVM IR (-O0):
define i8* @rdtsc() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @rdtsc() {
%1 = tail call i8* asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
char *put_integer_r(unsigned int, int, unsigned int const, char const,
                    char *const);
char *put_int_r(const int v, const unsigned w, const char wc, char *const e) {
  return 0 <= v ? put_integer_r((unsigned)v, 0, w, wc, e)
                : put_integer_r((unsigned)-v, -1, w, wc, e);
}


x86 assembly (clang, -O0):
<put_int_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jg     1152 <put_int_r+0x42>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%r8
xor    %esi,%esi
movsbl %al,%ecx
call   1030 <put_integer_r@plt>
mov    %rax,-0x20(%rbp)
jmp    1172 <put_int_r+0x62>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%r8
mov    $0xffffffff,%esi
movsbl %al,%ecx
call   1030 <put_integer_r@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_int_r>:
mov    %rcx,%r8
mov    %edx,%eax
mov    %esi,%edx
test   %edi,%edi
js     1125 <put_int_r+0x15>
movsbl %al,%ecx
xor    %esi,%esi
jmp    1030 <put_integer_r@plt>
neg    %edi
movsbl %al,%ecx
mov    $0xffffffff,%esi
jmp    1030 <put_integer_r@plt>

LLVM IR (-O0):
define i8* @put_int_r(i32 %0, i32 %1, i8 signext %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8 %2, i8* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = icmp sle i32 0, %9
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i8, i8* %7
%15 = load i8*, i8** %8
%16 = call i8* @put_integer_r(i32 %12, i32 0, i32 %13, i8 signext %14, i8* %15)
br label %24
17: ; preds = %4
%18 = load i32, i32* %5
%19 = sub nsw i32 0, %18
%20 = load i32, i32* %6
%21 = load i8, i8* %7
%22 = load i8*, i8** %8
%23 = call i8* @put_integer_r(i32 %19, i32 -1, i32 %20, i8 signext %21, i8* %22)
br label %24
24: ; preds = %17, %11
%25 = phi i8* [ %16, %11 ], [ %23, %17 ]
ret i8* %25
}

LLVM IR (-O2):
define i8* @put_int_r(i32 %0, i32 %1, i8 signext %2, i8* %3) {
%5 = icmp sgt i32 %0, -1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i8* @put_integer_r(i32 %0, i32 0, i32 %1, i8 signext %2, i8* %3)
br label %11
8: ; preds = %4
%9 = sub nsw i32 0, %0
%10 = tail call i8* @put_integer_r(i32 %9, i32 -1, i32 %1, i8 signext %2, i8* %3)
br label %11
11: ; preds = %8, %6
%12 = phi i8* [ %7, %6 ], [ %10, %8 ]
ret i8* %12
}