xunge/DecIR huggingface dataset:
void write_port_byte(unsigned short port, unsigned char data) {
  __asm__("out dx, al" : "=d"(port) : "a"(data));
}


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

LLVM IR (-O0):
LLVM IR (-O2):
define void @write_port_byte(i16 zeroext %0, i8 zeroext %1) {
%3 = tail call i16 asm "out dx, al", "={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i8 %1)
ret void
}
int destinationWordwith(int sourceWord, int destinationWord) {
  return destinationWord;
}


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

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

LLVM IR (-O0):
define i32 @destinationWordwith(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @destinationWordwith(i32 %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void g0_cb(void *arg) { puts("GPIO_0 triggered"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"GPIO_0 triggered\00"
define void @g0_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"GPIO_0 triggered\00"
define void @g0_cb(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
unsigned short __VERIFIER_nondet_ushort() {
  unsigned short initialValue;
  int byteOffset = 0;
  uint8_t *initialValueAsByte = (uint8_t *)&initialValue;
  for (; byteOffset < sizeof(unsigned short); ++byteOffset) {
    initialValueAsByte[byteOffset] = 0;
  }
  return initialValue;
}


x86 assembly (clang, -O0):
<__VERIFIER_nondet_ushort>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x2,%rax
jae    113f <__VERIFIER_nondet_ushort+0x3f>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1113 <__VERIFIER_nondet_ushort+0x13>
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @__VERIFIER_nondet_ushort() {
%1 = alloca i16
%2 = alloca i32
%3 = alloca i64*
store i32 0, i32* %2
%4 = bitcast i16* %1 to i64*
store i64* %4, i64** %3
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 2
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i64*, i64** %3
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %10, i64 %12
store i64 0, i64* %13
br label %14
14: ; preds = %9
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %5
17: ; preds = %5
%18 = load i16, i16* %1
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @__VERIFIER_nondet_ushort() {
ret i16 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t fnv_hash_update(const void *data, size_t size, uint32_t hash) {
  const uint8_t *p = data;
  const uint8_t *q = p + size;
  while (p != q) {
    hash *= (0x01000193);
    hash ^= (uint32_t)(*p++);
  }
  return hash;
}


x86 assembly (clang, -O0):
<fnv_hash_update>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     115e <fnv_hash_update+0x5e>
imul   $0x1000193,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112a <fnv_hash_update+0x2a>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnv_hash_update>:
mov    %edx,%eax
shl    $0x2,%rsi
test   %rsi,%rsi
je     1122 <fnv_hash_update+0x22>
xor    %ecx,%ecx
nopl   (%rax)
imul   $0x1000193,%eax,%eax
xor    (%rdi,%rcx,1),%eax
add    $0x4,%rcx
cmp    %rcx,%rsi
jne    1110 <fnv_hash_update+0x10>
ret

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

LLVM IR (-O2):
define i32 @fnv_hash_update(i8* %0, i64 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 %1
%6 = icmp eq i32* %5, %4
br i1 %6, label %15, label %7
7: ; preds = %3, %7
%8 = phi i32 [ %13, %7 ], [ %2, %3 ]
%9 = phi i32* [ %11, %7 ], [ %4, %3 ]
%10 = mul nsw i32 %8, 16777619
%11 = getelementptr inbounds i32, i32* %9, i64 1
%12 = load i32, i32* %9
%13 = xor i32 %12, %10
%14 = icmp eq i32* %11, %5
br i1 %14, label %15, label %7
15: ; preds = %7, %3
%16 = phi i32 [ %2, %3 ], [ %13, %7 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void exit_tryhelp(int status) {
  fprintf(stderr, "See IPChains.pm documentation for more information.\n");
  exit(status);
}


x86 assembly (clang, -O0):
<exit_tryhelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_tryhelp>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"See IPChains.pm documentation for more information.\0A\00"
define void @exit_tryhelp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"See IPChains.pm documentation for more information.\0A\00"
define void @exit_tryhelp(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
scalar_t__ test0();
scalar_t__ test1();
int main(void) { return ((test0() && test1()) ? 0 : 1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test0@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1159 <main+0x39>
mov    $0x0,%al
call   1030 <test1@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test0@plt>
test   %rax,%rax
je     1141 <main+0x21>
xor    %eax,%eax
call   1030 <test1@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @test0()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i64 (...) @test1()
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %4, %0
%8 = phi i1 [ false, %0 ], [ %6, %4 ]
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @test0()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @test1()
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *stderr;
void c_stderr_(FILE **fp) { *fp = stderr; }


x86 assembly (clang, -O0):
<c_stderr_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_stderr_>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
@stderr = global i32* null
define void @c_stderr_(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32*, i32** @stderr
%4 = load i32**, i32*** %2
store i32* %3, i32** %4
ret void
}

LLVM IR (-O2):
@stderr = global i32* null
define void @c_stderr_(i32** nocapture writeonly %0) {
%2 = load i32*, i32** @stderr
store i32* %2, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ minmax_par(double *, size_t, double *, double *);
double middle_par(double *data, size_t length) {
  double min, max;
  minmax_par(data, length, &min, &max);
  return (min + max) / 2.0;
}


x86 assembly (clang, -O0):
<middle_par>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <minmax_par@plt>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<middle_par>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <minmax_par@plt>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0xec9(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @middle_par(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store i64 %1, i64* %4
%7 = load double*, double** %3
%8 = load i64, i64* %4
%9 = call i32 @minmax_par(double* %7, i64 %8, double* %5, double* %6)
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fadd double %10, %11
%13 = fdiv double %12, 2.000000e+00
ret double %13
}

LLVM IR (-O2):
define double @middle_par(double* %0, i64 %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = call i32 @minmax_par(double* %0, i64 %1, double* %3, double* %4)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = fadd double %8, %9
%11 = fmul double %10, 5.000000e-01
ret double %11
}
unsigned long *f(unsigned long *p) {
  unsigned long a = (*p++) >> 24;
  return p + a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
shr    $0x18,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    (%rdi),%rax
shr    $0x18,%rax
lea    (%rdi,%rax,8),%rax
add    $0x8,%rax
ret

LLVM IR (-O0):
define i64* @f(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i32 1
store i64* %5, i64** %2
%6 = load i64, i64* %4
%7 = lshr i64 %6, 24
store i64 %7, i64* %3
%8 = load i64*, i64** %2
%9 = load i64, i64* %3
%10 = getelementptr inbounds i64, i64* %8, i64 %9
ret i64* %10
}

LLVM IR (-O2):
define i64* @f(i64* %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
%3 = load i64, i64* %0
%4 = lshr i64 %3, 24
%5 = getelementptr inbounds i64, i64* %2, i64 %4
ret i64* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int error(char *msg, int lineNo, int instNo) {
  printf("Line %d", lineNo);
  if (instNo >= 0)
    printf(" (Instruction %d)", instNo);
  printf("   %s\n", msg);
  return 0;
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x10(%rbp)
jl     114e <error+0x3e>
mov    -0x10(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
lea    0xee1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebp,%ebp
js     113a <error+0x2a>
lea    0xed7(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"Line %d\00"
@.str.1 = [18 x i8] c" (Instruction %d)\00"
@.str.2 = [7 x i8] c" %s\0A\00"
define i32 @error(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%5 = icmp sgt i32 %2, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %2)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
struct feed_screen_iterator {
  int dummy;
};
struct feed_screen_info {
  int dummy;
};

/* Variables and functions */
char feed_screen_iterator_test_write(struct feed_screen_info const *const,
                                     struct feed_screen_iterator *const,
                                     unsigned int);
char feed_screen_iterator_test_newline(
    struct feed_screen_info const *const p_screen_info,
    struct feed_screen_iterator *const p_screen_iterator) {
  return feed_screen_iterator_test_write(p_screen_info, p_screen_iterator, 1u);
}


x86 assembly (clang, -O0):
<feed_screen_iterator_test_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <feed_screen_iterator_test_write@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed_screen_iterator_test_newline>:
mov    $0x1,%edx
jmp    1030 <feed_screen_iterator_test_write@plt>

LLVM IR (-O0):
%struct.feed_screen_info = type { i32 }
%struct.feed_screen_iterator = type { i32 }
define signext i8 @feed_screen_iterator_test_newline(%struct.feed_screen_info* %0, %struct.feed_screen_iterator* %1) {
%3 = alloca %struct.feed_screen_info*
%4 = alloca %struct.feed_screen_iterator*
store %struct.feed_screen_info* %0, %struct.feed_screen_info** %3
store %struct.feed_screen_iterator* %1, %struct.feed_screen_iterator** %4
%5 = load %struct.feed_screen_info*, %struct.feed_screen_info** %3
%6 = load %struct.feed_screen_iterator*, %struct.feed_screen_iterator** %4
%7 = call signext i8 @feed_screen_iterator_test_write(%struct.feed_screen_info* %5, %struct.feed_screen_iterator* %6, i32 1)
ret i8 %7
}

LLVM IR (-O2):
%struct.feed_screen_info = type { i32 }
%struct.feed_screen_iterator = type { i32 }
define signext i8 @feed_screen_iterator_test_newline(%struct.feed_screen_info* %0, %struct.feed_screen_iterator* %1) {
%3 = tail call signext i8 @feed_screen_iterator_test_write(%struct.feed_screen_info* %0, %struct.feed_screen_iterator* %1, i32 1)
ret i8 %3
}
int pcapack_rowvars(const int m, const int n, double *x, double *rowvars) {
  int i, j;
}


x86 assembly (clang, -O0):
<pcapack_rowvars>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pcapack_rowvars(i32 %0, i32 %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store double* %2, double** %8
store double* %3, double** %9
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @pcapack_rowvars(i32 %0, i32 %1, double* nocapture readnone %2, double* nocapture readnone %3) {
ret i32 undef
}
int setdown(struct opt *opt) { return 0; }


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

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

LLVM IR (-O0):
%struct.opt = type opaque
define i32 @setdown(%struct.opt* %0) {
%2 = alloca %struct.opt*
store %struct.opt* %0, %struct.opt** %2
ret i32 0
}

LLVM IR (-O2):
%struct.opt = type opaque
define i32 @setdown(%struct.opt* nocapture readnone %0) {
ret i32 0
}
int test_imm_ECint64_midword_reg(long long val) {
  return ((val >> 16) & (0xEC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_ECint64_midword_reg>:
test   $0xec0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_ECint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 236
%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_ECint64_midword_reg(i64 %0) {
%2 = and i64 %0, 15466496
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *wscnstr(int /*<<< orphan*/ const *,
                            int /*<<< orphan*/ const *, size_t);
size_t wscstrnlen(const wchar_t *string, const wchar_t *stop, size_t maxlen) {
  const wchar_t *end = wscnstr(string, stop, maxlen);
  return end ? (size_t)(end - string) : maxlen;
}


x86 assembly (clang, -O0):
<wscstrnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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 <wscnstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115c <wscstrnlen+0x4c>
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %rax,-0x28(%rbp)
jmp    1164 <wscstrnlen+0x54>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wscstrnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <wscnstr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
sar    $0x2,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @wscstrnlen(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%8 = load i32*, i32** %4
%9 = load i32*, i32** %5
%10 = load i64, i64* %6
%11 = call i32* @wscnstr(i32* %8, i32* %9, i64 %10)
store i32* %11, i32** %7
%12 = load i32*, i32** %7
%13 = icmp ne i32* %12, null
br i1 %13, label %14, label %21
14: ; preds = %3
%15 = load i32*, i32** %7
%16 = load i32*, i32** %4
%17 = ptrtoint i32* %15 to i64
%18 = ptrtoint i32* %16 to i64
%19 = sub i64 %17, %18
%20 = sdiv exact i64 %19, 4
br label %23
21: ; preds = %3
%22 = load i64, i64* %6
br label %23
23: ; preds = %21, %14
%24 = phi i64 [ %20, %14 ], [ %22, %21 ]
ret i64 %24
}

LLVM IR (-O2):
define i64 @wscstrnlen(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32* @wscnstr(i32* %0, i32* %1, i64 %2)
%5 = icmp eq i32* %4, null
%6 = ptrtoint i32* %4 to i64
%7 = ptrtoint i32* %0 to i64
%8 = sub i64 %6, %7
%9 = ashr exact i64 %8, 2
%10 = select i1 %5, i64 %2, i64 %9
ret i64 %10
}
int gfx_ctx_check_resolution(unsigned resolution_id) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gfx_ctx_check_resolution(i32 %0) {
ret i32 0
}
double Int(double f) { return ((double)(f)); }


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

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

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

LLVM IR (-O2):
define double @Int(double returned %0) {
ret double %0
}
/* Type definitions */
struct i8x_object {
  int dummy;
};
struct i8x_ctx {
  int dummy;
};

/* Variables and functions */
scalar_t__ i8x_ob_unref(struct i8x_object *);
struct i8x_ctx *__attribute__((always_)) i8x_ctx_unref(struct i8x_ctx *x) {
  return (struct i8x_ctx *)i8x_ob_unref((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_ctx_unref>:
jmp    1030 <i8x_ob_unref@plt>

LLVM IR (-O0):
%struct.i8x_ctx = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_ctx* @i8x_ctx_unref(%struct.i8x_ctx* %0) {
%2 = alloca %struct.i8x_ctx*
store %struct.i8x_ctx* %0, %struct.i8x_ctx** %2
%3 = load %struct.i8x_ctx*, %struct.i8x_ctx** %2
%4 = bitcast %struct.i8x_ctx* %3 to %struct.i8x_object*
%5 = call i64 @i8x_ob_unref(%struct.i8x_object* %4)
%6 = inttoptr i64 %5 to %struct.i8x_ctx*
ret %struct.i8x_ctx* %6
}

LLVM IR (-O2):
%struct.i8x_ctx = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_ctx* @i8x_ctx_unref(%struct.i8x_ctx* %0) {
%2 = bitcast %struct.i8x_ctx* %0 to %struct.i8x_object*
%3 = tail call i64 @i8x_ob_unref(%struct.i8x_object* %2)
%4 = inttoptr i64 %3 to %struct.i8x_ctx*
ret %struct.i8x_ctx* %4
}
/* Variables and functions */
int strlen(char *);
void check_last_char(char *dirpath) {
  int len = strlen(dirpath);
  if (dirpath[len - 1] != '/') {
    dirpath[len++] = '/';
    dirpath[len] = '\0';
  }
}


x86 assembly (clang, -O0):
<check_last_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     1164 <check_last_char+0x54>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movb   $0x2f,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_last_char>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0x2f,-0x1(%rax,%rbx,1)
je     1128 <check_last_char+0x18>
movw   $0x2f,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @check_last_char(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 47
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = add nsw i32 %2, 1
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 47, i8* %11
%12 = sext i32 %9 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 0, i8* %13
br label %14
14: ; preds = %8, %1
ret void
}
int XX_httplib_is_valid_port(unsigned long port) { return (port < 0xffff); }


x86 assembly (clang, -O0):
<XX_httplib_is_valid_port>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0xffff,-0x8(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<XX_httplib_is_valid_port>:
xor    %eax,%eax
cmp    $0xffff,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @XX_httplib_is_valid_port(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ult i64 %3, 65535
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @XX_httplib_is_valid_port(i64 %0) {
%2 = icmp ult i64 %0, 65535
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int Greatest(int, int);
int Least(int, int);
int Difference(int num, int num2) {
  return Greatest(num, num2) - Least(num, num2);
}


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

x86 assembly (clang, -O2):
<Difference>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1040 <Greatest@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <Least@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Difference(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @Greatest(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @Least(i32 %8, i32 %9)
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @Difference(i32 %0, i32 %1) {
%3 = tail call i32 @Greatest(i32 %0, i32 %1)
%4 = tail call i32 @Least(i32 %0, i32 %1)
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __BKPT(int);
void hal_debug_break(void) { __BKPT(1); }


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

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

LLVM IR (-O0):
define void @hal_debug_break() {
%1 = call i32 @__BKPT(i32 1)
ret void
}

LLVM IR (-O2):
define void @hal_debug_break() {
%1 = tail call i32 @__BKPT(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IO_get_byte();
int /*<<< orphan*/ put_argument2(char *, int /*<<< orphan*/, char *);
int am_indirect_y(void) {
  put_argument2(" ($", IO_get_byte(), "), y");
  return 2;
}


x86 assembly (clang, -O0):
<am_indirect_y>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <IO_get_byte@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
lea    0xec9(%rip),%rdx
call   1040 <put_argument2@plt>
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_indirect_y>:
push   %rax
xor    %eax,%eax
call   1030 <IO_get_byte@plt>
lea    0xed1(%rip),%rdi
lea    0xece(%rip),%rdx
mov    %eax,%esi
call   1040 <put_argument2@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c" ($\00"
@.str.1 = [5 x i8] c"), y\00"
define i32 @am_indirect_y() {
%1 = call i32 (...) @IO_get_byte()
%2 = call i32 @put_argument2(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@.str = [4 x i8] c" ($\00"
@.str.1 = [5 x i8] c"), y\00"
define i32 @am_indirect_y() {
%1 = tail call i32 (...) @IO_get_byte()
%2 = tail call i32 @put_argument2(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 2
}
int tgetent(char *bp, const char *name) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @tgetent(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
void av_color_transfer_from_name() {}


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

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

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

LLVM IR (-O2):
define void @av_color_transfer_from_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nonblock(int);
void destroy_keyboard() { nonblock(1); }


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

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

LLVM IR (-O0):
define void @destroy_keyboard() {
%1 = call i32 @nonblock(i32 1)
ret void
}

LLVM IR (-O2):
define void @destroy_keyboard() {
%1 = tail call i32 @nonblock(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int);
int rand();
void bar(int a, int b, int c, int d) {
  int i = rand();
  printf("%d: %d,%d,%d,%d,%d,\n", 75, i, a, b, c, d);
}


x86 assembly (clang, -O0):
<bar>:
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    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    -0x10(%rbp),%eax
lea    0xeaa(%rip),%rdi
mov    $0x4b,%esi
mov    %eax,(%rsp)
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <rand@plt>
mov    %ebx,(%rsp)
lea    0xebe(%rip),%rdi
mov    $0x4b,%esi
mov    %eax,%edx
mov    %ebp,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%d: %d,%d,%d,%d,%d,\0A\00"
define void @bar(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 = call i32 (...) @rand()
store i32 %10, i32* %9
%11 = load i32, i32* %9
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 75, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%d: %d,%d,%d,%d,%d,\0A\00"
define void @bar(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @rand()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 75, i32 %5, i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int get();
int /*<<< orphan*/ unget(int);
int peek(void) {
  int r = get();
  unget(r);
  return r;
}


x86 assembly (clang, -O0):
<peek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <unget@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peek>:
push   %rbx
xor    %eax,%eax
call   1040 <get@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <unget@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @peek() {
%1 = alloca i32
%2 = call i32 (...) @get()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @unget(i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @peek() {
%1 = tail call i32 (...) @get()
%2 = tail call i32 @unget(i32 %1)
ret i32 %1
}
void nand_wait_ready(void) {
  while (!((*(volatile unsigned long *)0x4E000020) & 1))
    ;
}


x86 assembly (clang, -O0):
<nand_wait_ready>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <nand_wait_ready+0x9>
mov    $0x4e000020,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112b <nand_wait_ready+0x2b>
jmp    1130 <nand_wait_ready+0x30>
jmp    1109 <nand_wait_ready+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_wait_ready>:
testq  $0x1,0x4e000020
je     1100 <nand_wait_ready>
ret

LLVM IR (-O0):
define void @nand_wait_ready() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i64, i64* inttoptr (i64 1308622880 to i64*)
%3 = and i64 %2, 1
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @nand_wait_ready() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 1308622880 to i64*)
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
/* Variables and functions */
int add2(int);
int main(int argc, char **argv) { return add2(argc) - 4; }


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    -0x8(%rbp),%edi
call   1030 <add2@plt>
sub    $0x4,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <add2@plt>
add    $0xfffffffc,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = call i32 @add2(i32 %6)
%8 = sub nsw i32 %7, 4
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add2(i32 %0)
%4 = add nsw i32 %3, -4
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *argv[]) {
  printf("usage: %s <2d|3d> <z_min> <z_max> <step>\n", argv[0]);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"usage: %s <2d|3d> <z_min> <z_max> <step>\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"usage: %s <2d|3d> <z_min> <z_max> <step>\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR3A_get(void) { return U_WMRCORENONE_get("U_WMR3A"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR3A\00"
define i32 @U_WMR3A_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR3A\00"
define i32 @U_WMR3A_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int lower_case(int l) {
  int lower_letter = l + 32;
  return lower_letter;
}


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

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

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

LLVM IR (-O2):
define i32 @lower_case(i32 %0) {
%2 = add nsw i32 %0, 32
ret i32 %2
}
/* Type definitions */
struct imsm_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(struct imsm_dev *, struct imsm_dev *,
                          int /*<<< orphan*/);
int /*<<< orphan*/ sizeof_imsm_dev(struct imsm_dev *, int /*<<< orphan*/);
void imsm_copy_dev(struct imsm_dev *dest, struct imsm_dev *src) {
  memcpy(dest, src, sizeof_imsm_dev(src, 0));
}


x86 assembly (clang, -O0):
<imsm_copy_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <sizeof_imsm_dev@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imsm_copy_dev>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <sizeof_imsm_dev@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
%struct.imsm_dev = type { i32 }
define void @imsm_copy_dev(%struct.imsm_dev* %0, %struct.imsm_dev* %1) {
%3 = alloca %struct.imsm_dev*
%4 = alloca %struct.imsm_dev*
store %struct.imsm_dev* %0, %struct.imsm_dev** %3
store %struct.imsm_dev* %1, %struct.imsm_dev** %4
%5 = load %struct.imsm_dev*, %struct.imsm_dev** %3
%6 = load %struct.imsm_dev*, %struct.imsm_dev** %4
%7 = load %struct.imsm_dev*, %struct.imsm_dev** %4
%8 = call i32 @sizeof_imsm_dev(%struct.imsm_dev* %7, i32 0)
%9 = call i32 @memcpy(%struct.imsm_dev* %5, %struct.imsm_dev* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.imsm_dev = type { i32 }
define void @imsm_copy_dev(%struct.imsm_dev* %0, %struct.imsm_dev* %1) {
%3 = tail call i32 @sizeof_imsm_dev(%struct.imsm_dev* %1, i32 0)
%4 = tail call i32 @memcpy(%struct.imsm_dev* %0, %struct.imsm_dev* %1, i32 %3)
ret void
}
int test_print(void *obj) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_print(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
bool nrf53_errata_21(void) { return false; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
void fwrite_uint(FILE *fp, uint32_t i) { fwrite(&i, 4, 1, fp); }


x86 assembly (clang, -O0):
<fwrite_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwrite_uint>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @fwrite_uint(i32* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
ret void
}
int fun522() { return 522; }


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

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

LLVM IR (-O0):
define i32 @fun522() {
ret i32 522
}

LLVM IR (-O2):
define i32 @fun522() {
ret i32 522
}
char ascii(unsigned char b) {
  if ((b < ' ') || (b > '~'))
    return ('.');
  else
    return (char)b;
}


x86 assembly (clang, -O0):
<ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jl     1124 <ascii+0x24>
movzbl -0x2(%rbp),%eax
cmp    $0x7e,%eax
jle    112d <ascii+0x2d>
movb   $0x2e,-0x1(%rbp)
jmp    1133 <ascii+0x33>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii>:
lea    -0x7f(%rdi),%eax
cmp    $0xa1,%al
mov    $0x2e,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @ascii(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 32
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sgt i32 %9, 126
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i8 46, i8* %2
br label %14
12: ; preds = %7
%13 = load i8, i8* %3
store i8 %13, i8* %2
br label %14
14: ; preds = %12, %11
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @ascii(i8 zeroext %0) {
%2 = add i8 %0, -127
%3 = icmp ult i8 %2, -95
%4 = select i1 %3, i8 46, i8 %0
ret i8 %4
}
/* Variables and functions */
char *getenv(char *);
char *mmp_get_tm_zone(void) { return getenv("TZ"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"TZ\00"
define i8* @mmp_get_tm_zone() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
char *hello() {
  char *s = "hello world from C";
  return s;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"hello world from C\00"
define i8* @hello() {
%1 = alloca i8*
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [19 x i8] c"hello world from C\00"
define i8* @hello() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
float sinc(double);
float lanczos(float n, float N, float a) {
  (void)a;
  return sinc(2.0 * n / (N - 1.0) - 1.0);
}


x86 assembly (clang, -O0):
<lanczos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeb3(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xea3(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <sinc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lanczos>:
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movsd  0xedc(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
jmp    1030 <sinc@plt>

LLVM IR (-O0):
define float @lanczos(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = fmul double 2.000000e+00, %9
%11 = load float, float* %5
%12 = fpext float %11 to double
%13 = fsub double %12, 1.000000e+00
%14 = fdiv double %10, %13
%15 = fsub double %14, 1.000000e+00
%16 = call float @sinc(double %15)
ret float %16
}

LLVM IR (-O2):
define float @lanczos(float %0, float %1, float %2) {
%4 = fpext float %0 to double
%5 = fmul double %4, 2.000000e+00
%6 = fpext float %1 to double
%7 = fadd double %6, -1.000000e+00
%8 = fdiv double %5, %7
%9 = fadd double %8, -1.000000e+00
%10 = tail call float @sinc(double %9)
ret float %10
}
void inchal2inchalExtUnit() {}


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

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

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

LLVM IR (-O2):
define void @inchal2inchalExtUnit() {
ret void
}