xunge/DecIR huggingface dataset:
/* Type definitions */
struct catmc_atomic_int_least32_t {
  int dummy;
};

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


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

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

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

LLVM IR (-O2):
%struct.catmc_atomic_int_least32_t = type { i32 }
define void @catmc_atomic_int_least32_t_destroy(%struct.catmc_atomic_int_least32_t* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_int_least32_t* %0)
ret void
}
/* Variables and functions */
int fii();
int /*<<< orphan*/ foo();
int main() {
  int x = 0;
#pragma omp task
  {
#pragma omp task
      {x++;
}
#pragma omp taskwait
}
foo();
int h = fii();
#pragma omp taskwait
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = call i32 (...) @foo()
%6 = call i32 (...) @fii()
store i32 %6, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @fii()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *command) {
  printf("Usage: %s --context <x> --from <y> --to <z> <value>\n"
         "\t--context: currently, <x> must be cpu\n"
         "\t--from and --to: allowed values for <y> and <z>:\n"
         "\t\tinterrupt-server\n\t\tdrc-index\n\t\tdrc-name\n"
         "\tif <value> is a drc-index or interrupt-server, it can be\n"
         "\tspecified in decimal, hex (with a leading 0x), or octal\n"
         "\t(with a leading 0); if it is a drc-name, it should be\n"
         "\tspecified as a string in double quotes\n\n",
         command);
}


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

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [395 x i8] c"Usage: %s --context <x> --from <y> --to <z> <value>\0A\09--context: currently, <x> must be cpu\0A\09--from and --to: allowed values for <y> and <z>:\0A\09\09interrupt-server\0A\09\09drc-index\0A\09\09drc-name\0A\09if <value> is a drc-index or interrupt-server, it can be\0A\09specified in decimal, hex (with a leading 0x), or octal\0A\09(with a leading 0); if it is a drc-name, it should be\0A\09specified as a string in double quotes\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([395 x i8], [395 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [395 x i8] c"Usage: %s --context <x> --from <y> --to <z> <value>\0A\09--context: currently, <x> must be cpu\0A\09--from and --to: allowed values for <y> and <z>:\0A\09\09interrupt-server\0A\09\09drc-index\0A\09\09drc-name\0A\09if <value> is a drc-index or interrupt-server, it can be\0A\09specified in decimal, hex (with a leading 0x), or octal\0A\09(with a leading 0); if it is a drc-name, it should be\0A\09specified as a string in double quotes\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([395 x i8], [395 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
float __ratand(float);
float r_atand(float *x) { return (__ratand(*x)); }


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

x86 assembly (clang, -O2):
<r_atand>:
movss  (%rdi),%xmm0
jmp    1030 <__ratand@plt>

LLVM IR (-O0):
define float @r_atand(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = call float @__ratand(float %4)
ret float %5
}

LLVM IR (-O2):
define float @r_atand(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @__ratand(float %2)
ret float %3
}
void foo060(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo060(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
const char *preproc_strndup(const char *in, size_t n) {
  char *res = NULL;
  res = (char *)malloc(n + 1);
  strncpy(res, in, n);
  res[n] = '\0';
  return res;
}


x86 assembly (clang, -O0):
<preproc_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preproc_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @preproc_strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
store i8* null, i8** %5
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @strncpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %5
%15 = load i64, i64* %4
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @preproc_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %1)
%7 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %7
ret i8* %5
}
/* Variables and functions */
char *getlogin();
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  char *user;
  user = getlogin();
  puts(user);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getlogin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* (...) @getlogin()
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @puts(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @getlogin()
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_hires_timer();
void init_hires_timer__() { init_hires_timer(); }


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

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

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

LLVM IR (-O2):
define void @init_hires_timer__() {
%1 = tail call i32 (...) @init_hires_timer()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, size_t);
int /*<<< orphan*/ warn(char *);
void *xrealloc(void *ptr, size_t size) {
  void *p;
  if ((p = realloc(ptr, size)) == NULL) {
    warn("realloc");
    abort();
  }
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    116e <xrealloc+0x3e>
lea    0xe9e(%rip),%rdi
call   1040 <warn@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1050 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <warn@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"realloc\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @warn(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [8 x i8] c"realloc\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @warn(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret i8* %3
}
__attribute__((always_)) void sync$fence$R_SMP() {
  asm volatile("" ::: "memory");
}


x86 assembly (clang, -O0):
<sync$fence$R_SMP>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync$fence$R_SMP>:
ret

LLVM IR (-O0):
define void @"sync$fence$R_SMP"() {
ret void
}

LLVM IR (-O2):
define void @"sync$fence$R_SMP"() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
float add(float a, float b) { return a + b; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @add(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 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @add(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
void c_pomp_critical_end_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_critical_end_(%struct.ompregdescr* nocapture %0) {
ret void
}
/* Variables and functions */
int listnull(void *e) { return e == NULL; }


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

x86 assembly (clang, -O2):
<listnull>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @listnull(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @listnull(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fchkhdl(int /*<<< orphan*/ *);
int read(int, void *, int);
int fdfread(void *ptr, int size, int num, FILE *fp) {
  if (fchkhdl(fp))
    return (read((int)fp, ptr, size * num));
}


x86 assembly (clang, -O0):
<fdfread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <fchkhdl@plt>
cmp    $0x0,%rax
je     1162 <fdfread+0x42>
mov    -0x20(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
imul   -0x18(%rbp),%edx
call   1040 <read@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdfread>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r15
mov    %rcx,%rdi
call   1030 <fchkhdl@plt>
test   %rax,%rax
je     1158 <fdfread+0x38>
imul   %ebp,%ebx
mov    %r14d,%edi
mov    %r15,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <read@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fdfread(i8* nocapture %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i64 @fchkhdl(i32* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = ptrtoint i32* %3 to i64
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %2, %1
%11 = tail call i32 @read(i32 %9, i8* %0, i32 %10)
br label %12
12: ; preds = %7, %4
%13 = phi i32 [ %11, %7 ], [ undef, %4 ]
ret i32 %13
}
/* Variables and functions */
void *calloc(int, size_t);
void *fv_calloc(size_t size) { return calloc(1, size); }


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

x86 assembly (clang, -O2):
<fv_calloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @fv_calloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %2
}
int quadrant(a)
int a;
{ return ((a / 27) * 27 + (((a % 9) / 3) * 3)); }


x86 assembly (clang, -O0):
<quadrant>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1b,%ecx
cltd
idiv   %ecx
imul   $0x1b,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   $0x3,%ecx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadrant>:
movslq %edi,%rax
imul   $0x4bda12f7,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
lea    (%rcx,%rcx,2),%ecx
imul   $0x38e38e39,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x21,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,8),%edx
sub    %edx,%eax
movsbl %al,%edx
imul   $0x56,%edx,%edx
movzwl %dx,%edx
mov    %edx,%esi
shr    $0xf,%esi
shr    $0x8,%edx
add    %sil,%dl
movzbl %dl,%edx
lea    (%rdx,%rdx,2),%edx
sub    %al,%dl
movsbl %dl,%edx
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @quadrant(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 27
%5 = mul nsw i32 %4, 27
%6 = load i32, i32* %2
%7 = srem i32 %6, 9
%8 = sdiv i32 %7, 3
%9 = mul nsw i32 %8, 3
%10 = add nsw i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @quadrant(i32 %0) {
%2 = srem i32 %0, 27
%3 = srem i32 %0, 9
%4 = trunc i32 %3 to i8
%5 = srem i8 %4, 3
%6 = sub nsw i8 0, %5
%7 = sext i8 %6 to i32
%8 = sub i32 %0, %2
%9 = add i32 %8, %3
%10 = add i32 %9, %7
ret i32 %10
}
unsigned long long rdtsc(void) {
  unsigned a, d;
  __asm__ volatile("rdtsc" : "=a"(a), "=d"(d));
  return ((unsigned long long)a) | (((unsigned long long)d) << 32);
  ;
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc>:
rdtsc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = shl i64 %9, 32
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
ret i64 %7
}
void sti(void) { asm volatile("sti" ::: "memory", "cc"); }


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

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

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

LLVM IR (-O2):
define void @sti() {
tail call void asm sideeffect "sti", "~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef int /*<<< orphan*/ in;

/* Variables and functions */
uint16_t FROM_LE16(uint16_t in) {
  unsigned char *pin = (unsigned char *)&in;
  uint16_t out;
  int i;
  for (i = 0, out = 0; i < sizeof(in); ++i)
    out += pin[i] << (8 * i);
  return out;
}


x86 assembly (clang, -O0):
<FROM_LE16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movq   $0x0,-0x18(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x8,%rax
jae    1159 <FROM_LE16+0x59>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111f <FROM_LE16+0x1f>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @FROM_LE16(i64 %0) {
ret i64 poison
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timeval {
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
time_t get_usec(void) {
  struct timeval tmptv;
  gettimeofday(&tmptv, NULL);
  return tmptv.tv_usec;
}


x86 assembly (clang, -O0):
<get_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_usec>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @get_usec() {
%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 i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @get_usec() {
%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 i32, i32* %4
ret i32 %5
}
/* Type definitions */
struct j_state {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ i_instr_rm(struct j_state *, int /*<<< orphan*/, int,
                              int /*<<< orphan*/, int, int, int /*<<< orphan*/,
                              int);
void i_dec_m(struct j_state *s, int base, int64_t off) {
  i_instr_rm(s, 0, 0xff, 0, 1, base, off, 8);
}


x86 assembly (clang, -O0):
<i_dec_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%r9d
mov    -0x10(%rbp),%eax
xor    %ecx,%ecx
mov    $0xff,%edx
mov    $0x1,%r8d
mov    %ecx,%esi
mov    %eax,(%rsp)
movl   $0x8,0x8(%rsp)
call   1030 <i_instr_rm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_dec_m>:
push   %rax
mov    %edx,%eax
mov    %esi,%r9d
xor    %esi,%esi
mov    $0xff,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
push   $0x8
push   %rax
call   1030 <i_instr_rm@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
%struct.j_state = type { i32 }
define void @i_dec_m(%struct.j_state* %0, i32 %1, i32 %2) {
%4 = alloca %struct.j_state*
%5 = alloca i32
%6 = alloca i32
store %struct.j_state* %0, %struct.j_state** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.j_state*, %struct.j_state** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @i_instr_rm(%struct.j_state* %7, i32 0, i32 255, i32 0, i32 1, i32 %8, i32 %9, i32 8)
ret void
}

LLVM IR (-O2):
%struct.j_state = type { i32 }
define void @i_dec_m(%struct.j_state* %0, i32 %1, i32 %2) {
%4 = tail call i32 @i_instr_rm(%struct.j_state* %0, i32 0, i32 255, i32 0, i32 1, i32 %1, i32 %2, i32 8)
ret void
}
/* Variables and functions */
char *fa_malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *fa_strdup(const char *s) {
  char *ptr = NULL;
  if (s) {
    int len = strlen(s) + 1;
    ptr = fa_malloc(len);
    if (ptr)
      memcpy(ptr, s, len);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<fa_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118a <fa_strdup+0x5a>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <fa_malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1185 <fa_strdup+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
jmp    118a <fa_strdup+0x5a>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa_strdup>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1164 <fa_strdup+0x34>
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1030 <fa_malloc@plt>
test   %rax,%rax
je     1164 <fa_strdup+0x34>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <memcpy@plt>
jmp    1166 <fa_strdup+0x36>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @fa_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i8* @fa_malloc(i32 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i32 %5)
br label %10
10: ; preds = %3, %8, %1
%11 = phi i8* [ null, %1 ], [ %6, %8 ], [ null, %3 ]
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ wait(int, int);
int /*<<< orphan*/ writememb_common(scalar_t__, int /*<<< orphan*/);
void writememb(uint32_t s, uint32_t a, uint8_t v) {
  wait(4, 1);
  writememb_common(s + a, v);
}


x86 assembly (clang, -O0):
<writememb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x4,%edi
mov    $0x1,%esi
call   1040 <wait@plt>
mov    -0x8(%rbp),%rdi
add    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <writememb_common@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writememb>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    $0x4,%edi
mov    $0x1,%esi
call   1040 <wait@plt>
add    %rbx,%rbp
mov    %rbp,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <writememb_common@plt>

LLVM IR (-O0):
define void @writememb(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = call i32 @wait(i32 4, i32 1)
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = add nsw i64 %8, %9
%11 = load i32, i32* %6
%12 = call i32 @writememb_common(i64 %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @writememb(i64 %0, i64 %1, i32 %2) {
%4 = tail call i32 @wait(i32 4, i32 1)
%5 = add nsw i64 %1, %0
%6 = tail call i32 @writememb_common(i64 %5, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
void print_indent(int depth) {
  if (depth > 0) {
    printf("%*c", depth * 2, ' ');
  }
}


x86 assembly (clang, -O0):
<print_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113c <print_indent+0x2c>
mov    -0x4(%rbp),%esi
shl    $0x1,%esi
lea    0xece(%rip),%rdi
mov    $0x20,%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_indent>:
test   %edi,%edi
jle    1129 <print_indent+0x19>
mov    %edi,%esi
add    %edi,%esi
lea    0xee1(%rip),%rdi
mov    $0x20,%edx
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%*c\00"
define void @print_indent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7, i8 signext 32)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%*c\00"
define void @print_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = shl nuw nsw i32 %0, 1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4, i8 signext 32)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *program) {
  fprintf(stderr,
          "Usage: %s [-q] [-c|-a|-p] [-sd <snapdenom>] [-er <expansion rate>] "
          "[-o <outfile>] <table> <infile> ...\n"
          "       %s -h\n",
          program, program);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
mov    %rcx,%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [117 x i8] c"Usage: %s [-q] [-c|-a|-p] [-sd <snapdenom>] [-er <expansion rate>] [-o <outfile>] <table> <infile> ...\0A %s -h\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 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [117 x i8] c"Usage: %s [-q] [-c|-a|-p] [-sd <snapdenom>] [-er <expansion rate>] [-o <outfile>] <table> <infile> ...\0A %s -h\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
void mk20dx256_uart0_put_char(unsigned char c) {
  while (!(*((volatile unsigned char *)0x4006A004) & (1 << 7)))
    ;
  *((volatile unsigned char *)0x4006A007) = c;
}


x86 assembly (clang, -O0):
<mk20dx256_uart0_put_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x4006a004,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112e <mk20dx256_uart0_put_char+0x2e>
jmp    1133 <mk20dx256_uart0_put_char+0x33>
jmp    110a <mk20dx256_uart0_put_char+0xa>
mov    -0x1(%rbp),%cl
mov    $0x4006a007,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk20dx256_uart0_put_char>:
cmpb   $0x0,0x4006a004
jns    1100 <mk20dx256_uart0_put_char>
mov    %dil,0x4006a007
40
ret

LLVM IR (-O0):
define void @mk20dx256_uart0_put_char(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %9, %1
%4 = load volatile i8, i8* inttoptr (i64 1074176004 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i8, i8* %2
store volatile i8 %11, i8* inttoptr (i64 1074176007 to i8*)
ret void
}

LLVM IR (-O2):
define void @mk20dx256_uart0_put_char(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i8, i8* inttoptr (i64 1074176004 to i8*)
%4 = icmp sgt i8 %3, -1
br i1 %4, label %2, label %5
5: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 1074176007 to i8*)
ret void
}
/* Type definitions */
struct usbDevice {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int compareDevice(struct device *, struct device *);
int usbCompareDevice(struct usbDevice *dev1, struct usbDevice *dev2) {
  if (!dev1 || !dev2)
    return 1;
  return compareDevice((struct device *)dev1, (struct device *)dev2);
}


x86 assembly (clang, -O0):
<usbCompareDevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <usbCompareDevice+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <usbCompareDevice+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1152 <usbCompareDevice+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <compareDevice@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usbCompareDevice>:
test   %rdi,%rdi
je     111f <usbCompareDevice+0xf>
test   %rsi,%rsi
je     111f <usbCompareDevice+0xf>
jmp    1030 <compareDevice@plt>
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.usbDevice = type { i32 }
%struct.device = type { i32 }
define i32 @usbCompareDevice(%struct.usbDevice* %0, %struct.usbDevice* %1) {
%3 = alloca i32
%4 = alloca %struct.usbDevice*
%5 = alloca %struct.usbDevice*
store %struct.usbDevice* %0, %struct.usbDevice** %4
store %struct.usbDevice* %1, %struct.usbDevice** %5
%6 = load %struct.usbDevice*, %struct.usbDevice** %4
%7 = icmp ne %struct.usbDevice* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load %struct.usbDevice*, %struct.usbDevice** %5
%10 = icmp ne %struct.usbDevice* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i32 1, i32* %3
br label %18
12: ; preds = %8
%13 = load %struct.usbDevice*, %struct.usbDevice** %4
%14 = bitcast %struct.usbDevice* %13 to %struct.device*
%15 = load %struct.usbDevice*, %struct.usbDevice** %5
%16 = bitcast %struct.usbDevice* %15 to %struct.device*
%17 = call i32 @compareDevice(%struct.device* %14, %struct.device* %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %12, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.usbDevice = type { i32 }
%struct.device = type { i32 }
define i32 @usbCompareDevice(%struct.usbDevice* %0, %struct.usbDevice* %1) {
%3 = icmp ne %struct.usbDevice* %0, null
%4 = icmp ne %struct.usbDevice* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = bitcast %struct.usbDevice* %0 to %struct.device*
%8 = bitcast %struct.usbDevice* %1 to %struct.device*
%9 = tail call i32 @compareDevice(%struct.device* %7, %struct.device* %8)
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ roman_to_dec(char *);
int main(int argc, char **argv) {
  roman_to_dec(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <roman_to_dec@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <roman_to_dec@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @roman_to_dec(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @roman_to_dec(i8* %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ SIG_ERR;
int /*<<< orphan*/ SIG_IGN;
scalar_t__ signal(int, int /*<<< orphan*/);
int sigignore(int sig) { return (signal(sig, SIG_IGN) == SIG_ERR ? -1 : 0); }


x86 assembly (clang, -O0):
<sigignore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    %rax,%rdx
mov    0x2ea2(%rip),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigignore>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2eb2(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
define i32 @sigignore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIG_IGN
%5 = call i64 @signal(i32 %3, i32 %4)
%6 = load i64, i64* @SIG_ERR
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -1, i32 0
ret i32 %9
}

LLVM IR (-O2):
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
define i32 @sigignore(i32 %0) {
%2 = load i32, i32* @SIG_IGN
%3 = tail call i64 @signal(i32 %0, i32 %2)
%4 = load i64, i64* @SIG_ERR
%5 = icmp eq i64 %3, %4
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ is_lowercase(char);
scalar_t__ is_uppercase(char);
int is_alphabetic(char c) { return is_lowercase(c) || is_uppercase(c); }


x86 assembly (clang, -O0):
<is_alphabetic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <is_lowercase@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <is_alphabetic+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <is_uppercase@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alphabetic>:
push   %rbx
mov    %edi,%ebx
call   1040 <is_lowercase@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <is_alphabetic+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <is_uppercase@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_alphabetic(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @is_lowercase(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @is_uppercase(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_alphabetic(i8 signext %0) {
%2 = tail call i64 @is_lowercase(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_uppercase(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
const char node_closing_tag(char tag) {
  switch (tag) {
  case '"':
    return '"';
  case '{':
    return '}';
  case '[':
    return ']';
  default:
    return ',';
  }
}


x86 assembly (clang, -O0):
<node_closing_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x22,%eax
je     1141 <node_closing_tag+0x41>
jmp    111f <node_closing_tag+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x5b,%eax
je     1153 <node_closing_tag+0x53>
jmp    1130 <node_closing_tag+0x30>
mov    -0x8(%rbp),%eax
sub    $0x7b,%eax
je     114a <node_closing_tag+0x4a>
jmp    115c <node_closing_tag+0x5c>
movb   $0x22,-0x1(%rbp)
jmp    1160 <node_closing_tag+0x60>
movb   $0x7d,-0x1(%rbp)
jmp    1160 <node_closing_tag+0x60>
movb   $0x5d,-0x1(%rbp)
jmp    1160 <node_closing_tag+0x60>
movb   $0x2c,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<node_closing_tag>:
cmp    $0x22,%edi
je     1112 <node_closing_tag+0x12>
cmp    $0x5b,%edi
je     1115 <node_closing_tag+0x15>
cmp    $0x7b,%edi
jne    1118 <node_closing_tag+0x18>
mov    $0x7d,%al
ret
mov    $0x22,%al
ret
mov    $0x5d,%al
ret
mov    $0x2c,%al
ret

LLVM IR (-O0):
define signext i8 @node_closing_tag(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 34, label %6
i32 123, label %7
i32 91, label %8
]
6: ; preds = %1
store i8 34, i8* %2
br label %10
7: ; preds = %1
store i8 125, i8* %2
br label %10
8: ; preds = %1
store i8 93, i8* %2
br label %10
9: ; preds = %1
store i8 44, i8* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @node_closing_tag(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 34, label %6
i32 123, label %3
i32 91, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i8 [ 44, %5 ], [ 93, %4 ], [ 125, %3 ], [ 34, %1 ]
ret i8 %7
}
int getMax(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<getMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <getMax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <getMax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @getMax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @getMax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
float toupper(char const);
int isHexDigit(const char digito) {
  return (toupper(digito) >= 'A' && toupper(digito) <= 'F') ||
         (digito >= '0' && digito <= '9');
}


x86 assembly (clang, -O0):
<isHexDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
movss  0xed1(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     115a <isHexDigit+0x4a>
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
movaps %xmm0,%xmm1
mov    $0x1,%al
movss  0xeb6(%rip),%xmm0
ucomiss %xmm1,%xmm0
mov    %al,-0x2(%rbp)
jae    117f <isHexDigit+0x6f>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x3(%rbp)
jl     1179 <isHexDigit+0x69>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%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
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isHexDigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <toupper@plt>
ucomiss 0xee1(%rip),%xmm0
jb     113b <isHexDigit+0x2b>
movsbl %bl,%edi
call   1030 <toupper@plt>
mov    $0x1,%eax
movss  0xece(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    1146 <isHexDigit+0x36>
lea    -0x30(%rbx),%ecx
xor    %eax,%eax
cmp    $0xa,%cl
setb   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isHexDigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call float @toupper(i8 signext %3)
%5 = fcmp oge float %4, 6.500000e+01
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call float @toupper(i8 signext %7)
%9 = fcmp ole float %8, 7.000000e+01
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, 48
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, 57
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 @isHexDigit(i8 signext %0) {
%2 = tail call float @toupper(i8 signext %0)
%3 = fcmp ult float %2, 6.500000e+01
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call float @toupper(i8 signext %0)
%6 = fcmp ugt float %5, 7.000000e+01
br i1 %6, label %7, label %11
7: ; preds = %4, %1
%8 = add i8 %0, -48
%9 = icmp ult i8 %8, 10
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
RCU_DEF_INIT_FUNC(user_m1_destroy, param) {}


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

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

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

LLVM IR (-O2):
define i32 @RCU_DEF_INIT_FUNC(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test5_f();
void test5_foo(void) { test5_f(); }


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

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

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

LLVM IR (-O2):
define void @test5_foo() {
%1 = tail call i32 (...) @test5_f()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int /*<<< orphan*/ rtems_test_exit(int /*<<< orphan*/);
void force_error() {
  printk("*** END OF TEST FATAL "
         "16"
         " ***\n");
  rtems_test_exit(0);
}


x86 assembly (clang, -O0):
<force_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printk@plt>
xor    %edi,%edi
call   1040 <rtems_test_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<force_error>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printk@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <rtems_test_exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"*** END OF TEST FATAL 16 ***\0A\00"
define void @force_error() {
%1 = call i32 @printk(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @rtems_test_exit(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"*** END OF TEST FATAL 16 ***\0A\00"
define void @force_error() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @rtems_test_exit(i32 0)
ret void
}