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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int getpid();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void _assertAction() {
  pid_t pid;
  pid = getpid();
  int i = 1;
  fprintf(stdout,
          "  Consider running: \n\n  gdb -pid %u\n\n  "
          "pid=%u will now SLEEP ...\n",
          pid, pid);
  while (i) {
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<_assertAction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
cmpl   $0x0,-0x8(%rbp)
je     117d <_assertAction+0x4d>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1164 <_assertAction+0x34>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assertAction>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%edi
lea    0xeb8(%rip),%rsi
mov    %eax,%edx
mov    %eax,%ecx
call   1040 <fprintf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1160 <_assertAction+0x30>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [66 x i8] c" Consider running: \0A\0A gdb -pid %u\0A\0A pid=%u will now SLEEP ...\0A\00"
define void @_assertAction() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getpid()
store i32 %3, i32* %1
store i32 1, i32* %2
%4 = load i32, i32* @stdout
%5 = load i32, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
br label %8
8: ; preds = %11, %0
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @sleep(i32 1)
br label %8
13: ; preds = %8
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [66 x i8] c" Consider running: \0A\0A gdb -pid %u\0A\0A pid=%u will now SLEEP ...\0A\00"
define void @_assertAction() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %1)
br label %4
4: ; preds = %4, %0
%5 = tail call i32 @sleep(i32 1)
br label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct ts_pat {
  int dummy;
};

/* Variables and functions */
struct ts_pat *ts_pat_alloc();
struct ts_pat *ts_pat_init(struct ts_pat *, int /*<<< orphan*/);
struct ts_pat *ts_pat_alloc_init(uint16_t transport_stream_id) {
  struct ts_pat *pat = ts_pat_alloc();
  if (!pat)
    return NULL;
  return ts_pat_init(pat, transport_stream_id);
}


x86 assembly (clang, -O0):
<ts_pat_alloc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <ts_pat_alloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114e <ts_pat_alloc_init+0x2e>
movq   $0x0,-0x8(%rbp)
jmp    115e <ts_pat_alloc_init+0x3e>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <ts_pat_init@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_pat_alloc_init>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <ts_pat_alloc@plt>
test   %rax,%rax
je     113a <ts_pat_alloc_init+0x1a>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <ts_pat_init@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ts_pat = type { i32 }
define %struct.ts_pat* @ts_pat_alloc_init(i32 %0) {
%2 = alloca %struct.ts_pat*
%3 = alloca i32
%4 = alloca %struct.ts_pat*
store i32 %0, i32* %3
%5 = call %struct.ts_pat* (...) @ts_pat_alloc()
store %struct.ts_pat* %5, %struct.ts_pat** %4
%6 = load %struct.ts_pat*, %struct.ts_pat** %4
%7 = icmp ne %struct.ts_pat* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store %struct.ts_pat* null, %struct.ts_pat** %2
br label %13
9: ; preds = %1
%10 = load %struct.ts_pat*, %struct.ts_pat** %4
%11 = load i32, i32* %3
%12 = call %struct.ts_pat* @ts_pat_init(%struct.ts_pat* %10, i32 %11)
store %struct.ts_pat* %12, %struct.ts_pat** %2
br label %13
13: ; preds = %9, %8
%14 = load %struct.ts_pat*, %struct.ts_pat** %2
ret %struct.ts_pat* %14
}

LLVM IR (-O2):
%struct.ts_pat = type { i32 }
define %struct.ts_pat* @ts_pat_alloc_init(i32 %0) {
%2 = tail call %struct.ts_pat* (...) @ts_pat_alloc()
%3 = icmp eq %struct.ts_pat* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call %struct.ts_pat* @ts_pat_init(%struct.ts_pat* %2, i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi %struct.ts_pat* [ %5, %4 ], [ null, %1 ]
ret %struct.ts_pat* %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ geteuid();
int /*<<< orphan*/ printf(char *);
uint32_t pof_check_root() {
  if (geteuid() == 0) {
    return 0;
  } else {
    printf("pofswitch ERROR: Permission denied.\n");
    return 1;
  }
}


x86 assembly (clang, -O0):
<pof_check_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <geteuid@plt>
cmp    $0x0,%rax
jne    1145 <pof_check_root+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1158 <pof_check_root+0x38>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pof_check_root>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <geteuid@plt>
test   %rax,%rax
je     1140 <pof_check_root+0x20>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"pofswitch ERROR: Permission denied.\0A\00"
define i32 @pof_check_root() {
%1 = alloca i32
%2 = call i64 (...) @geteuid()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@str = [36 x i8] c"pofswitch ERROR: Permission denied.\00"
define i32 @pof_check_root() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
char *strdup(char const *);
char *oscap_strdup(const char *str) {
  if (str == NULL)
    return NULL;
  return strdup(str);
}


x86 assembly (clang, -O0):
<oscap_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <oscap_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <oscap_strdup+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oscap_strdup>:
test   %rdi,%rdi
je     111a <oscap_strdup+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @oscap_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @oscap_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ puts(char *);
int main() {
  char *argv[] = {"ls", "-a", NULL};
  execvp("ls", argv);
  puts("error");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2cd1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cce(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ccb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <execvp@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0x2ce5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cc9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xebe(%rip),%rdi
mov    %rsp,%rsi
call   1040 <execvp@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-a\00"
@__const.main.argv = [3 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str.2 = [6 x i8] c"error\00"
define i32 @main() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-a\00"
@__const.main.argv = [3 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str.2 = [6 x i8] c"error\00"
define i32 @main() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int rom_present(char *);
int xtide_available(void) {
  return (rom_present(L"roms/hdd/xtide/ide_xt.bin"));
}


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

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

LLVM IR (-O0):
@.str = [26 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 120, i32 116, i32 105, i32 100, i32 101, i32 47, i32 105, i32 100, i32 101, i32 95, i32 120, i32 116, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @xtide_available() {
%1 = call i32 @rom_present(i8* bitcast ([26 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [26 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 120, i32 116, i32 105, i32 100, i32 101, i32 47, i32 105, i32 100, i32 101, i32 95, i32 120, i32 116, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @xtide_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([26 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
unsigned char *hmac_sha512(unsigned char *, unsigned char const *, size_t,
                           unsigned char const *, size_t);
unsigned char *mac_hmac_sha512(unsigned char *out, const unsigned char *key,
                               size_t key_len, const unsigned char *msg,
                               size_t msg_len) {
  return hmac_sha512(out, key, key_len, msg, msg_len);
}


x86 assembly (clang, -O0):
<mac_hmac_sha512>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <hmac_sha512@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_hmac_sha512>:
jmp    1030 <hmac_sha512@plt>

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

LLVM IR (-O2):
define i8* @mac_hmac_sha512(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_sha512(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
int idelay(int stamp, int interval, int offset) {
  int goal;
  goal = stamp;
  goal -= (goal + interval - offset) % interval;
  if (goal <= stamp) {
    goal += interval;
  }
  return goal - stamp;
}


x86 assembly (clang, -O0):
<idelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113d <idelay+0x3d>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idelay>:
lea    (%rdi,%rsi,1),%eax
sub    %edx,%eax
cltd
idiv   %esi
xor    %eax,%eax
test   %edx,%edx
cmovns %esi,%eax
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @idelay(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = sub i32 %4, %2
%6 = srem i32 %5, %1
%7 = icmp slt i32 %6, 0
%8 = select i1 %7, i32 0, i32 %1
%9 = sub i32 %8, %6
ret i32 %9
}
/* Variables and functions */
double exp(double);
double If(double t) { return exp(0.5 * t * t); }


x86 assembly (clang, -O0):
<If>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<If>:
movsd  0xee8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @If(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 5.000000e-01, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = call double @exp(double %6)
ret double %7
}

LLVM IR (-O2):
define double @If(double %0) {
%2 = fmul double %0, 5.000000e-01
%3 = fmul double %2, %0
%4 = tail call double @exp(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printerror(char *);
void Usage() {
  printerror("argument syntax error\n	./hw4 keygen -t=period\n	./hw4 "
             "crypt -k=keyfile [file]\n	./hw4 invkey keyfile\n	./hw4 histo "
             "-t=period -i=which [file]\n	./hw4 solve -l=max_t file\n");
}


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

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

LLVM IR (-O0):
@.str = [166 x i8] c"argument syntax error\0A\09./hw4 keygen -t=period\0A\09./hw4 crypt -k=keyfile [file]\0A\09./hw4 invkey keyfile\0A\09./hw4 histo -t=period -i=which [file]\0A\09./hw4 solve -l=max_t file\0A\00"
define void @Usage() {
%1 = call i32 @printerror(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [166 x i8] c"argument syntax error\0A\09./hw4 keygen -t=period\0A\09./hw4 crypt -k=keyfile [file]\0A\09./hw4 invkey keyfile\0A\09./hw4 histo -t=period -i=which [file]\0A\09./hw4 solve -l=max_t file\0A\00"
define void @Usage() {
%1 = tail call i32 @printerror(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _cause(int);
void _cause_ovf() { _cause(8); }


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

x86 assembly (clang, -O2):
<_cause_ovf>:
mov    $0x8,%edi
jmp    1030 <_cause@plt>

LLVM IR (-O0):
define void @_cause_ovf() {
%1 = call i32 @_cause(i32 8)
ret void
}

LLVM IR (-O2):
define void @_cause_ovf() {
%1 = tail call i32 @_cause(i32 8)
ret void
}
unsigned int gnu_dev_minor(unsigned long long int dev) {
  return (dev & 0xff) | ((unsigned int)(dev >> 12) & ~0xff);
}


x86 assembly (clang, -O0):
<gnu_dev_minor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    -0x8(%rbp),%rcx
shr    $0xc,%rcx
and    $0xffffff00,%ecx
mov    %ecx,%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnu_dev_minor>:
movzbl %dil,%eax
shr    $0xc,%rdi
and    $0xffffff00,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @gnu_dev_minor(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 255
%5 = load i64, i64* %2
%6 = lshr i64 %5, 12
%7 = trunc i64 %6 to i32
%8 = and i32 %7, -256
%9 = zext i32 %8 to i64
%10 = or i64 %4, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @gnu_dev_minor(i64 %0) {
%2 = and i64 %0, 255
%3 = lshr i64 %0, 12
%4 = and i64 %3, 4294967040
%5 = or i64 %4, %2
%6 = trunc i64 %5 to i32
ret i32 %6
}
double cdfEquilikely(long a, long b, long x) {
  return ((x - a + 1.0) / (b - a + 1.0));
}


x86 assembly (clang, -O0):
<cdfEquilikely>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  0xedb(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm1
movsd  0xec2(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdfEquilikely>:
sub    %rdi,%rdx
cvtsi2sd %rdx,%xmm0
movsd  0xef0(%rip),%xmm1
addsd  %xmm1,%xmm0
sub    %rdi,%rsi
cvtsi2sd %rsi,%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @cdfEquilikely(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* %4
%9 = sub nsw i64 %7, %8
%10 = sitofp i64 %9 to double
%11 = fadd double %10, 1.000000e+00
%12 = load i64, i64* %5
%13 = load i64, i64* %4
%14 = sub nsw i64 %12, %13
%15 = sitofp i64 %14 to double
%16 = fadd double %15, 1.000000e+00
%17 = fdiv double %11, %16
ret double %17
}

LLVM IR (-O2):
define double @cdfEquilikely(i64 %0, i64 %1, i64 %2) {
%4 = sub nsw i64 %2, %0
%5 = sitofp i64 %4 to double
%6 = fadd double %5, 1.000000e+00
%7 = sub nsw i64 %1, %0
%8 = sitofp i64 %7 to double
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double %6, %9
ret double %10
}
/* Variables and functions */
float svp(float);
float mixratio(float K, float pres) {
  return (621.97 * svp(K) / (pres - svp(K)));
}


x86 assembly (clang, -O0):
<mixratio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <svp@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xec8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <svp@plt>
movss  -0x14(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
subss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixratio>:
sub    $0x18,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
call   1030 <svp@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0xecf(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movss  0x8(%rsp),%xmm0
call   1030 <svp@plt>
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @mixratio(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call float @svp(float %5)
%7 = fpext float %6 to double
%8 = fmul double 6.219700e+02, %7
%9 = load float, float* %4
%10 = load float, float* %3
%11 = call float @svp(float %10)
%12 = fsub float %9, %11
%13 = fpext float %12 to double
%14 = fdiv double %8, %13
%15 = fptrunc double %14 to float
ret float %15
}

LLVM IR (-O2):
define float @mixratio(float %0, float %1) {
%3 = tail call float @svp(float %0)
%4 = fpext float %3 to double
%5 = fmul double %4, 6.219700e+02
%6 = tail call float @svp(float %0)
%7 = fsub float %1, %6
%8 = fpext float %7 to double
%9 = fdiv double %5, %8
%10 = fptrunc double %9 to float
ret float %10
}
int d_lt_rr1(double a1, double a2) { return (((a1) < (a2))); }


x86 assembly (clang, -O0):
<d_lt_rr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_lt_rr1>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @d_lt_rr1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @d_lt_rr1(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
const char *SkipWhiteSpace(const char *pSrc) {
  while (pSrc && ((*pSrc == ' ') || (*pSrc == '\t'))) {
    pSrc++;
  }
  return pSrc;
}


x86 assembly (clang, -O0):
<SkipWhiteSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1143 <SkipWhiteSpace+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     113d <SkipWhiteSpace+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1153 <SkipWhiteSpace+0x53>
jmp    1164 <SkipWhiteSpace+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <SkipWhiteSpace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @SkipWhiteSpace(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %9
}
void backlight_enable(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @uninit_libretro_sym() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int standard_scale_system(int mode, double *cff) {
  int fail, *b;
  fail = _ada_use_c2phc(590, &mode, b, cff);
  return fail;
}


x86 assembly (clang, -O0):
<standard_scale_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x24e,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_scale_system>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x24e,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @standard_scale_system(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %3
store double* %1, double** %4
%7 = load i32*, i32** %6
%8 = load double*, double** %4
%9 = call i32 @_ada_use_c2phc(i32 590, i32* %3, i32* %7, double* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @standard_scale_system(i32 %0, double* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 590, i32* %3, i32* undef, double* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ isxdigit(int /*<<< orphan*/);
int is_xsubstring(const char *text, int len) {
  while (len--)
    if (!isxdigit(*text++))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_xsubstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1164 <is_xsubstring+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%eax
jne    115f <is_xsubstring+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    116b <is_xsubstring+0x5b>
jmp    111f <is_xsubstring+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_xsubstring>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
nopl   (%rax)
cmp    %ebx,%r15d
je     113b <is_xsubstring+0x2b>
movsbl (%r14,%rbx,1),%edi
call   1030 <isxdigit@plt>
add    $0x1,%rbx
test   %eax,%eax
jne    1120 <is_xsubstring+0x10>
xor    %eax,%eax
jmp    1140 <is_xsubstring+0x30>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @is_xsubstring(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %9, %7 ]
%5 = phi i32 [ %1, %2 ], [ %8, %7 ]
%6 = icmp eq i32 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = add nsw i32 %5, -1
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = tail call i32 @isxdigit(i32 %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %3
14: ; preds = %3, %7
%15 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void DMA1_Channel4_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @DMA1_Channel4_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @DMA1_Channel4_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
unsigned int __tzcnt_u32(unsigned int);
unsigned int test__tzcnt_u32(unsigned int __X) { return __tzcnt_u32(__X); }


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

x86 assembly (clang, -O2):
<test__tzcnt_u32>:
jmp    1030 <__tzcnt_u32@plt>

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

LLVM IR (-O2):
define i32 @test__tzcnt_u32(i32 %0) {
%2 = tail call i32 @__tzcnt_u32(i32 %0)
ret i32 %2
}
long xxx(st)
int st;
{
  static long f, s;
  long r;
  if (st) {
    f = 37;
    s = 7;
    return (0L);
  }
  r = ((f * s) + 9337) % 8887;
  f = s;
  s = r;
  return (r);
}


x86 assembly (clang, -O0):
<xxx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1134 <xxx+0x34>
movq   $0x25,0x2f0c(%rip)
movq   $0x7,0x2f09(%rip)
movq   $0x0,-0x8(%rbp)
jmp    1178 <xxx+0x78>
mov    0x2eed(%rip),%rax
imul   0x2eed(%rip),%rax
add    $0x2479,%rax
mov    $0x22b7,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    %rax,0x2ec3(%rip)
mov    -0x18(%rbp),%rax
mov    %rax,0x2ec0(%rip)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxx>:
test   %edi,%edi
je     1112 <xxx+0x12>
mov    $0x7,%ecx
mov    $0x25,%esi
xor    %eax,%eax
jmp    1156 <xxx+0x56>
mov    0x2f17(%rip),%rsi
mov    0x2f08(%rip),%rcx
imul   %rsi,%rcx
add    $0x2479,%rcx
movabs $0x75fd684e9545f857,%rdx
68 fd 75
mov    %rcx,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xc,%rdx
add    %rax,%rdx
imul   $0x22b7,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,%rax
mov    %rsi,0x2ecb(%rip)
mov    %rcx,0x2ecc(%rip)
ret

LLVM IR (-O0):
@xxx.f = internal global i64 0
@xxx.s = internal global i64 0
define i64 @xxx(i32 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 37, i64* @xxx.f
store i64 7, i64* @xxx.s
store i64 0, i64* %2
br label %17
8: ; preds = %1
%9 = load i64, i64* @xxx.f
%10 = load i64, i64* @xxx.s
%11 = mul nsw i64 %9, %10
%12 = add nsw i64 %11, 9337
%13 = srem i64 %12, 8887
store i64 %13, i64* %4
%14 = load i64, i64* @xxx.s
store i64 %14, i64* @xxx.f
%15 = load i64, i64* %4
store i64 %15, i64* @xxx.s
%16 = load i64, i64* %4
store i64 %16, i64* %2
br label %17
17: ; preds = %8, %7
%18 = load i64, i64* %2
ret i64 %18
}

LLVM IR (-O2):
@xxx.f = internal unnamed_addr global i64 0
@xxx.s = internal unnamed_addr global i64 0
define i64 @xxx(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = load i64, i64* @xxx.f
%5 = load i64, i64* @xxx.s
%6 = mul nsw i64 %5, %4
%7 = add nsw i64 %6, 9337
%8 = srem i64 %7, 8887
br label %9
9: ; preds = %1, %3
%10 = phi i64 [ %5, %3 ], [ 37, %1 ]
%11 = phi i64 [ %8, %3 ], [ 7, %1 ]
%12 = phi i64 [ %8, %3 ], [ 0, %1 ]
store i64 %10, i64* @xxx.f
store i64 %11, i64* @xxx.s
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ HwSparky2Handle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void HwSparky2Updated() { UAVObjUpdated(HwSparky2Handle()); }


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

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

LLVM IR (-O0):
define void @HwSparky2Updated() {
%1 = call i32 (...) @HwSparky2Handle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwSparky2Updated() {
%1 = tail call i32 (...) @HwSparky2Handle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void display_func(void) {}


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

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

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

LLVM IR (-O2):
define void @display_func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arraySyntax();
int /*<<< orphan*/ msg();
int /*<<< orphan*/ pointerSyntax();
int main() {
  msg();
  arraySyntax();
  pointerSyntax();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <msg@plt>
mov    $0x0,%al
call   1040 <arraySyntax@plt>
mov    $0x0,%al
call   1030 <pointerSyntax@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @msg()
%3 = call i32 (...) @arraySyntax()
%4 = call i32 (...) @pointerSyntax()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @msg()
%2 = tail call i32 (...) @arraySyntax()
%3 = tail call i32 (...) @pointerSyntax()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int,
                                          int /*<<< orphan*/);
void wl_data_offer_send_source_actions(struct wl_resource *resource_,
                                       uint32_t source_actions) {
  wl_resource_post_event(resource_, 1, source_actions);
}


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

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

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_data_offer_send_source_actions(%struct.wl_resource* %0, i32 %1) {
%3 = alloca %struct.wl_resource*
%4 = alloca i32
store %struct.wl_resource* %0, %struct.wl_resource** %3
store i32 %1, i32* %4
%5 = load %struct.wl_resource*, %struct.wl_resource** %3
%6 = load i32, i32* %4
%7 = call i32 @wl_resource_post_event(%struct.wl_resource* %5, i32 1, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_data_offer_send_source_actions(%struct.wl_resource* %0, i32 %1) {
%3 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 1, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
gtext() { ol(".text"); }


x86 assembly (clang, -O0):
<gtext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c".text\00"
define i32 @gtext() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c".text\00"
define i32 @gtext() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int main() {
  int num_failed = 0;
  return (num_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112d <main+0x2d>
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <main+0x39>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = load i32, i32* @EXIT_SUCCESS
ret i32 %1
}
int column_active(unsigned int colopts) { return (colopts & 0x0030) == 0x0010; }


x86 assembly (clang, -O0):
<column_active>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x30,%eax
cmp    $0x10,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<column_active>:
and    $0x30,%edi
xor    %eax,%eax
cmp    $0x10,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @column_active(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 48
%5 = icmp eq i32 %4, 16
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @column_active(i32 %0) {
%2 = and i32 %0, 48
%3 = icmp eq i32 %2, 16
%4 = zext i1 %3 to i32
ret i32 %4
}
int WordChr(char c) {
  return (int)((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
}


x86 assembly (clang, -O0):
<WordChr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <WordChr+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <WordChr+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <WordChr+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WordChr>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @WordChr(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @WordChr(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int MTwister_Int32();
double MTwister_Res53(void) {
  unsigned long a = MTwister_Int32() >> 5, b = MTwister_Int32() >> 6;
  return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);
}


x86 assembly (clang, -O0):
<MTwister_Res53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %al,-0x11(%rbp)
call   1030 <MTwister_Int32@plt>
mov    %eax,%ecx
mov    -0x11(%rbp),%al
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    %rcx,-0x8(%rbp)
call   1030 <MTwister_Int32@plt>
sar    $0x6,%eax
cltq
mov    %rax,-0x10(%rbp)
movaps 0xeca(%rip),%xmm3
movq   -0x8(%rbp),%xmm0
punpckldq %xmm3,%xmm0
movapd 0xec9(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x10(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe82(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MTwister_Res53>:
push   %rbx
xor    %eax,%eax
call   1030 <MTwister_Int32@plt>
sar    $0x5,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1030 <MTwister_Int32@plt>
sar    $0x6,%eax
cltq
movq   %rbx,%xmm1
movdqa 0xec9(%rip),%xmm2
punpckldq %xmm2,%xmm1
movapd 0xecd(%rip),%xmm3
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
movq   %rax,%xmm1
punpckldq %xmm2,%xmm1
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
mulsd  0xeb0(%rip),%xmm0
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
mulsd  0xea8(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @MTwister_Res53() {
%1 = alloca i64
%2 = alloca i64
%3 = call i32 (...) @MTwister_Int32()
%4 = ashr i32 %3, 5
%5 = sext i32 %4 to i64
store i64 %5, i64* %1
%6 = call i32 (...) @MTwister_Int32()
%7 = ashr i32 %6, 6
%8 = sext i32 %7 to i64
store i64 %8, i64* %2
%9 = load i64, i64* %1
%10 = uitofp i64 %9 to double
%11 = load i64, i64* %2
%12 = uitofp i64 %11 to double
%13 = call double @llvm.fmuladd.f64(double %10, double 0x4190000000000000, double %12)
%14 = fmul double %13, 0x3CA0000000000000
ret double %14
}

LLVM IR (-O2):
define double @MTwister_Res53() {
%1 = tail call i32 (...) @MTwister_Int32()
%2 = ashr i32 %1, 5
%3 = sext i32 %2 to i64
%4 = tail call i32 (...) @MTwister_Int32()
%5 = ashr i32 %4, 6
%6 = sext i32 %5 to i64
%7 = uitofp i64 %3 to double
%8 = uitofp i64 %6 to double
%9 = tail call double @llvm.fmuladd.f64(double %7, double 0x4190000000000000, double %8)
%10 = fmul double %9, 0x3CA0000000000000
ret double %10
}
const char *rmdir00_get_description(void) {
  return "Create a directory named rmdir00_test_dir_pid, where "
         "pid is the process id.  Within that directory, create "
         "a number of sub-directories and small files. "
         "The total size of all sub-directories and files "
         "is specified by the size parameter. "
         "The size parameter is given by the -z or --size option, "
         "otherwise it defaults to 1000000. "
         "A size of zero fills the file system until there is no "
         "space left. "
         "The task repeats, sleeping in between each iteration, "
         "and then removing the sub-directories and files created "
         "during the last iteration. "
         "The repeat count is set by the -n or --repeat option, "
         "otherwise it defaults to 1. "
         "A repeat count of zero repeats forever. "
         "The sleep value is given by the -p or --sleep option, "
         "otherwise it defaults to 0. "
         "Sleep is specified in milliseconds.";
}


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

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

LLVM IR (-O0):
@.str = [770 x i8] c"Create a directory named rmdir00_test_dir_pid, where pid is the process id. Within that directory, create a number of sub-directories and small files. The total size of all sub-directories and files is specified by the size parameter. The size parameter is given by the -z or --size option, otherwise it defaults to 1000000. A size of zero fills the file system until there is no space left. The task repeats, sleeping in between each iteration, and then removing the sub-directories and files created during the last iteration. The repeat count is set by the -n or --repeat option, otherwise it defaults to 1. A repeat count of zero repeats forever. The sleep value is given by the -p or --sleep option, otherwise it defaults to 0. Sleep is specified in milliseconds.\00"
define i8* @rmdir00_get_description() {
ret i8* getelementptr inbounds ([770 x i8], [770 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [770 x i8] c"Create a directory named rmdir00_test_dir_pid, where pid is the process id. Within that directory, create a number of sub-directories and small files. The total size of all sub-directories and files is specified by the size parameter. The size parameter is given by the -z or --size option, otherwise it defaults to 1000000. A size of zero fills the file system until there is no space left. The task repeats, sleeping in between each iteration, and then removing the sub-directories and files created during the last iteration. The repeat count is set by the -n or --repeat option, otherwise it defaults to 1. A repeat count of zero repeats forever. The sleep value is given by the -p or --sleep option, otherwise it defaults to 0. Sleep is specified in milliseconds.\00"
define i8* @rmdir00_get_description() {
ret i8* getelementptr inbounds ([770 x i8], [770 x i8]* @.str, i64 0, i64 0)
}
void module1_section3_topic3() {}


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

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

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

LLVM IR (-O2):
define void @module1_section3_topic3() {
ret void
}
int ignore_missing_nodes(void *param, union kowhai_symbol_t *path,
                         int path_len) {
  return 0;
}


x86 assembly (clang, -O0):
<ignore_missing_nodes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.kowhai_symbol_t = type opaque
define i32 @ignore_missing_nodes(i8* %0, %union.kowhai_symbol_t* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %union.kowhai_symbol_t*
%6 = alloca i32
store i8* %0, i8** %4
store %union.kowhai_symbol_t* %1, %union.kowhai_symbol_t** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%union.kowhai_symbol_t = type opaque
define i32 @ignore_missing_nodes(i8* nocapture readnone %0, %union.kowhai_symbol_t* nocapture readnone %1, i32 %2) {
ret i32 0
}