xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage_and_exit(const char *binname) {
  fprintf(stderr,
          "Usage: %s [-v] [-f] [-c <commentfn>] [-b <bootsectorfn>] -o "
          "<output-izo-name> <path-to-walk>\n",
          binname);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [94 x i8] c"Usage: %s [-v] [-f] [-c <commentfn>] [-b <bootsectorfn>] -o <output-izo-name> <path-to-walk>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage_and_exit(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 ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [94 x i8] c"Usage: %s [-v] [-f] [-c <commentfn>] [-b <bootsectorfn>] -o <output-izo-name> <path-to-walk>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage_and_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ check_vect();
int main() {
  check_vect();
  bar();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 (...) @bar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char str_a[20];
  printf("Breakpoint\n");
  strcpy(str_a, "Hello world!\n");
  printf(str_a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb8(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Breakpoint\0A\00"
@.str.1 = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Hello world!\0A\00"
@str = [11 x i8] c"Breakpoint\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* %2)
ret i32 0
}
/* Type definitions */
struct mem_block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mem_block_footer_btag(struct mem_block *);
int /*<<< orphan*/ mem_block_header_btag(struct mem_block *);
int /*<<< orphan*/ mem_btag_init(int /*<<< orphan*/, size_t);
void mem_block_init(struct mem_block *block, size_t size) {
  mem_btag_init(mem_block_header_btag(block), size);
  mem_btag_init(mem_block_footer_btag(block), size);
}


x86 assembly (clang, -O0):
<mem_block_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <mem_block_header_btag@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <mem_btag_init@plt>
mov    -0x8(%rbp),%rdi
call   1030 <mem_block_footer_btag@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <mem_btag_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_block_init>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <mem_block_header_btag@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1040 <mem_btag_init@plt>
mov    %rbx,%rdi
call   1030 <mem_block_footer_btag@plt>
mov    %eax,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <mem_btag_init@plt>

LLVM IR (-O0):
%struct.mem_block = type { i32 }
define void @mem_block_init(%struct.mem_block* %0, i64 %1) {
%3 = alloca %struct.mem_block*
%4 = alloca i64
store %struct.mem_block* %0, %struct.mem_block** %3
store i64 %1, i64* %4
%5 = load %struct.mem_block*, %struct.mem_block** %3
%6 = call i32 @mem_block_header_btag(%struct.mem_block* %5)
%7 = load i64, i64* %4
%8 = call i32 @mem_btag_init(i32 %6, i64 %7)
%9 = load %struct.mem_block*, %struct.mem_block** %3
%10 = call i32 @mem_block_footer_btag(%struct.mem_block* %9)
%11 = load i64, i64* %4
%12 = call i32 @mem_btag_init(i32 %10, i64 %11)
ret void
}

LLVM IR (-O2):
%struct.mem_block = type { i32 }
define void @mem_block_init(%struct.mem_block* %0, i64 %1) {
%3 = tail call i32 @mem_block_header_btag(%struct.mem_block* %0)
%4 = tail call i32 @mem_btag_init(i32 %3, i64 %1)
%5 = tail call i32 @mem_block_footer_btag(%struct.mem_block* %0)
%6 = tail call i32 @mem_btag_init(i32 %5, i64 %1)
ret void
}
float f2(float x, short y) { return x * y; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
movss  %xmm0,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movss  -0x4(%rbp),%xmm0
movswl -0x6(%rbp),%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
cvtsi2ss %edi,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f2(float %0, i16 signext %1) {
%3 = alloca float
%4 = alloca i16
store float %0, float* %3
store i16 %1, i16* %4
%5 = load float, float* %3
%6 = load i16, i16* %4
%7 = sext i16 %6 to i32
%8 = sitofp i32 %7 to float
%9 = fmul float %5, %8
ret float %9
}

LLVM IR (-O2):
define float @f2(float %0, i16 signext %1) {
%3 = sitofp i16 %1 to float
%4 = fmul float %3, %0
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
scalar_t__ S_ISLNK(int /*<<< orphan*/);
char const *inotype(int /*<<< orphan*/);
const char *inode_type(mode_t mode) {
  if (S_ISLNK(mode))
    return ("symlink");
  return (inotype(mode));
}


x86 assembly (clang, -O0):
<inode_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x0,%rax
je     114d <inode_type+0x2d>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <inode_type+0x39>
mov    -0xc(%rbp),%edi
call   1040 <inotype@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inode_type>:
push   %rbx
mov    %edi,%ebx
call   1030 <S_ISLNK@plt>
test   %rax,%rax
je     1136 <inode_type+0x16>
lea    0xecc(%rip),%rax
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1040 <inotype@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"symlink\00"
define i8* @inode_type(i32 %0) {
%2 = tail call i64 @S_ISLNK(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @inotype(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %7
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
long long Timespec_to_msec(struct timespec x) {
  return (((long long int)x.tv_sec) * 1000 +
          ((long long int)x.tv_nsec) / 1000 / 1000);
}


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

x86 assembly (clang, -O2):
<Timespec_to_msec>:
mov    %rdi,%rax
imul   $0x3e8,%rsi,%rcx
movabs $0x431bde82d7b634db,%rdx
de 1b 43
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x12,%rdx
add    %rdx,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @Timespec_to_msec(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 1
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%11 = load i64, i64* %10
%12 = sdiv i64 %11, 1000
%13 = sdiv i64 %12, 1000
%14 = add nsw i64 %9, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @Timespec_to_msec(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, 1000
%4 = sdiv i64 %0, 1000000
%5 = add nsw i64 %3, %4
ret i64 %5
}
/* Variables and functions */
double cos(double);
double sin(double);
double f2(double x) { return x * sin(x) + cos(x); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x18(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @sin(double %4)
%6 = load double, double* %2
%7 = call double @cos(double %6)
%8 = call double @llvm.fmuladd.f64(double %3, double %5, double %7)
ret double %8
}

LLVM IR (-O2):
define double @f2(double %0) {
%2 = tail call double @sin(double %0)
%3 = tail call double @cos(double %0)
%4 = tail call double @llvm.fmuladd.f64(double %0, double %2, double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ dyad_panic(char *);
void *realloc(void *, int);
void *dyad_realloc(void *ptr, int n) {
  ptr = realloc(ptr, n);
  if (!ptr && n != 0) {
    dyad_panic("out of memory");
  }
  return ptr;
}


x86 assembly (clang, -O0):
<dyad_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1160 <dyad_realloc+0x40>
cmpl   $0x0,-0xc(%rbp)
je     1160 <dyad_realloc+0x40>
lea    0xea5(%rip),%rdi
call   1030 <dyad_panic@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dyad_realloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
je     1142 <dyad_realloc+0x22>
test   %rbx,%rbx
jne    1142 <dyad_realloc+0x22>
lea    0xec3(%rip),%rdi
call   1030 <dyad_panic@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @dyad_realloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i32 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @dyad_panic(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i8* %3
}
int switch_eg(int x, int n) {
  int result = x;
  switch (n) {
  case 100:
    result *= 13;
    break;
  case 102:
    result += 10;
  case 103:
    result += 11;
    break;
  case 104:
  case 106:
    result *= result;
    break;
  default:
    result = 0;
  };
  return result;
}


x86 assembly (clang, -O0):
<switch_eg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff9c,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x6,%eax
ja     116b <switch_eg+0x6b>
mov    -0x18(%rbp),%rax
lea    0xed0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
imul   $0xd,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1172 <switch_eg+0x72>
mov    -0xc(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xb,%eax
mov    %eax,-0xc(%rbp)
jmp    1172 <switch_eg+0x72>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1172 <switch_eg+0x72>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_eg>:
xor    %eax,%eax
add    $0xffffff9c,%esi
cmp    $0x6,%esi
ja     112e <switch_eg+0x2e>
lea    0xeef(%rip),%rcx
movslq (%rcx,%rsi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
imul   %edi,%edi
jmp    112c <switch_eg+0x2c>
lea    (%rdi,%rdi,2),%eax
lea    (%rdi,%rax,4),%eax
ret
add    $0xa,%edi
add    $0xb,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @switch_eg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %4
switch i32 %7, label %21 [
i32 100, label %8
i32 102, label %11
i32 103, label %14
i32 104, label %17
i32 106, label %17
]
8: ; preds = %2
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 13
store i32 %10, i32* %5
br label %22
11: ; preds = %2
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 10
store i32 %13, i32* %5
br label %14
14: ; preds = %2, %11
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 11
store i32 %16, i32* %5
br label %22
17: ; preds = %2, %2
%18 = load i32, i32* %5
%19 = load i32, i32* %5
%20 = mul nsw i32 %19, %18
store i32 %20, i32* %5
br label %22
21: ; preds = %2
store i32 0, i32* %5
br label %22
22: ; preds = %21, %17, %14, %8
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @switch_eg(i32 %0, i32 %1) {
switch i32 %1, label %12 [
i32 100, label %3
i32 102, label %5
i32 103, label %7
i32 104, label %10
i32 106, label %10
]
3: ; preds = %2
%4 = mul nsw i32 %0, 13
br label %12
5: ; preds = %2
%6 = add nsw i32 %0, 10
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %0, %2 ], [ %6, %5 ]
%9 = add nsw i32 %8, 11
br label %12
10: ; preds = %2, %2
%11 = mul nsw i32 %0, %0
br label %12
12: ; preds = %2, %10, %7, %3
%13 = phi i32 [ %11, %10 ], [ %9, %7 ], [ %4, %3 ], [ 0, %2 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo(void) {
  int a = 41;
  a = a++;
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x29,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0xee9(%rip),%rdi
mov    $0x29,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @foo() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 41)
ret void
}
int compare_ints(const void *p, const void *q) {
  int x = *(const int *)p;
  int y = *(const int *)q;
  int ret;
  if (x == y) {
    ret = 0;
  } else {
    ret = (x < y) ? -1 : 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<compare_ints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1136 <compare_ints+0x36>
movl   $0x0,-0x1c(%rbp)
jmp    114e <compare_ints+0x4e>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ints>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_ints(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 0, i32* %7
br label %24
18: ; preds = %2
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = icmp slt i32 %19, %20
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 -1, i32 1
store i32 %23, i32* %7
br label %24
24: ; preds = %18, %17
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare_ints(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
int main(int argc, char **argv) {
  int i;
  i = 1;
  if (argc > 0) {
    while (argv[i] != '\0') {
      ft_putstr(argv[i]);
      ft_putchar('\n');
      i++;
    }
  }
  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)
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1191 <main+0x71>
jmp    114c <main+0x2c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     118c <main+0x6c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <ft_putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <main+0x2c>
jmp    1191 <main+0x71>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
test   %edi,%edi
jle    115f <main+0x3f>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     115f <main+0x3f>
add    $0x10,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
xor    %eax,%eax
call   1030 <ft_putchar@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %17, label %8
8: ; preds = %4, %8
%9 = phi i64 [ %13, %8 ], [ 1, %4 ]
%10 = phi i8* [ %15, %8 ], [ %6, %4 ]
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ft_putstr to i32 (i8*, ...)*)(i8* %10)
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @ft_putchar to i32 (i32, ...)*)(i32 10)
%13 = add nuw i64 %9, 1
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %8
17: ; preds = %8, %4, %2
ret i32 0
}
int main() {
  int i = 1;
  int temp1 = i--;
  int temp2 = i++;
  return temp1 + temp2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
unsigned short g2(unsigned short *p, int i) { return p[i]; }


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2>:
movslq %esi,%rax
movzwl (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define zeroext i16 @g2(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%5 = load i16*, i16** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i16, i16* %5, i64 %7
%9 = load i16, i16* %8
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @g2(i16* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i16, i16* %0, i64 %3
%5 = load i16, i16* %4
ret i16 %5
}
__attribute__((always_)) int irq_can_set_affinity(unsigned int irq) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @irq_can_set_affinity(i32 %0) {
ret i32 0
}
void getRidOfLNK4221_256() {}


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

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

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

LLVM IR (-O2):
define void @getRidOfLNK4221_256() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __CCAPRICE_FDOLOCK(int /*<<< orphan*/ *);
int /*<<< orphan*/ __CCAPRICE_FUNLOCK(int /*<<< orphan*/ *);
int /*<<< orphan*/ __ccaprice_ftellu(int /*<<< orphan*/ *);
off_t __ccaprice_ftell(FILE *fp) {
  off_t pos;
  __CCAPRICE_FDOLOCK(fp);
  pos = __ccaprice_ftellu(fp);
  __CCAPRICE_FUNLOCK(fp);
  return pos;
}


x86 assembly (clang, -O0):
<__ccaprice_ftell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__CCAPRICE_FDOLOCK@plt>
mov    -0x8(%rbp),%rdi
call   1050 <__ccaprice_ftellu@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__CCAPRICE_FUNLOCK@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ccaprice_ftell>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <__CCAPRICE_FDOLOCK@plt>
mov    %rbx,%rdi
call   1050 <__ccaprice_ftellu@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <__CCAPRICE_FUNLOCK@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__ccaprice_ftell(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @__CCAPRICE_FDOLOCK(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @__ccaprice_ftellu(i32* %6)
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = call i32 @__CCAPRICE_FUNLOCK(i32* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @__ccaprice_ftell(i32* %0) {
%2 = tail call i32 @__CCAPRICE_FDOLOCK(i32* %0)
%3 = tail call i32 @__ccaprice_ftellu(i32* %0)
%4 = tail call i32 @__CCAPRICE_FUNLOCK(i32* %0)
ret i32 %3
}
int PCSC_InitializeSCardApi_Link(void) {
  int status = -1;
  return -1;
  return status;
}


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

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

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

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

/* Variables and functions */
int htonl(int);
uint64_t ntohll(uint64_t id) {
  int num = 42;
  if (*(char *)&num == 42) {
    uint32_t high_part = htonl((uint32_t)(id >> 32));
    uint32_t low_part = htonl((uint32_t)(id & 0xFFFFFFFFLL));
    return ((((uint64_t)low_part) << 32) | high_part);
  } else {
    return id;
  }
}


x86 assembly (clang, -O0):
<ntohll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x2a,-0xc(%rbp)
movsbl -0xc(%rbp),%eax
cmp    $0x2a,%eax
jne    1171 <ntohll+0x61>
mov    -0x8(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <htonl@plt>
mov    %eax,-0x10(%rbp)
movslq -0x8(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,%edi
call   1030 <htonl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <ntohll+0x67>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohll>:
push   %rbx
mov    %edi,%ebx
call   1030 <htonl@plt>
mov    %ebx,%edi
call   1030 <htonl@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ntohll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 42, i32* %4
%7 = bitcast i32* %4 to i8*
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 42
br i1 %10, label %11, label %24
11: ; preds = %1
%12 = load i32, i32* %3
%13 = ashr i32 %12, 32
%14 = call i32 @htonl(i32 %13)
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = and i64 %16, 4294967295
%18 = trunc i64 %17 to i32
%19 = call i32 @htonl(i32 %18)
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = shl i32 %20, 32
%22 = load i32, i32* %5
%23 = or i32 %21, %22
store i32 %23, i32* %2
br label %26
24: ; preds = %1
%25 = load i32, i32* %3
store i32 %25, i32* %2
br label %26
26: ; preds = %24, %11
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @ntohll(i32 returned %0) {
%2 = tail call i32 @htonl(i32 poison)
%3 = tail call i32 @htonl(i32 %0)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ Car_Get(int);
int /*<<< orphan*/ Car_GetAxles(int /*<<< orphan*/, int);
int Car_GetAxlesSpace(int /*<<< orphan*/);
int Car_GetCarAxlesSpace(int carnum, int i) {
  return Car_GetAxlesSpace(Car_GetAxles(Car_Get(carnum), i));
}


x86 assembly (clang, -O0):
<Car_GetCarAxlesSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <Car_Get@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1050 <Car_GetAxles@plt>
mov    %eax,%edi
call   1030 <Car_GetAxlesSpace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Car_GetCarAxlesSpace>:
push   %rbx
mov    %esi,%ebx
call   1040 <Car_Get@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1050 <Car_GetAxles@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <Car_GetAxlesSpace@plt>

LLVM IR (-O0):
define i32 @Car_GetCarAxlesSpace(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 = call i32 @Car_Get(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @Car_GetAxles(i32 %6, i32 %7)
%9 = call i32 @Car_GetAxlesSpace(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @Car_GetCarAxlesSpace(i32 %0, i32 %1) {
%3 = tail call i32 @Car_Get(i32 %0)
%4 = tail call i32 @Car_GetAxles(i32 %3, i32 %1)
%5 = tail call i32 @Car_GetAxlesSpace(i32 %4)
ret i32 %5
}
unsigned xrop3_47_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S | stk3;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_47_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_47_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
lea    -0x100(%rdi),%eax
and    %edx,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_47_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = xor i32 %31, -1
store i32 %32, i32* %8
%33 = load i32, i32* %8
%34 = load i32, i32* %6
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_47_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %3, -256
%8 = and i32 %6, %7
%9 = or i32 %8, %4
%10 = xor i32 %9, -1
%11 = or i32 %10, %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int setbits(int, int, int, int);
main() {
  int a = setbits(255, 0, 4, 0);
  printf("%d\n", a);
  int b = setbits(1, 1, 3, 4);
  printf("%d\n", b);
  int c = setbits(218, 2, 4, 9);
  printf("%d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xff,%edi
xor    %ecx,%ecx
mov    $0x4,%edx
mov    %ecx,%esi
call   1040 <setbits@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    %esi,%edi
call   1040 <setbits@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    $0xda,%edi
mov    $0x2,%esi
mov    $0x4,%edx
mov    $0x9,%ecx
call   1040 <setbits@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xff,%edi
xor    %esi,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <setbits@plt>
lea    0xec5(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1040 <setbits@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xda,%edi
mov    $0x2,%esi
mov    $0x4,%edx
mov    $0x9,%ecx
call   1040 <setbits@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @setbits(i32 255, i32 0, i32 4, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @setbits(i32 1, i32 1, i32 3, i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @setbits(i32 218, i32 2, i32 4, i32 9)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned long thread_id_function(void) {
  return ((unsigned long)pthread_self());
}


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

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

LLVM IR (-O0):
define i64 @thread_id_function() {
%1 = call i64 (...) @pthread_self()
ret i64 %1
}

LLVM IR (-O2):
define i64 @thread_id_function() {
%1 = tail call i64 (...) @pthread_self()
ret i64 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
int _EPIIntNumberGet(int);
void EPIIntUnregister(uint32_t ui32Base) {
  uint32_t ui32Int;
  ASSERT(ui32Base == 0x400D0000);
  ui32Int = _EPIIntNumberGet(ui32Base);
  ASSERT(ui32Int != 0);
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<EPIIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x400d0000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <ASSERT@plt>
mov    -0x4(%rbp),%edi
call   1030 <_EPIIntNumberGet@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <ASSERT@plt>
mov    -0x8(%rbp),%edi
call   1040 <IntDisable@plt>
mov    -0x8(%rbp),%edi
call   1060 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIIntUnregister>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x400d0000,%ebx
sete   %dil
call   1050 <ASSERT@plt>
mov    %ebx,%edi
call   1030 <_EPIIntNumberGet@plt>
mov    %eax,%ebx
xor    %edi,%edi
test   %eax,%eax
setne  %dil
call   1050 <ASSERT@plt>
mov    %ebx,%edi
call   1040 <IntDisable@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <IntUnregister@plt>

LLVM IR (-O0):
define void @EPIIntUnregister(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1074593792
%6 = zext i1 %5 to i32
%7 = call i32 @ASSERT(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @_EPIIntNumberGet(i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %3
%15 = call i32 @IntDisable(i32 %14)
%16 = load i32, i32* %3
%17 = call i32 @IntUnregister(i32 %16)
ret void
}

LLVM IR (-O2):
define void @EPIIntUnregister(i32 %0) {
%2 = icmp eq i32 %0, 1074593792
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = tail call i32 @_EPIIntNumberGet(i32 %0)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = tail call i32 @IntDisable(i32 %5)
%10 = tail call i32 @IntUnregister(i32 %5)
ret void
}
/* Variables and functions */
char *gumbo_alloc(size_t const);
char *memcpy(char *, char const *, size_t const);
int strlen(char const *);
char *gumbo_strdup(const char *str) {
  const size_t size = strlen(str) + 1;
  char *buffer = gumbo_alloc(size);
  return memcpy(buffer, str, size);
}


x86 assembly (clang, -O0):
<gumbo_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <gumbo_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gumbo_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
call   1040 <gumbo_alloc@plt>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <memcpy@plt>

LLVM IR (-O0):
define i8* @gumbo_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @gumbo_alloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i8* @memcpy(i8* %11, i8* %12, i64 %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @gumbo_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @gumbo_alloc(i64 %4)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %5, i8* align 1 %0, i64 %4, i1 false)
ret i8* %5
}
int xfuse_check_wait_objs(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xfuse_check_wait_objs() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void file_char_stream_free(void *_self_data) {
  FILE *self_data = _self_data;
  fclose(self_data);
}


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

x86 assembly (clang, -O2):
<file_char_stream_free>:
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define void @file_char_stream_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fclose(i32* %6)
ret void
}

LLVM IR (-O2):
define void @file_char_stream_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
scalar_t__ rand();
float rand_float(float min, float max) {
  max -= min - 1;
  return ((float)rand() / ((float)32768 / (float)max)) + min;
}


x86 assembly (clang, -O0):
<rand_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xed5(%rip),%xmm0
subss  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
movss  0xeab(%rip),%xmm1
divss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
addss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_float>:
push   %rax
movss  %xmm0,0x4(%rsp)
movss  0xee1(%rip),%xmm2
addss  %xmm0,%xmm2
subss  %xmm2,%xmm1
movss  %xmm1,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  0xec1(%rip),%xmm1
divss  (%rsp),%xmm1
divss  %xmm1,%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rand_float(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 = fsub float %5, 1.000000e+00
%7 = load float, float* %4
%8 = fsub float %7, %6
store float %8, float* %4
%9 = call i64 (...) @rand()
%10 = sitofp i64 %9 to float
%11 = load float, float* %4
%12 = fdiv float 3.276800e+04, %11
%13 = fdiv float %10, %12
%14 = load float, float* %3
%15 = fadd float %13, %14
ret float %15
}

LLVM IR (-O2):
define float @rand_float(float %0, float %1) {
%3 = fadd float %0, -1.000000e+00
%4 = fsub float %1, %3
%5 = tail call i64 (...) @rand()
%6 = sitofp i64 %5 to float
%7 = fdiv float 3.276800e+04, %4
%8 = fdiv float %6, %7
%9 = fadd float %8, %0
ret float %9
}
/* Variables and functions */
scalar_t__ PPCMMU(int, void *, void *, int /*<<< orphan*/);
void *MmuAllocVsid(int vsid, int mask) {
  return (void *)PPCMMU(0x10a, (void *)vsid, (void *)mask, 0);
}


x86 assembly (clang, -O0):
<MmuAllocVsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rsi
movslq -0x8(%rbp),%rdx
mov    $0x10a,%edi
xor    %ecx,%ecx
call   1030 <PPCMMU@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MmuAllocVsid>:
movslq %edi,%rax
movslq %esi,%rdx
mov    $0x10a,%edi
mov    %rax,%rsi
xor    %ecx,%ecx
jmp    1030 <PPCMMU@plt>

LLVM IR (-O0):
define i8* @MmuAllocVsid(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 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i64 @PPCMMU(i32 266, i8* %7, i8* %10, i32 0)
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
define i8* @MmuAllocVsid(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i8*
%5 = sext i32 %1 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @PPCMMU(i32 266, i8* %4, i8* %6, i32 0)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
void xSysTickEnable(void) {
  (*((volatile unsigned long *)(0xE000E010))) |= 0x00000004 | 0x00000001;
}


x86 assembly (clang, -O0):
<xSysTickEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e010,%eax
mov    (%rax),%rcx
or     $0x5,%rcx
mov    $0xe000e010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xSysTickEnable>:
mov    $0xe000e010,%eax
orq    $0x5,(%rax)
ret

LLVM IR (-O0):
define void @xSysTickEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = or i64 %1, 5
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
ret void
}

LLVM IR (-O2):
define void @xSysTickEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = or i64 %1, 5
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
ret void
}