xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int shutdown(void) {
  int buts = 1;
  puts("Cleaning up for shutdown.");
  return (buts);
}


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

x86 assembly (clang, -O2):
<shutdown>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Cleaning up for shutdown.\00"
define i32 @shutdown() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [26 x i8] c"Cleaning up for shutdown.\00"
define i32 @shutdown() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
int omp_get_num_procs() {}


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

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

LLVM IR (-O0):
define i32 @omp_get_num_procs() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @omp_get_num_procs() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void c_free(char *pA) { free(pA); }


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

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

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

LLVM IR (-O2):
define void @c_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void foo520(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo520(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x82() {
  Assert_real((isprint(130) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              655, ("isprint should be 0 for 0x82"));
}


x86 assembly (clang, -O0):
<t_isprint_0x82>:
push   %rbp
mov    %rsp,%rbp
mov    $0x82,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x28f,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x82>:
push   %rax
mov    $0x82,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x82\00"
define void @t_isprint_0x82() {
%1 = call i64 @isprint(i32 130)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x82\00"
define void @t_isprint_0x82() {
%1 = tail call i64 @isprint(i32 130)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ monthlyClimate(double, double, int, int, char *, char *,
                                  double *);
void monthlyClimate_R(double *latitude, double *longitude, int *yearLow,
                      int *yearHigh, char **site, char **directory,
                      double *result) {
  monthlyClimate(*latitude, *longitude, *yearLow, *yearHigh, *site, *directory,
                 result);
}


x86 assembly (clang, -O0):
<monthlyClimate_R>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rax
mov    (%rax),%rdx
mov    -0x30(%rbp),%rax
mov    (%rax),%rcx
mov    0x10(%rbp),%r8
call   1030 <monthlyClimate@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monthlyClimate_R>:
mov    0x8(%rsp),%rax
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    (%rdx),%edi
mov    (%rcx),%esi
mov    (%r8),%rdx
mov    (%r9),%rcx
mov    %rax,%r8
jmp    1030 <monthlyClimate@plt>

LLVM IR (-O0):
define void @monthlyClimate_R(double* %0, double* %1, i32* %2, i32* %3, i8** %4, i8** %5, double* %6) {
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i8**
%13 = alloca i8**
%14 = alloca double*
store double* %0, double** %8
store double* %1, double** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i8** %4, i8*** %12
store i8** %5, i8*** %13
store double* %6, double** %14
%15 = load double*, double** %8
%16 = load double, double* %15
%17 = load double*, double** %9
%18 = load double, double* %17
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
%21 = load i32*, i32** %11
%22 = load i32, i32* %21
%23 = load i8**, i8*** %12
%24 = load i8*, i8** %23
%25 = load i8**, i8*** %13
%26 = load i8*, i8** %25
%27 = load double*, double** %14
%28 = call i32 @monthlyClimate(double %16, double %18, i32 %20, i32 %22, i8* %24, i8* %26, double* %27)
ret void
}

LLVM IR (-O2):
define void @monthlyClimate_R(double* nocapture %0, double* nocapture %1, i32* nocapture %2, i32* nocapture %3, i8** nocapture %4, i8** nocapture %5, double* %6) {
%8 = load double, double* %0
%9 = load double, double* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = tail call i32 @monthlyClimate(double %8, double %9, i32 %10, i32 %11, i8* %12, i8* %13, double* %6)
ret void
}
/* Type definitions */
struct PtrMap {
  int dummy;
};

/* Variables and functions */
struct PtrMap *PtrMap_New(unsigned delta) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
%struct.PtrMap = type { i32 }
define noalias %struct.PtrMap* @PtrMap_New(i32 %0) {
ret %struct.PtrMap* null
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int timespec_is_zero(struct timespec a) {
  return (a.tv_sec == 0) && (a.tv_nsec == 0);
}


x86 assembly (clang, -O0):
<timespec_is_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jne    1127 <timespec_is_zero+0x27>
cmpq   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_is_zero>:
xor    %eax,%eax
or     %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @timespec_is_zero(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { i64, i64 }*
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%12 = load i64, i64* %11
%13 = icmp eq i64 %12, 0
br label %14
14: ; preds = %10, %2
%15 = phi i1 [ false, %2 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @timespec_is_zero(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = icmp eq i64 %1, 0
%5 = select i1 %3, i1 %4, i1 false
%6 = zext i1 %5 to i32
ret i32 %6
}
int complement3bitshifted_slow(int x) {
  if (x & 4)
    return ((x & 3) - 4) << 3;
  return x << 3;
}


x86 assembly (clang, -O0):
<complement3bitshifted_slow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     112a <complement3bitshifted_slow+0x2a>
mov    -0x8(%rbp),%eax
and    $0x3,%eax
sub    $0x4,%eax
shl    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <complement3bitshifted_slow+0x33>
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complement3bitshifted_slow>:
lea    0x0(,%rdi,8),%ecx
mov    %ecx,%eax
or     $0xffffffe0,%eax
test   $0x4,%dil
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @complement3bitshifted_slow(i32 %0) {
%2 = and i32 %0, 4
%3 = icmp eq i32 %2, 0
%4 = shl i32 %0, 3
%5 = or i32 %4, -32
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void show_help() {
  write(2,
        "usage: sleep NUMBER[SUFFIX]\nSuffix: s for seconds\n 	m for "
        "minutes\n\th for hours\n\td for days\n",
        94);
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xee0(%rip),%rsi
mov    $0x5e,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
mov    $0x5e,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [92 x i8] c"usage: sleep NUMBER[SUFFIX]\0ASuffix: s for seconds\0A \09m for minutes\0A\09h for hours\0A\09d for days\0A\00"
define void @show_help() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0), i32 94)
ret void
}

LLVM IR (-O2):
@.str = [92 x i8] c"usage: sleep NUMBER[SUFFIX]\0ASuffix: s for seconds\0A \09m for minutes\0A\09h for hours\0A\09d for days\0A\00"
define void @show_help() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0), i32 94)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 0;
  int b = 7;
  int c = 1;
  c = (a == b);
  printf("c:%d", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"c:%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 7, i32* %3
store i32 1, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

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


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

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

LLVM IR (-O0):
define i32 @vidsim() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @vidsim() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x8e() {
  Assert_real((isprint(142) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              715, ("isprint should be 0 for 0x8e"));
}


x86 assembly (clang, -O0):
<t_isprint_0x8e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8e,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2cb,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x8e>:
push   %rax
mov    $0x8e,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2cb,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x8e\00"
define void @t_isprint_0x8e() {
%1 = call i64 @isprint(i32 142)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 715, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x8e\00"
define void @t_isprint_0x8e() {
%1 = tail call i64 @isprint(i32 142)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 715, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *s_404() { return "Custom 404 page!"; }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Custom 404 page!\00"
define i8* @s_404() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"Custom 404 page!\00"
define i8* @s_404() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
size_t dae_count_string_int32s(char const *);
size_t dae_count_string_int8s(const char *str) {
  return dae_count_string_int32s(str);
}


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

x86 assembly (clang, -O2):
<dae_count_string_int8s>:
jmp    1030 <dae_count_string_int32s@plt>

LLVM IR (-O0):
define i64 @dae_count_string_int8s(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @dae_count_string_int32s(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @dae_count_string_int8s(i8* %0) {
%2 = tail call i64 @dae_count_string_int32s(i8* %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int muxx_unimpl(int np, va_list args) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @muxx_unimpl(i32 %0, i32 %1) {
ret i32 -1
}
void admin_stdin(const char *text) {}


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

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

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

LLVM IR (-O2):
define void @admin_stdin(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_to_prog();
void _returnFromException(void) { return_to_prog(); }


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

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

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

LLVM IR (-O2):
define void @_returnFromException() {
%1 = tail call i32 (...) @return_to_prog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr,
          "usage: %s MC SPEED DIRECTION \n\n"
          "where MC = <NUM> specifies mc dev,\n"
          "0 <= SPEED < 256 specifies speed,\n"
          "('f'|'s'|'r') specifies direction.\n",
          argv0);
  exit(2);
}


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    $0x2,%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    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [136 x i8] c"usage: %s MC SPEED DIRECTION \0A\0Awhere MC = <NUM> specifies mc dev,\0A0 <= SPEED < 256 specifies speed,\0A('f'|'s'|'r') specifies direction.\0A\00"
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 ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [136 x i8] c"usage: %s MC SPEED DIRECTION \0A\0Awhere MC = <NUM> specifies mc dev,\0A0 <= SPEED < 256 specifies speed,\0A('f'|'s'|'r') specifies direction.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
void handle_sigalrm(nr) int nr;
{}


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

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

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

LLVM IR (-O2):
define void @handle_sigalrm(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TIOCMGET;
int TIOCM_CD;
int modem_ioctl(int /*<<< orphan*/, int /*<<< orphan*/);
int tty_dcd(void) { return !!(modem_ioctl(TIOCMGET, 0) & TIOCM_CD); }


x86 assembly (clang, -O0):
<tty_dcd>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <modem_ioctl@plt>
mov    0x2ead(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_dcd>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <modem_ioctl@plt>
mov    0x2eb0(%rip),%rdx
xor    %ecx,%ecx
test   %eax,(%rdx)
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@TIOCMGET = global i32 0
@TIOCM_CD = global i32 0
define i32 @tty_dcd() {
%1 = load i32, i32* @TIOCMGET
%2 = call i32 @modem_ioctl(i32 %1, i32 0)
%3 = load i32, i32* @TIOCM_CD
%4 = and i32 %2, %3
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@TIOCMGET = global i32 0
@TIOCM_CD = global i32 0
define i32 @tty_dcd() {
%1 = load i32, i32* @TIOCMGET
%2 = tail call i32 @modem_ioctl(i32 %1, i32 0)
%3 = load i32, i32* @TIOCM_CD
%4 = and i32 %3, %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct userlist_cmdline_parser_params {
  int dummy;
};
struct userlist_args_info {
  int dummy;
};

/* Variables and functions */
int userlist_cmdline_parser_internal(int, char **, struct userlist_args_info *,
                                     struct userlist_cmdline_parser_params *,
                                     int /*<<< orphan*/);
int userlist_cmdline_parser_ext(int argc, char **argv,
                                struct userlist_args_info *args_info,
                                struct userlist_cmdline_parser_params *params) {
  int result;
  result = userlist_cmdline_parser_internal(argc, argv, args_info, params, 0);
  return result;
}


x86 assembly (clang, -O0):
<userlist_cmdline_parser_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <userlist_cmdline_parser_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<userlist_cmdline_parser_ext>:
xor    %r8d,%r8d
jmp    1030 <userlist_cmdline_parser_internal@plt>

LLVM IR (-O0):
%struct.userlist_args_info = type { i32 }
%struct.userlist_cmdline_parser_params = type { i32 }
define i32 @userlist_cmdline_parser_ext(i32 %0, i8** %1, %struct.userlist_args_info* %2, %struct.userlist_cmdline_parser_params* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.userlist_args_info*
%8 = alloca %struct.userlist_cmdline_parser_params*
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.userlist_args_info* %2, %struct.userlist_args_info** %7
store %struct.userlist_cmdline_parser_params* %3, %struct.userlist_cmdline_parser_params** %8
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = load %struct.userlist_args_info*, %struct.userlist_args_info** %7
%13 = load %struct.userlist_cmdline_parser_params*, %struct.userlist_cmdline_parser_params** %8
%14 = call i32 @userlist_cmdline_parser_internal(i32 %10, i8** %11, %struct.userlist_args_info* %12, %struct.userlist_cmdline_parser_params* %13, i32 0)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
%struct.userlist_args_info = type { i32 }
%struct.userlist_cmdline_parser_params = type { i32 }
define i32 @userlist_cmdline_parser_ext(i32 %0, i8** %1, %struct.userlist_args_info* %2, %struct.userlist_cmdline_parser_params* %3) {
%5 = tail call i32 @userlist_cmdline_parser_internal(i32 %0, i8** %1, %struct.userlist_args_info* %2, %struct.userlist_cmdline_parser_params* %3, i32 0)
ret i32 %5
}
void RTManifestSetAttr(void) {}


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

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

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

LLVM IR (-O2):
define void @RTManifestSetAttr() {
ret void
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int vec3_is_zero(float *);
__attribute__((always_)) bool psvec3_is_zero(struct vec3 *a) {
  return vec3_is_zero((float *)a);
}


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

x86 assembly (clang, -O2):
<psvec3_is_zero>:
jmp    1030 <vec3_is_zero@plt>

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define i32 @psvec3_is_zero(%struct.vec3* %0) {
%2 = alloca %struct.vec3*
store %struct.vec3* %0, %struct.vec3** %2
%3 = load %struct.vec3*, %struct.vec3** %2
%4 = bitcast %struct.vec3* %3 to float*
%5 = call i32 @vec3_is_zero(float* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define i32 @psvec3_is_zero(%struct.vec3* %0) {
%2 = bitcast %struct.vec3* %0 to float*
%3 = tail call i32 @vec3_is_zero(float* %2)
ret i32 %3
}
/* Variables and functions */
int _get_create_buttons(float);
int get_create_play_button(float lag) {
  int b = _get_create_buttons(lag);
  if (b > 100000)
    return (b);
  return (b & 0x1);
}


x86 assembly (clang, -O0):
<get_create_play_button>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <_get_create_buttons@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x186a0,-0xc(%rbp)
jle    1142 <get_create_play_button+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <get_create_play_button+0x3b>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_create_play_button>:
push   %rax
call   1030 <_get_create_buttons@plt>
mov    %eax,%ecx
and    $0x1,%ecx
cmp    $0x186a1,%eax
cmovl  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_create_play_button(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
%5 = load float, float* %3
%6 = call i32 @_get_create_buttons(float %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 100000
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = and i32 %12, 1
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_create_play_button(float %0) {
%2 = tail call i32 @_get_create_buttons(float %0)
%3 = icmp sgt i32 %2, 100000
%4 = and i32 %2, 1
%5 = select i1 %3, i32 %2, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ handler_not_implemented(char *);
void defaultOtherExceptionHandler() {
  handler_not_implemented("OTHER_EXCEPTIONS_HANDLER");
}


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

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"OTHER_EXCEPTIONS_HANDLER\00"
define void @defaultOtherExceptionHandler() {
%1 = tail call i32 @handler_not_implemented(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float __nv_fsub_ru(float, float);
float __fsub_ru(float __a, float __b) { return __nv_fsub_ru(__a, __b); }


x86 assembly (clang, -O0):
<__fsub_ru>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__nv_fsub_ru@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fsub_ru>:
jmp    1030 <__nv_fsub_ru@plt>

LLVM IR (-O0):
define float @__fsub_ru(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 = load float, float* %4
%7 = call float @__nv_fsub_ru(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__fsub_ru(float %0, float %1) {
%3 = tail call float @__nv_fsub_ru(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int get_num_customers(int *num_customers) {
  int err = 0;
  printf("please enter the number of customers\n");
  scanf("%d", num_customers);
  printf("num_customers: %d\n", *num_customers);
  return err;
}


x86 assembly (clang, -O0):
<get_num_customers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeda(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_customers>:
push   %rbx
mov    %rdi,%rbx
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    (%rbx),%esi
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"please enter the number of customers\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"num_customers: %d\0A\00"
define i32 @get_num_customers(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"num_customers: %d\0A\00"
@str = [37 x i8] c"please enter the number of customers\00"
define i32 @get_num_customers(i32* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%4 = load i32, i32* %0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cPrintf(char *);
void help12(void) {
  cPrintf("  mh                show memory halfword at PC\n");
  cPrintf("  mh <addr>         show memory halfword at <addr>\n");
  cPrintf("  mh <addr> <data>  set memory halfword at <addr> to <data>\n");
}


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

x86 assembly (clang, -O2):
<help12>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf0c(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf34(%rip),%rdi
pop    %rax
jmp    1030 <cPrintf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c" mh show memory halfword at PC\0A\00"
@.str.1 = [52 x i8] c" mh <addr> show memory halfword at <addr>\0A\00"
@.str.2 = [61 x i8] c" mh <addr> <data> set memory halfword at <addr> to <data>\0A\00"
define void @help12() {
%1 = call i32 @cPrintf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cPrintf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @cPrintf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c" mh show memory halfword at PC\0A\00"
@.str.1 = [52 x i8] c" mh <addr> show memory halfword at <addr>\0A\00"
@.str.2 = [61 x i8] c" mh <addr> <data> set memory halfword at <addr> to <data>\0A\00"
define void @help12() {
%1 = tail call i32 @cPrintf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cPrintf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @cPrintf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int yaffs_removexattr_reldir(int /*<<< orphan*/, char const *, char const *);
int yaffs_removexattr(const char *path, const char *name) {
  return yaffs_removexattr_reldir((0), path, name);
}


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

x86 assembly (clang, -O2):
<yaffs_removexattr>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <yaffs_removexattr_reldir@plt>

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

LLVM IR (-O2):
define i32 @yaffs_removexattr(i8* %0, i8* %1) {
%3 = tail call i32 @yaffs_removexattr_reldir(i32 0, i8* %0, i8* %1)
ret i32 %3
}
int do_151() { return 151; }


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

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

LLVM IR (-O0):
define i32 @do_151() {
ret i32 151
}

LLVM IR (-O2):
define i32 @do_151() {
ret i32 151
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ror(uint32_t n, int k) { return (n >> k) | (n << (32 - k)); }


x86 assembly (clang, -O0):
<ror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ror>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ror(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ror(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  int tv_usec;
};
typedef long long int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t get_clock(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000000000LL + (tv.tv_usec * 1000);
}


x86 assembly (clang, -O0):
<get_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
imul   $0x3e8,-0x8(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_clock>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3b9aca00,0x8(%rsp),%rcx
9a 3b
movslq 0x10(%rsp),%rax
imul   $0x3e8,%rax,%rax
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define i64 @get_clock() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %5, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define i64 @get_clock() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ DisposePtr(char *);
void Free_File(char *fptr) { DisposePtr(fptr); }


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

x86 assembly (clang, -O2):
<Free_File>:
jmp    1030 <DisposePtr@plt>

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

LLVM IR (-O2):
define void @Free_File(i8* %0) {
%2 = tail call i32 @DisposePtr(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("welcome");
  printf("to C!\n");
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"welcome\00"
@.str.1 = [7 x i8] c"to C!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"welcome\00"
@str = [6 x i8] c"to C!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__4__IO__clr();
void MotePlatformP__SerialIdPin__clr(void) {
  HplAtm128GeneralIOPinP__4__IO__clr();
}


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

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

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

LLVM IR (-O2):
define void @MotePlatformP__SerialIdPin__clr() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__4__IO__clr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  char color = 'R';
  switch (color) {
  case 'R':
    printf("red\n");
  case 'B':
    printf("blue\n");
  case 'Y':
    printf("yellow\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x52,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x42,%eax
je     1166 <main+0x56>
jmp    1138 <main+0x28>
mov    -0xc(%rbp),%eax
sub    $0x52,%eax
je     115a <main+0x4a>
jmp    1149 <main+0x39>
mov    -0xc(%rbp),%eax
sub    $0x59,%eax
je     1172 <main+0x62>
jmp    117e <main+0x6e>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"red\0A\00"
@.str.1 = [6 x i8] c"blue\0A\00"
@.str.2 = [8 x i8] c"yellow\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 82, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %11 [
i32 82, label %5
i32 66, label %7
i32 89, label %9
]
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %0, %5
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %0, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
ret i32 0
}

LLVM IR (-O2):
@str = [4 x i8] c"red\00"
@str.3 = [5 x i8] c"blue\00"
@str.4 = [7 x i8] c"yellow\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int read_int() {
  int ret;
  scanf("%d\n", &ret);
  return ret;
}


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

x86 assembly (clang, -O2):
<read_int>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @read_int() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
void _glfwPlatformDisableSystemKeys(void) {}


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

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

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

LLVM IR (-O2):
define void @_glfwPlatformDisableSystemKeys() {
ret void
}
/* Variables and functions */
char *ho_strchr(char *, char);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s", ho_strchr("12345", '2'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x32,%esi
call   1030 <ho_strchr@plt>
mov    %rax,%rsi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
mov    $0x32,%esi
call   1030 <ho_strchr@plt>
lea    0xec7(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"12345\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* @ho_strchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8 signext 50)
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"12345\00"
define i32 @main() {
%1 = tail call i8* @ho_strchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8 signext 50)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ state;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned get_XEvent_xcrossing_state(void *_p) {
  return (unsigned)((XEvent *)_p)->xcrossing.state;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xcrossing_state>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define i32 @get_XEvent_xcrossing_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XEvent_xcrossing_state(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int strlen(s)
char *s;
{
  int len;
  len = 0;
  while (*s++)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}