xunge/DecIR huggingface dataset:
int putc_serial0(int ch) {
  while (!((*(volatile unsigned long *)(0xE000C000 + 0x14)) & 0x20))
    ;
  return ((*(volatile unsigned long *)(0xE000C000 + 0x00)) = ch);
}


x86 assembly (clang, -O0):
<putc_serial0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xe000c014,%eax
mov    (%rax),%rax
and    $0x20,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1129 <putc_serial0+0x29>
jmp    112e <putc_serial0+0x2e>
jmp    1107 <putc_serial0+0x7>
movslq -0x4(%rbp),%rax
mov    $0xe000c000,%ecx
mov    %rax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc_serial0>:
mov    $0xe000c000,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x20,0x14(%rcx)
je     1110 <putc_serial0+0x10>
movslq %edi,%rax
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define i32 @putc_serial0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%5 = and i64 %4, 32
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
store volatile i64 %11, i64* inttoptr (i64 3758145536 to i64*)
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @putc_serial0(i32 returned %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%4 = and i64 %3, 32
%5 = icmp eq i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = sext i32 %0 to i64
store volatile i64 %7, i64* inttoptr (i64 3758145536 to i64*)
ret i32 %0
}
void exit_handler(sig) int sig;
{ exit(42); }


x86 assembly (clang, -O0):
<exit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2a,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit_handler>:
push   %rax
mov    $0x2a,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @exit_handler(i32 %0) {
tail call void @exit(i32 42)
unreachable
}
/* Variables and functions */
int chpl_run(char const *, char const **);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  const char *cmd = "ls -la";
  const char *output;
  int result = chpl_run(cmd, &output);
  printf("output:\n%s\n", output);
  printf("result = %i\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <chpl_run@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <chpl_run@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rsi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"ls -la\00"
@.str.1 = [12 x i8] c"output:\0A%s\0A\00"
@.str.2 = [13 x i8] c"result = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @chpl_run(i8* %5, i8** %3)
store i32 %6, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i32, i32* %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"ls -la\00"
@.str.1 = [12 x i8] c"output:\0A%s\0A\00"
@.str.2 = [13 x i8] c"result = %i\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = call i32 @chpl_run(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1)
%4 = load i8*, i8** %1
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int ENOTSUP;
int feholdexcept(fenv_t *envp) { return -ENOTSUP; }


x86 assembly (clang, -O0):
<feholdexcept>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<feholdexcept>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
define i32 @feholdexcept(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOTSUP
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
define i32 @feholdexcept(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOTSUP
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ CyPmHibSlpRestore();
void CyPmSlpRestore(void) { CyPmHibSlpRestore(); }


x86 assembly (clang, -O0):
<CyPmSlpRestore>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CyPmHibSlpRestore@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @CyPmSlpRestore() {
%1 = call i32 (...) @CyPmHibSlpRestore()
ret void
}

LLVM IR (-O2):
define void @CyPmSlpRestore() {
%1 = tail call i32 (...) @CyPmHibSlpRestore()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
int BNCFunction() {
  int ii, stat = 99;
  char com1, data;
  BNCIO(21);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
mov    $0x15,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCFunction>:
push   %rax
mov    $0x15,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BNCFunction() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @BNCIO(i32 21)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BNCFunction() {
%1 = tail call i32 @BNCIO(i32 21)
ret i32 99
}
/* Type definitions */
typedef long uint64_t;
typedef long uint32_t;
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
uint64_t timespec_to_hw(const struct timespec *ts, uint32_t hz) {
  return (uint64_t)ts->tv_sec * hz + ((uint64_t)ts->tv_nsec * hz) / 1000000000L;
}


x86 assembly (clang, -O0):
<timespec_to_hw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
imul   -0x10(%rbp),%rax
mov    $0x3b9aca00,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_hw>:
mov    %rsi,%rax
mov    0x8(%rdi),%rcx
imul   %rsi,%rcx
imul   (%rdi),%rax
movabs $0x112e0be826d694b3,%rdx
0b 2e 11
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1a,%rdx
add    %rdx,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_hw(%struct.timespec* %0, i64 %1) {
%3 = alloca %struct.timespec*
%4 = alloca i64
store %struct.timespec* %0, %struct.timespec** %3
store i64 %1, i64* %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%7 = load i64, i64* %6
%8 = load i64, i64* %4
%9 = mul nsw i64 %7, %8
%10 = load %struct.timespec*, %struct.timespec** %3
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%12 = load i64, i64* %11
%13 = load i64, i64* %4
%14 = mul nsw i64 %12, %13
%15 = sdiv i64 %14, 1000000000
%16 = add nsw i64 %9, %15
ret i64 %16
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_hw(%struct.timespec* nocapture %0, i64 %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, %1
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, %1
%9 = sdiv i64 %8, 1000000000
%10 = add nsw i64 %9, %5
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
int /*<<< orphan*/ extra_padding(int);
void ri(void) {
  esc("M");
  extra_padding(5);
}


x86 assembly (clang, -O0):
<ri>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
call   1030 <extra_padding@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ri>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <extra_padding@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"M\00"
define void @ri() {
%1 = call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @extra_padding(i32 5)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"M\00"
define void @ri() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @extra_padding(i32 5)
ret void
}
__typeof__(sprintf(1, 1, 1)) test_sprintf_249(void) { return sprintf(1, 1, 1); }


x86 assembly (clang, -O0):
<test_sprintf_249>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rsi,%rdi
mov    $0x0,%al
call   1030 <sprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_sprintf_249() {
%1 = call i32 (i8*, i8*, ...) @sprintf(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_sprintf_249() {
%1 = tail call i32 (i8*, i8*, ...) @sprintf(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i32 1)
ret i32 %1
}
/* Variables and functions */
long num_digits(long);
long p6_size(long w, long h) {
  return 9 + num_digits(w) + num_digits(h) + (3 * w * h);
}


x86 assembly (clang, -O0):
<p6_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <num_digits@plt>
add    $0x9,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <num_digits@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
imul   $0x3,-0x8(%rbp),%rcx
imul   -0x10(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p6_size>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <num_digits@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <num_digits@plt>
imul   %r14,%rbx
lea    (%rbx,%rbx,2),%rcx
add    %r15,%rcx
add    %rcx,%rax
add    $0x9,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @p6_size(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 = call i64 @num_digits(i64 %5)
%7 = add nsw i64 9, %6
%8 = load i64, i64* %4
%9 = call i64 @num_digits(i64 %8)
%10 = add nsw i64 %7, %9
%11 = load i64, i64* %3
%12 = mul nsw i64 3, %11
%13 = load i64, i64* %4
%14 = mul nsw i64 %12, %13
%15 = add nsw i64 %10, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @p6_size(i64 %0, i64 %1) {
%3 = tail call i64 @num_digits(i64 %0)
%4 = tail call i64 @num_digits(i64 %1)
%5 = mul nsw i64 %0, 3
%6 = mul nsw i64 %5, %1
%7 = add i64 %6, 9
%8 = add i64 %7, %3
%9 = add i64 %8, %4
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char *, int);
void *malloc(size_t);
void *emalloc(size_t n) {
  void *rv;
  if ((rv = malloc(n)) == NULL)
    fatal("out of memory", "", 1);
  return rv;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    115b <emalloc+0x3b>
lea    0xeb6(%rip),%rdi
lea    0xebc(%rip),%rsi
mov    $0x1,%edx
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <emalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x1,%edx
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
@.str.1 = [1 x i8] zeroinitializer
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void pmh7_register_write(uint16_t reg, uint8_t val) {
  outb(reg & 0xff, (0x15e0 + 0x0c));
  outb((reg & 0xff00) >> 8, (0x15e0 + 0x0d));
  outb(val, (0x15e0 + 0x0e));
}


x86 assembly (clang, -O0):
<pmh7_register_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    $0x15ec,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
and    $0xff00,%edi
sar    $0x8,%edi
mov    $0x15ed,%esi
call   1030 <outb@plt>
mov    -0x8(%rbp),%edi
mov    $0x15ee,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmh7_register_write>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
movzbl %bl,%edi
mov    $0x15ec,%esi
call   1030 <outb@plt>
movzbl %bh,%edi
mov    $0x15ed,%esi
call   1030 <outb@plt>
mov    %ebp,%edi
mov    $0x15ee,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @pmh7_register_write(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 = and i32 %5, 255
%7 = call i32 @outb(i32 %6, i32 5612)
%8 = load i32, i32* %3
%9 = and i32 %8, 65280
%10 = ashr i32 %9, 8
%11 = call i32 @outb(i32 %10, i32 5613)
%12 = load i32, i32* %4
%13 = call i32 @outb(i32 %12, i32 5614)
ret void
}

LLVM IR (-O2):
define void @pmh7_register_write(i32 %0, i32 %1) {
%3 = and i32 %0, 255
%4 = tail call i32 @outb(i32 %3, i32 5612)
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
%7 = tail call i32 @outb(i32 %6, i32 5613)
%8 = tail call i32 @outb(i32 %1, i32 5614)
ret void
}
int etypesw1(etype)
int etype;
{
  switch (etype) {
  case 2:
    return 1;
  case 4:
    return 2;
  case 1:
    return 3;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<etypesw1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1155 <etypesw1+0x55>
jmp    111b <etypesw1+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     113d <etypesw1+0x3d>
jmp    112c <etypesw1+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     1149 <etypesw1+0x49>
jmp    1161 <etypesw1+0x61>
movl   $0x1,-0x4(%rbp)
jmp    1168 <etypesw1+0x68>
movl   $0x2,-0x4(%rbp)
jmp    1168 <etypesw1+0x68>
movl   $0x3,-0x4(%rbp)
jmp    1168 <etypesw1+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<etypesw1>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x3,%edi
ja     1117 <etypesw1+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @etypesw1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 2, label %5
i32 4, label %6
i32 1, label %7
]
5: ; preds = %1
store i32 1, i32* %2
br label %9
6: ; preds = %1
store i32 2, i32* %2
br label %9
7: ; preds = %1
store i32 3, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@switch.table.etypesw1 = [4 x i32] [i32 3, i32 1, i32 0, i32 2]
define i32 @etypesw1(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.etypesw1, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wifidirect_cfg_invitation_list_usage(void) {
  printf("\nUsage : wifidirect_cfg_invitation_list [mac_addr]");
  printf("\nIf mac_addr parameter is provided, 'set' is performed otherwise "
         "'get' is performed.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_wifidirect_cfg_invitation_list_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeff(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"\0AUsage : wifidirect_cfg_invitation_list [mac_addr]\00"
@.str.1 = [86 x i8] c"\0AIf mac_addr parameter is provided, 'set' is performed otherwise 'get' is performed.\0A\00"
define void @print_wifidirect_cfg_invitation_list_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"\0AUsage : wifidirect_cfg_invitation_list [mac_addr]\00"
@str = [85 x i8] c"\0AIf mac_addr parameter is provided, 'set' is performed otherwise 'get' is performed.\00"
define void @print_wifidirect_cfg_invitation_list_usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char);
void printchar(char *name, char x) { printf("%20s: %c\n", name, x); }


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
movsbl -0x9(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%20s: %c\0A\00"
define void @printchar(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i8 signext %6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%20s: %c\0A\00"
define void @printchar(i8* %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8 signext %1)
ret void
}
void led_123(int value) {
  int current_value;
  current_value = *(unsigned int *)0xf0000028;
  *(unsigned int *)0xf0000028 = (current_value & 1) | value << 1;
}


x86 assembly (clang, -O0):
<led_123>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xf0000028,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0x1,%ecx
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
or     %eax,%ecx
mov    $0xf0000028,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_123>:
mov    $0xf0000028,%eax
mov    (%rax),%ecx
and    $0x1,%ecx
lea    (%rcx,%rdi,2),%ecx
mov    %ecx,(%rax)
ret

LLVM IR (-O0):
define void @led_123(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* inttoptr (i64 4026531880 to i32*)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 1
%7 = load i32, i32* %2
%8 = shl i32 %7, 1
%9 = or i32 %6, %8
store i32 %9, i32* inttoptr (i64 4026531880 to i32*)
ret void
}

LLVM IR (-O2):
define void @led_123(i32 %0) {
%2 = load i32, i32* inttoptr (i64 4026531880 to i32*)
%3 = and i32 %2, 1
%4 = shl i32 %0, 1
%5 = or i32 %3, %4
store i32 %5, i32* inttoptr (i64 4026531880 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set_dir(int);
int /*<<< orphan*/ gpio_write_data(int);
int /*<<< orphan*/ set_gpio_pad(int);
int /*<<< orphan*/ unfreeze_gpio_out();
void operation_i2c_start() {
  unfreeze_gpio_out();
  gpio_write_data((1 << 1) | (1 << 0));
  set_gpio_pad((1 << 1) | (1 << 0));
  gpio_set_dir((1 << 1) | (1 << 0));
  gpio_write_data((0 << 1) | (1 << 0));
  gpio_write_data((0 << 1) | (0 << 0));
}


x86 assembly (clang, -O0):
<operation_i2c_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <unfreeze_gpio_out@plt>
mov    $0x3,%edi
call   1060 <gpio_write_data@plt>
mov    $0x3,%edi
call   1030 <set_gpio_pad@plt>
mov    $0x3,%edi
call   1040 <gpio_set_dir@plt>
mov    $0x1,%edi
call   1060 <gpio_write_data@plt>
xor    %edi,%edi
call   1060 <gpio_write_data@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation_i2c_start>:
push   %rax
xor    %eax,%eax
call   1050 <unfreeze_gpio_out@plt>
mov    $0x3,%edi
call   1060 <gpio_write_data@plt>
mov    $0x3,%edi
call   1030 <set_gpio_pad@plt>
mov    $0x3,%edi
call   1040 <gpio_set_dir@plt>
mov    $0x1,%edi
call   1060 <gpio_write_data@plt>
xor    %edi,%edi
pop    %rax
jmp    1060 <gpio_write_data@plt>

LLVM IR (-O0):
define void @operation_i2c_start() {
%1 = call i32 (...) @unfreeze_gpio_out()
%2 = call i32 @gpio_write_data(i32 3)
%3 = call i32 @set_gpio_pad(i32 3)
%4 = call i32 @gpio_set_dir(i32 3)
%5 = call i32 @gpio_write_data(i32 1)
%6 = call i32 @gpio_write_data(i32 0)
ret void
}

LLVM IR (-O2):
define void @operation_i2c_start() {
%1 = tail call i32 (...) @unfreeze_gpio_out()
%2 = tail call i32 @gpio_write_data(i32 3)
%3 = tail call i32 @set_gpio_pad(i32 3)
%4 = tail call i32 @gpio_set_dir(i32 3)
%5 = tail call i32 @gpio_write_data(i32 1)
%6 = tail call i32 @gpio_write_data(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
int main() { printf("%lld", (long long int)0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 0)
ret i32 0
}
/* Variables and functions */
int LocaleCompare(char const *, char const *);
int CompareSplayTreeString(const void *target, const void *source) {
  const char *p, *q;
  p = (const char *)target;
  q = (const char *)source;
  return (LocaleCompare(p, q));
}


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

x86 assembly (clang, -O2):
<CompareSplayTreeString>:
jmp    1030 <LocaleCompare@plt>

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

LLVM IR (-O2):
define i32 @CompareSplayTreeString(i8* %0, i8* %1) {
%3 = tail call i32 @LocaleCompare(i8* %0, i8* %1)
ret i32 %3
}
__uint128_t foo128() {
  __uint128_t int128 = 44;
  return int128;
}


x86 assembly (clang, -O0):
<foo128>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x18(%rbp)
movq   $0x2c,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo128>:
mov    $0x2c,%eax
xor    %edx,%edx
ret

LLVM IR (-O0):
define { i64, i64 } @foo128() {
%1 = alloca i128
%2 = alloca i128
store i128 44, i128* %2
%3 = load i128, i128* %2
store i128 %3, i128* %1
%4 = bitcast i128* %1 to { i64, i64 }*
%5 = load { i64, i64 }, { i64, i64 }* %4
ret { i64, i64 } %5
}

LLVM IR (-O2):
define { i64, i64 } @foo128() {
ret { i64, i64 } { i64 44, i64 0 }
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("pass\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@str = [5 x i8] c"pass\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ flusha();
int getpid();
int /*<<< orphan*/ printf(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ rand();
int time(int /*<<< orphan*/ *);
void banner() {
  printf("+OK Fakepop - <%d.%d%04x@tatui>\r\n", time(NULL), getpid(), rand());
  flusha();
}


x86 assembly (clang, -O0):
<banner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    %eax,%ecx
lea    0xe7c(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <flusha@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<banner>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1070 <rand@plt>
lea    0xe8d(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <flusha@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"+OK Fakepop - <%d.%d%04x@tatui>\0D\0A\00"
define void @banner() {
%1 = call i32 @time(i32* null)
%2 = call i32 (...) @getpid()
%3 = call i32 (...) @rand()
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%5 = call i32 (...) @flusha()
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"+OK Fakepop - <%d.%d%04x@tatui>\0D\0A\00"
define void @banner() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (...) @rand()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%5 = tail call i32 (...) @flusha()
ret void
}
void wait_for_timer() {
  while (((*((volatile unsigned int *)(0x2e000 + 0x44))) & 1) == 0) {
  }
  (*((volatile unsigned int *)(0x2e000 + 0x44))) |= 1;
}


x86 assembly (clang, -O0):
<wait_for_timer>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <wait_for_timer+0x9>
mov    $0x2e044,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1121 <wait_for_timer+0x21>
jmp    1109 <wait_for_timer+0x9>
mov    $0x2e044,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x2e044,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_timer>:
testl  $0x1,0x2e044
je     1100 <wait_for_timer>
orl    $0x1,0x2e044
01
ret

LLVM IR (-O0):
define void @wait_for_timer() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i32, i32* inttoptr (i64 188484 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = load volatile i32, i32* inttoptr (i64 188484 to i32*)
%8 = or i32 %7, 1
store volatile i32 %8, i32* inttoptr (i64 188484 to i32*)
ret void
}

LLVM IR (-O2):
define void @wait_for_timer() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 188484 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 188484 to i32*)
%7 = or i32 %6, 1
store volatile i32 %7, i32* inttoptr (i64 188484 to i32*)
ret void
}
/* Variables and functions */
unsigned char *chacha8poly1305_encrypt(unsigned char *, size_t *,
                                       unsigned char const *, size_t,
                                       unsigned char const *,
                                       unsigned char const *);
unsigned char *crypt_encrypt_chacha8poly1305(
    unsigned char *out, size_t *out_len, const unsigned char *in, size_t in_len,
    const unsigned char *nonce, const unsigned char *key) {
  return chacha8poly1305_encrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_encrypt_chacha8poly1305>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <chacha8poly1305_encrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_encrypt_chacha8poly1305>:
jmp    1030 <chacha8poly1305_encrypt@plt>

LLVM IR (-O0):
define i8* @crypt_encrypt_chacha8poly1305(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @chacha8poly1305_encrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_encrypt_chacha8poly1305(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @chacha8poly1305_encrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ RestoreTerminal();
void ScreenDispose() { RestoreTerminal(); }


x86 assembly (clang, -O0):
<ScreenDispose>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <RestoreTerminal@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ScreenDispose() {
%1 = call i32 (...) @RestoreTerminal()
ret void
}

LLVM IR (-O2):
define void @ScreenDispose() {
%1 = tail call i32 (...) @RestoreTerminal()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ baz(int);
void qux(int i) {
  if ((i <= 1) || ((i % 2) == 1))
    baz(i - 1);
  else
    qux(i / 2);
}


x86 assembly (clang, -O0):
<qux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1149 <qux+0x29>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1159 <qux+0x39>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <baz@plt>
jmp    116b <qux+0x4b>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <qux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qux>:
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%edi
cmp    $0x2,%eax
jl     113e <qux+0x2e>
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
mov    %edi,%ecx
sub    %eax,%ecx
mov    %edi,%eax
shr    %eax
cmp    $0x1,%ecx
jne    1120 <qux+0x10>
add    $0xffffffff,%edi
jmp    1030 <baz@plt>

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

LLVM IR (-O2):
define void @qux(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %8, %2 ]
%4 = icmp slt i32 %3, 2
%5 = srem i32 %3, 2
%6 = icmp eq i32 %5, 1
%7 = or i1 %4, %6
%8 = lshr i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = add nsw i32 %3, -1
%11 = tail call i32 @baz(i32 %10)
ret void
}
void gtk_rc_parse() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @numa_update_cpu_topology() {
ret void
}
char *msbrk(size)
register size;
{
  extern char *sbrk();
  register char *address;
  if ((address = sbrk(size)) == (char *)-1)
    error(1, "Not enough memory. Use chmem to allocate more", ((char *)0));
  return address;
}


x86 assembly (clang, -O0):
<msbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <sbrk@plt>
mov    %rax,-0x10(%rbp)
mov    $0xffffffffffffffff,%rcx
cmp    %rcx,%rax
jne    1160 <msbrk+0x40>
mov    $0x1,%edi
lea    0xeab(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msbrk>:
push   %rbx
xor    %eax,%eax
call   1030 <sbrk@plt>
mov    %rax,%rbx
cmp    $0xffffffffffffffff,%rax
jne    1146 <msbrk+0x26>
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Not enough memory. Use chmem to allocate more\00"
define i8* @msbrk(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* (i32, ...) bitcast (i8* (...)* @sbrk to i8* (i32, ...)*)(i32 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, inttoptr (i64 -1 to i8*)
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i32, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* null)
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [46 x i8] c"Not enough memory. Use chmem to allocate more\00"
define i8* @msbrk(i32 %0) {
%2 = tail call i8* (i32, ...) bitcast (i8* (...)* @sbrk to i8* (i32, ...)*)(i32 %0)
%3 = icmp eq i8* %2, inttoptr (i64 -1 to i8*)
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i32, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* null)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
long long bit05() { return 0x0000000000000020LL; }


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

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

LLVM IR (-O0):
define i64 @bit05() {
ret i64 32
}

LLVM IR (-O2):
define i64 @bit05() {
ret i64 32
}
/* Type definitions */
struct pci_device {
  int dummy;
};

/* Variables and functions */
scalar_t__ pci_device_has_kernel_driver(struct pci_device *);
int /*<<< orphan*/ pci_device_has_uio_driver(struct pci_device *);
int pci_device_has_non_null_driver(struct pci_device *dev) {
  return pci_device_has_kernel_driver(dev) && !pci_device_has_uio_driver(dev);
}


x86 assembly (clang, -O0):
<pci_device_has_non_null_driver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pci_device_has_kernel_driver@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115b <pci_device_has_non_null_driver+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <pci_device_has_uio_driver@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_device_has_non_null_driver>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pci_device_has_kernel_driver@plt>
test   %rax,%rax
je     1141 <pci_device_has_non_null_driver+0x21>
mov    %rbx,%rdi
call   1030 <pci_device_has_uio_driver@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.pci_device = type { i32 }
define i32 @pci_device_has_non_null_driver(%struct.pci_device* %0) {
%2 = alloca %struct.pci_device*
store %struct.pci_device* %0, %struct.pci_device** %2
%3 = load %struct.pci_device*, %struct.pci_device** %2
%4 = call i64 @pci_device_has_kernel_driver(%struct.pci_device* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load %struct.pci_device*, %struct.pci_device** %2
%8 = call i32 @pci_device_has_uio_driver(%struct.pci_device* %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct.pci_device = type { i32 }
define i32 @pci_device_has_non_null_driver(%struct.pci_device* %0) {
%2 = tail call i64 @pci_device_has_kernel_driver(%struct.pci_device* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @pci_device_has_uio_driver(%struct.pci_device* %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ u_char;

/* Variables and functions */
scalar_t__ cd_current_track();
scalar_t__ cd_first_track();
scalar_t__ cd_last_track();
int /*<<< orphan*/ cd_play_disc(scalar_t__);
u_char cd_play_prev_track(void) {
  u_char target_track;
  u_char cur_track = cd_current_track();
  if (cur_track <= cd_first_track())
    target_track = cd_last_track();
  else
    target_track = (cur_track - 1);
  cd_play_disc(target_track);
  return target_track;
}


x86 assembly (clang, -O0):
<cd_play_prev_track>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <cd_current_track@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <cd_first_track@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jg     1182 <cd_play_prev_track+0x42>
mov    $0x0,%al
call   1060 <cd_last_track@plt>
mov    %rax,-0x8(%rbp)
jmp    118e <cd_play_prev_track+0x4e>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cd_play_disc@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_play_prev_track>:
push   %rbx
xor    %eax,%eax
call   1050 <cd_current_track@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <cd_first_track@plt>
cmp    %rax,%rbx
jle    115d <cd_play_prev_track+0x1d>
add    $0xffffffffffffffff,%rbx
jmp    1167 <cd_play_prev_track+0x27>
xor    %eax,%eax
call   1060 <cd_last_track@plt>
mov    %rax,%rbx
mov    %rbx,%rdi
call   1040 <cd_play_disc@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @cd_play_prev_track() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @cd_current_track()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = call i64 (...) @cd_first_track()
%6 = icmp sle i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i64 (...) @cd_last_track()
store i64 %8, i64* %1
br label %12
9: ; preds = %0
%10 = load i64, i64* %2
%11 = sub nsw i64 %10, 1
store i64 %11, i64* %1
br label %12
12: ; preds = %9, %7
%13 = load i64, i64* %1
%14 = call i32 @cd_play_disc(i64 %13)
%15 = load i64, i64* %1
ret i64 %15
}

LLVM IR (-O2):
define i64 @cd_play_prev_track() {
%1 = tail call i64 (...) @cd_current_track()
%2 = tail call i64 (...) @cd_first_track()
%3 = icmp sgt i64 %1, %2
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i64 (...) @cd_last_track()
br label %8
6: ; preds = %0
%7 = add nsw i64 %1, -1
br label %8
8: ; preds = %6, %4
%9 = phi i64 [ %5, %4 ], [ %7, %6 ]
%10 = tail call i32 @cd_play_disc(i64 %9)
ret i64 %9
}
/* Variables and functions */
char *strduplicate(char *inp) {
  char *dup = NULL;
  int i;
  for (i = 0; i <= 100; ++i) {
    if ((inp + 1) != NULL)
      *(dup + i) = *(inp + i);
  }
  return dup;
}


x86 assembly (clang, -O0):
<strduplicate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     115c <strduplicate+0x5c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
cmp    $0x0,%rax
je     1149 <strduplicate+0x49>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    114e <strduplicate+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <strduplicate+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @strduplicate(i8* nocapture readnone %0) {
ret i8* null
}
int do_005() { return 5; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @do_005() {
ret i32 5
}

LLVM IR (-O2):
define i32 @do_005() {
ret i32 5
}
/* Type definitions */
typedef int /*<<< orphan*/ v;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hash_bits(int /*<<< orphan*/ *, double *, int);
void hash_double_bit(uint32_t *hash, double v) {
  hash_bits(hash, &v, sizeof(v));
}


x86 assembly (clang, -O0):
<hash_double_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <hash_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_double_bit>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <hash_bits@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @hash_double_bit(i32* %0, double %1) {
%3 = alloca double
store double %1, double* %3
%4 = call i32 @hash_bits(i32* %0, double* %3, i32 8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ free_string_array(char **, size_t);
void free_wstring_array(wchar_t **array, size_t len) {
  free_string_array((char **)array, len);
}


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

x86 assembly (clang, -O2):
<free_wstring_array>:
jmp    1030 <free_string_array@plt>

LLVM IR (-O0):
define void @free_wstring_array(i32** %0, i64 %1) {
%3 = alloca i32**
%4 = alloca i64
store i32** %0, i32*** %3
store i64 %1, i64* %4
%5 = load i32**, i32*** %3
%6 = bitcast i32** %5 to i8**
%7 = load i64, i64* %4
%8 = call i32 @free_string_array(i8** %6, i64 %7)
ret void
}

LLVM IR (-O2):
define void @free_wstring_array(i32** %0, i64 %1) {
%3 = bitcast i32** %0 to i8**
%4 = tail call i32 @free_string_array(i8** %3, i64 %1)
ret void
}