xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void mkdir_verbose(char *arrcopy, mode_t mode, int verbose) {
  if (verbose == 1)
    printf("Making directory: %s  mode: %o\n", arrcopy, mode);
}


x86 assembly (clang, -O0):
<mkdir_verbose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    113f <mkdir_verbose+0x2f>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdir_verbose>:
cmp    $0x1,%edx
jne    1128 <mkdir_verbose+0x18>
mov    %esi,%eax
mov    %rdi,%rsi
lea    0xedf(%rip),%rdi
mov    %eax,%edx
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Making directory: %s mode: %o\0A\00"
define void @mkdir_verbose(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* %6
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11)
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Making directory: %s mode: %o\0A\00"
define void @mkdir_verbose(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int tirar(int);
int d12() { return tirar(12); }


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

x86 assembly (clang, -O2):
<d12>:
mov    $0xc,%edi
jmp    1030 <tirar@plt>

LLVM IR (-O0):
define i32 @d12() {
%1 = call i32 @tirar(i32 12)
ret i32 %1
}

LLVM IR (-O2):
define i32 @d12() {
%1 = tail call i32 @tirar(i32 12)
ret i32 %1
}
void SHA224_Update(void) {}


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

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

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

LLVM IR (-O2):
define void @SHA224_Update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prg) {
  fprintf(stderr, "Usage: %s TFILE RMAX NI\n", prg);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s TFILE RMAX NI\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: %s TFILE RMAX NI\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
unsigned int bar();
int /*<<< orphan*/ foobar();
void foo(int s) {
  unsigned loc = 0;
  if (s) {
    loc = 1;
    foobar();
  } else {
    loc = bar();
    foobar();
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114f <foo+0x2f>
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1040 <foobar@plt>
jmp    1160 <foo+0x40>
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <foobar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
je     112b <foo+0xb>
xor    %eax,%eax
jmp    1040 <foobar@plt>
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
add    $0x8,%rsp
xor    %eax,%eax
jmp    1040 <foobar@plt>

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

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @XkbSetDebuggingFlags() {
ret void
}
char *read_zero_or_eof(char *line, int *str_buff_index) {
  *str_buff_index = -1;
  return (line);
}


x86 assembly (clang, -O0):
<read_zero_or_eof>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_zero_or_eof>:
mov    %rdi,%rax
movl   $0xffffffff,(%rsi)
ret

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

LLVM IR (-O2):
define i8* @read_zero_or_eof(i8* readnone returned %0, i32* nocapture writeonly %1) {
store i32 -1, i32* %1
ret i8* %0
}
int mylower(int a) {
  if (('A' <= a) && (a <= 'Z'))
    return (a - 'A' + 'a');
  return (a);
}


x86 assembly (clang, -O0):
<mylower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x41,%eax
cmp    -0x8(%rbp),%eax
jg     1130 <mylower+0x30>
cmpl   $0x5a,-0x8(%rbp)
jg     1130 <mylower+0x30>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <mylower+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mylower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @mylower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 65, %4
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 65
%12 = add nsw i32 %11, 97
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @mylower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
struct catmc_atomic_unsigned_long_long {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_unsigned_long_long *);
void catmc_atomic_unsigned_long_long_destroy(
    struct catmc_atomic_unsigned_long_long *wrapper) {
  free(wrapper);
}


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

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

LLVM IR (-O0):
%struct.catmc_atomic_unsigned_long_long = type { i32 }
define void @catmc_atomic_unsigned_long_long_destroy(%struct.catmc_atomic_unsigned_long_long* %0) {
%2 = alloca %struct.catmc_atomic_unsigned_long_long*
store %struct.catmc_atomic_unsigned_long_long* %0, %struct.catmc_atomic_unsigned_long_long** %2
%3 = load %struct.catmc_atomic_unsigned_long_long*, %struct.catmc_atomic_unsigned_long_long** %2
%4 = call i32 @free(%struct.catmc_atomic_unsigned_long_long* %3)
ret void
}

LLVM IR (-O2):
%struct.catmc_atomic_unsigned_long_long = type { i32 }
define void @catmc_atomic_unsigned_long_long_destroy(%struct.catmc_atomic_unsigned_long_long* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_unsigned_long_long* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_greetings1();
int /*<<< orphan*/ sleep(int);
void *thread1_func(void *unused) {
  while (1) {
    print_greetings1();
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<thread1_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <print_greetings1@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112c <thread1_func+0xc>

x86 assembly (clang, -O2):
<thread1_func>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <print_greetings1@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <thread1_func+0x10>

LLVM IR (-O0):
define i8* @thread1_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @print_greetings1()
%5 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
define noalias i8* @thread1_func(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @print_greetings1()
%4 = tail call i32 @sleep(i32 1)
br label %2
}
/* Variables and functions */
int const search0a(int, unsigned char *, unsigned char *, int const, int *,
                   int *);
const int search(unsigned char *buf, unsigned char *buf0, const int max0,
                 int *p) {
  static int table[10] = {
      -8,          -512,        -32 * 1024,  -2 * 1024 * 1024, -0x7fffffff,
      -0x7fffffff, -0x7fffffff, -0x7fffffff, -0x7fffffff,      -0x7fffffff};
  return search0a(12, buf, buf0, max0, p, table);
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    $0xc,%edi
lea    0x2eee(%rip),%r9
call   1030 <search0a@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0x2f0e(%rip),%r9
mov    $0xc,%edi
jmp    1030 <search0a@plt>

LLVM IR (-O0):
@search.table = internal global [10 x i32] [i32 -8, i32 -512, i32 -32768, i32 -2097152, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647]
define i32 @search(i8* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32*, i32** %8
%13 = call i32 @search0a(i32 12, i8* %9, i8* %10, i32 %11, i32* %12, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @search.table, i64 0, i64 0))
ret i32 %13
}

LLVM IR (-O2):
@search.table = internal global [10 x i32] [i32 -8, i32 -512, i32 -32768, i32 -2097152, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647]
define i32 @search(i8* %0, i8* %1, i32 %2, i32* %3) {
%5 = tail call i32 @search0a(i32 12, i8* %0, i8* %1, i32 %2, i32* %3, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @search.table, i64 0, i64 0))
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo_smp();
int main() { foo_smp(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @foo_smp()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo_smp()
ret i32 0
}
void TimerCNTModeConfigure(unsigned long ulBase, unsigned long ulCountMode) {
  unsigned long ulTempCR1;

  ;

  ;
  ulTempCR1 = (*((volatile unsigned long *)(ulBase + 0x00000000)));
  ulTempCR1 &= ~(0x00000010 | 0x00000060);
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = ulTempCR1;
  ulTempCR1 |= ulCountMode;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= ulCountMode;
}


x86 assembly (clang, -O0):
<TimerCNTModeConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xffffffffffffff8f,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerCNTModeConfigure>:
andq   $0xffffffffffffff8f,(%rdi)
or     %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @TimerCNTModeConfigure(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 0
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = and i64 %10, -113
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = load i64, i64* %3
%14 = add i64 %13, 0
%15 = inttoptr i64 %14 to i64*
store volatile i64 %12, i64* %15
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = or i64 %17, %16
store i64 %18, i64* %5
%19 = load i64, i64* %4
%20 = load i64, i64* %3
%21 = add i64 %20, 0
%22 = inttoptr i64 %21 to i64*
%23 = load volatile i64, i64* %22
%24 = or i64 %23, %19
store volatile i64 %24, i64* %22
ret void
}

LLVM IR (-O2):
define void @TimerCNTModeConfigure(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -113
store volatile i64 %5, i64* %3
%6 = load volatile i64, i64* %3
%7 = or i64 %6, %1
store volatile i64 %7, i64* %3
ret void
}
void gtk_fixed_move() {}


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

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

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

LLVM IR (-O2):
define void @gtk_fixed_move() {
ret void
}
char *skip_white(ptr)
char *ptr;
{
  while (*ptr == ' ' || *ptr == '\t')
    ptr++;
  return (ptr);
}


x86 assembly (clang, -O0):
<skip_white>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <skip_white+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skip_white+0x3d>
jmp    114e <skip_white+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_white+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_white>:
mov    %rdi,%rax
jmp    1114 <skip_white+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_white+0x10>
cmp    $0x9,%cl
je     1110 <skip_white+0x10>
ret

LLVM IR (-O0):
define i8* @skip_white(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ true, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @skip_white(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ static_assert(int);
scalar_t__ unknown();
void main() {
  int x = 0;
  int y = 0;
  int n = 0;
  while (unknown()) {
    x++;
    y++;
  }
  while (x != n) {
    x--;
    y--;
  }
  static_assert(y == n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <unknown@plt>
cmp    $0x0,%rax
je     1165 <main+0x45>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
jmp    116a <main+0x4a>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     118d <main+0x6d>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    116a <main+0x4a>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <static_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <unknown@plt>
test   %rax,%rax
jne    1130 <main+0x10>
mov    $0x1,%edi
pop    %rax
jmp    1040 <static_assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %0
%5 = call i64 (...) @unknown()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
br label %13
13: ; preds = %17, %12
%14 = load i32, i32* %1
%15 = load i32, i32* %3
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i32, i32* %1
%19 = add nsw i32 %18, -1
store i32 %19, i32* %1
%20 = load i32, i32* %2
%21 = add nsw i32 %20, -1
store i32 %21, i32* %2
br label %13
22: ; preds = %13
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = icmp eq i32 %23, %24
%26 = zext i1 %25 to i32
%27 = call i32 @static_assert(i32 %26)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i64 (...) @unknown()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0, %3
%4 = tail call i64 (...) @unknown()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3, %0
%7 = tail call i32 @static_assert(i32 1)
ret void
}
int getRemainingEnergy(int *c, int n, int k) {
  int e = 100;
  int i = 0;
  do {
    i = (i + k) % n;
    if (0 == c[i]) {
      e--;
    } else {
      e -= 3;
    }
  } while (0 != i);
  return e;
}


x86 assembly (clang, -O0):
<getRemainingEnergy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
movslq -0x18(%rbp),%rdx
xor    %eax,%eax
cmp    (%rcx,%rdx,4),%eax
jne    114a <getRemainingEnergy+0x4a>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <getRemainingEnergy+0x53>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x14(%rbp)
jmp    1158 <getRemainingEnergy+0x58>
xor    %eax,%eax
cmp    -0x18(%rbp),%eax
jne    111c <getRemainingEnergy+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRemainingEnergy>:
mov    %edx,%r8d
xor    %edx,%edx
mov    $0x64,%ecx
nopw   0x0(%rax,%rax,1)
add    %r8d,%edx
mov    %edx,%eax
cltd
idiv   %esi
movslq %edx,%r9
cmpl   $0x1,(%rdi,%r9,4)
sbb    %eax,%eax
or     $0xfffffffd,%eax
add    %eax,%ecx
test   %r9d,%r9d
jne    1110 <getRemainingEnergy+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getRemainingEnergy(i32* nocapture %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i32 [ 100, %3 ], [ %14, %4 ]
%6 = phi i32 [ 0, %3 ], [ %8, %4 ]
%7 = add nsw i32 %6, %2
%8 = srem i32 %7, %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i32 -1, i32 -3
%14 = add nsw i32 %13, %5
%15 = icmp eq i32 %8, 0
br i1 %15, label %16, label %4
16: ; preds = %4
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ add(int *, int *);
void inc(int *z) {
  int tmp = 1;
  add(z, &tmp);
}


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

x86 assembly (clang, -O2):
<inc>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <add@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @inc(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = call i32 @add(i32* %0, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ gpio_backlight_lower(int);
int /*<<< orphan*/ gpio_backlight_upper(int);
int /*<<< orphan*/ gpio_init();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ usleep(int);
int main() {
  gpio_init();
  for (;;) {
    gpio_backlight_upper(1);
    usleep(500000);
    gpio_backlight_upper(0);
    gpio_backlight_lower(1);
    usleep(500000);
    gpio_backlight_lower(0);
    printf(".");
    fflush(stdout);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <gpio_init@plt>
mov    $0x1,%edi
call   1050 <gpio_backlight_upper@plt>
mov    $0x7a120,%edi
call   1080 <usleep@plt>
xor    %edi,%edi
call   1050 <gpio_backlight_upper@plt>
mov    $0x1,%edi
call   1030 <gpio_backlight_lower@plt>
mov    $0x7a120,%edi
call   1080 <usleep@plt>
xor    %edi,%edi
call   1030 <gpio_backlight_lower@plt>
lea    0xe4d(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
jmp    1176 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1070 <gpio_init@plt>
mov    0x2e71(%rip),%rbx
nop
mov    $0x1,%edi
call   1050 <gpio_backlight_upper@plt>
mov    $0x7a120,%edi
call   1080 <usleep@plt>
xor    %edi,%edi
call   1050 <gpio_backlight_upper@plt>
mov    $0x1,%edi
call   1040 <gpio_backlight_lower@plt>
mov    $0x7a120,%edi
call   1080 <usleep@plt>
xor    %edi,%edi
call   1040 <gpio_backlight_lower@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
jmp    1170 <main+0x10>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gpio_init()
br label %3
3: ; preds = %3, %0
%4 = call i32 @gpio_backlight_upper(i32 1)
%5 = call i32 @usleep(i32 500000)
%6 = call i32 @gpio_backlight_upper(i32 0)
%7 = call i32 @gpio_backlight_lower(i32 1)
%8 = call i32 @usleep(i32 500000)
%9 = call i32 @gpio_backlight_lower(i32 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
br label %3
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @gpio_init()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @gpio_backlight_upper(i32 1)
%4 = tail call i32 @usleep(i32 500000)
%5 = tail call i32 @gpio_backlight_upper(i32 0)
%6 = tail call i32 @gpio_backlight_lower(i32 1)
%7 = tail call i32 @usleep(i32 500000)
%8 = tail call i32 @gpio_backlight_lower(i32 0)
%9 = tail call i32 @putchar(i32 46)
%10 = load i32, i32* @stdout
%11 = tail call i32 @fflush(i32 %10)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ cgsynth(char *);
void cgsynxor(void) { cgsynth("xor"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"xor\00"
define void @cgsynxor() {
%1 = call i32 @cgsynth(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"xor\00"
define void @cgsynxor() {
%1 = tail call i32 @cgsynth(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int __u8;

/* Variables and functions */
int do_drive_cmd(int, int *);
int do_drive_sync(int fd) {
  int rc;
  __u8 args[4] = {0xe7, 0, 0, 0};
  rc = do_drive_cmd(fd, args);
  return rc;
}


x86 assembly (clang, -O0):
<do_drive_sync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1030 <do_drive_cmd@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_drive_sync>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
call   1030 <do_drive_cmd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.do_drive_sync.args = [4 x i32] [i32 231, i32 0, i32 0, i32 0]
define i32 @do_drive_sync(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [4 x i32]
store i32 %0, i32* %2
%5 = bitcast [4 x i32]* %4 to i8*
%6 = load i32, i32* %2
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%8 = call i32 @do_drive_cmd(i32 %6, i32* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@__const.do_drive_sync.args = [4 x i32] [i32 231, i32 0, i32 0, i32 0]
define i32 @do_drive_sync(i32 %0) {
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @do_drive_cmd(i32 %0, i32* %4)
ret i32 %5
}
int initialize_tuncompress() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @initialize_tuncompress() {
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char const);
const char *skip_whitespace(const char *p) {
  while (p && *p && isspace(*p))
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1157 <skip_whitespace+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skip_whitespace+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <skip_whitespace+0x57>
jmp    1178 <skip_whitespace+0x68>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_whitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
push   %rbx
test   %rdi,%rdi
je     113b <skip_whitespace+0x2b>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     113d <skip_whitespace+0x2d>
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     113d <skip_whitespace+0x2d>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_whitespace+0x10>
jmp    113d <skip_whitespace+0x2d>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_whitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %18, %1
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = call i64 @isspace(i8 signext %13)
%15 = icmp ne i64 %14, 0
br label %16
16: ; preds = %11, %6, %3
%17 = phi i1 [ false, %6 ], [ false, %3 ], [ %15, %11 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %3
21: ; preds = %16
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @skip_whitespace(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = tail call i64 @isspace(i8 signext %7)
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %6, %3, %1
%16 = phi i8* [ null, %1 ], [ %0, %3 ], [ %8, %6 ], [ %12, %11 ]
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc != 2) {
    fprintf(stderr, "target4: argc != 2\n");
    exit(EXIT_FAILURE);
  }
  foo(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1173 <main+0x43>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1143 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"target4: argc != 2\0A\00"
@EXIT_FAILURE = global i32 0
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 = icmp ne i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @foo(i8* %16)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"target4: argc != 2\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @foo(i8* %11)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int get32rand();
uint64_t get64rand() { return (((uint64_t)get32rand()) << 32) | get32rand(); }


x86 assembly (clang, -O0):
<get64rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get32rand@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get32rand@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get64rand>:
push   %rax
xor    %eax,%eax
call   1030 <get32rand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <get32rand@plt>

LLVM IR (-O0):
define i32 @get64rand() {
%1 = call i32 (...) @get32rand()
%2 = shl i32 %1, 32
%3 = call i32 (...) @get32rand()
%4 = or i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @get64rand() {
%1 = tail call i32 (...) @get32rand()
%2 = tail call i32 (...) @get32rand()
ret i32 poison
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double);
void ascii_number(FILE *f, const char **opts, double d) {
  fprintf(f, "%f\n", d);
}


x86 assembly (clang, -O0):
<ascii_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_number>:
lea    0xee9(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @ascii_number(i32* nocapture %0, i8** nocapture readnone %1, double %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
ret void
}
long modulus(long x, long y) { return (x - (x / y) * y); }


x86 assembly (clang, -O0):
<modulus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @modulus(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = sdiv i64 %6, %7
%9 = load i64, i64* %4
%10 = mul nsw i64 %8, %9
%11 = sub nsw i64 %5, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @modulus(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
ret i64 %3
}
struct _Locale_name_hint *
_Locale_get_numeric_hint(struct _Locale_numeric *numeric
                         __attribute__((__unused__))) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct._Locale_name_hint = type opaque
%struct._Locale_numeric = type opaque
define %struct._Locale_name_hint* @_Locale_get_numeric_hint(%struct._Locale_numeric* %0) {
%2 = alloca %struct._Locale_numeric*
store %struct._Locale_numeric* %0, %struct._Locale_numeric** %2
ret %struct._Locale_name_hint* null
}

LLVM IR (-O2):
%struct._Locale_name_hint = type opaque
%struct._Locale_numeric = type opaque
define noalias %struct._Locale_name_hint* @_Locale_get_numeric_hint(%struct._Locale_numeric* nocapture readnone %0) {
ret %struct._Locale_name_hint* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int reverse(int);
int main(void) {
  printf("%d\n", reverse(4041356));
  printf("%d\n", reverse(1534236469));
  printf("~0 = %d\n", ~0u);
  printf("~1 = %d\n", ~1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3daa8c,%edi
call   1030 <reverse@plt>
mov    %eax,%esi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5b729735,%edi
call   1030 <reverse@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0xffffffff,%esi
call   1040 <printf@plt>
lea    0xe92(%rip),%rdi
mov    $0xfffffffe,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3daa8c,%edi
call   1030 <reverse@plt>
lea    0xed3(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x5b729735,%edi
call   1030 <reverse@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0xffffffff,%esi
call   1040 <printf@plt>
lea    0xea1(%rip),%rdi
mov    $0xfffffffe,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [9 x i8] c"~0 = %d\0A\00"
@.str.2 = [9 x i8] c"~1 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @reverse(i32 4041356)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @reverse(i32 1534236469)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 -1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 -2)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
char *strupper(char *string) {
  int i;
  for (i = 0; i < strlen(string); i++)
    string[i] = toupper(string[i]);
  return string;
}


x86 assembly (clang, -O0):
<strupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <strupper+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <strupper+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <strupper+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <strupper+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strupper(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret i8* %0
}
/* Type definitions */
struct stream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ efp_stream_next_line(struct stream *);
scalar_t__ tok(struct stream *, char *);
int tok_end(struct stream *stream) {
  if (tok(stream, "$END")) {
    efp_stream_next_line(stream);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tok_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <tok@plt>
cmp    $0x0,%rax
je     115b <tok_end+0x3b>
mov    -0x10(%rbp),%rdi
call   1040 <efp_stream_next_line@plt>
movl   $0x1,-0x4(%rbp)
jmp    1162 <tok_end+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tok_end>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <tok@plt>
test   %rax,%rax
je     1144 <tok_end+0x24>
mov    %rbx,%rdi
call   1040 <efp_stream_next_line@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.stream = type { i32 }
@.str = [5 x i8] c"$END\00"
define i32 @tok_end(%struct.stream* %0) {
%2 = alloca i32
%3 = alloca %struct.stream*
store %struct.stream* %0, %struct.stream** %3
%4 = load %struct.stream*, %struct.stream** %3
%5 = call i64 @tok(%struct.stream* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load %struct.stream*, %struct.stream** %3
%9 = call i32 @efp_stream_next_line(%struct.stream* %8)
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.stream = type { i32 }
@.str = [5 x i8] c"$END\00"
define i32 @tok_end(%struct.stream* %0) {
%2 = tail call i64 @tok(%struct.stream* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @efp_stream_next_line(%struct.stream* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
void log_error(char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @log_error(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef float int32_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t rcLookup(int32_t tmp, uint8_t expo, uint8_t rate) {
  float tmpf = tmp / 100.0f;
  return (int16_t)((2500.0f + (float)expo * (tmpf * tmpf - 25.0f)) * tmpf *
                   (float)(rate) / 2500.0f);
}


x86 assembly (clang, -O0):
<rcLookup>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
cvtsi2ssq -0x10(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm1
movss  0xec1(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xead(%rip),%xmm1
addss  %xmm1,%xmm0
mulss  -0x1c(%rbp),%xmm0
cvtsi2ssq -0x18(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe92(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcLookup>:
divss  0xef8(%rip),%xmm0
cvtsi2ss %rdi,%xmm1
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm2
addss  0xee8(%rip),%xmm2
mulss  %xmm1,%xmm2
movss  0xee0(%rip),%xmm1
addss  %xmm1,%xmm2
mulss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsi2ss %rsi,%xmm0
mulss  %xmm2,%xmm0
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @rcLookup(float %0, i64 %1, i64 %2) {
%4 = alloca float
%5 = alloca i64
%6 = alloca i64
%7 = alloca float
store float %0, float* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load float, float* %4
%9 = fdiv float %8, 1.000000e+02
store float %9, float* %7
%10 = load i64, i64* %5
%11 = sitofp i64 %10 to float
%12 = load float, float* %7
%13 = load float, float* %7
%14 = call float @llvm.fmuladd.f32(float %12, float %13, float -2.500000e+01)
%15 = call float @llvm.fmuladd.f32(float %11, float %14, float 2.500000e+03)
%16 = load float, float* %7
%17 = fmul float %15, %16
%18 = load i64, i64* %6
%19 = sitofp i64 %18 to float
%20 = fmul float %17, %19
%21 = fdiv float %20, 2.500000e+03
%22 = fptosi float %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @rcLookup(float %0, i64 %1, i64 %2) {
%4 = fdiv float %0, 1.000000e+02
%5 = sitofp i64 %1 to float
%6 = tail call float @llvm.fmuladd.f32(float %4, float %4, float -2.500000e+01)
%7 = tail call float @llvm.fmuladd.f32(float %5, float %6, float 2.500000e+03)
%8 = fmul float %4, %7
%9 = sitofp i64 %2 to float
%10 = fmul float %8, %9
%11 = fdiv float %10, 2.500000e+03
%12 = fptosi float %11 to i32
ret i32 %12
}