xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
char n_to_base(int n) {
  char base;
  switch (n) {
  case 1:
    base = 'A';
    break;
  case 2:
    base = 'C';
    break;
  case 3:
    base = 'G';
    break;
  case 4:
    base = 'T';
    break;
  case 5:
    base = 'N';
    break;
  default:
    printf("Error: unknown n %d\n", n);
    exit(3);
    break;
  }
  return base;
}


x86 assembly (clang, -O0):
<n_to_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     1181 <n_to_base+0x61>
mov    -0x10(%rbp),%rax
lea    0xeb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x41,-0x5(%rbp)
jmp    119a <n_to_base+0x7a>
movb   $0x43,-0x5(%rbp)
jmp    119a <n_to_base+0x7a>
movb   $0x47,-0x5(%rbp)
jmp    119a <n_to_base+0x7a>
movb   $0x54,-0x5(%rbp)
jmp    119a <n_to_base+0x7a>
movb   $0x4e,-0x5(%rbp)
jmp    119a <n_to_base+0x7a>
mov    -0x4(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_to_base>:
mov    %edi,%esi
lea    -0x1(%rsi),%ecx
cmp    $0x5,%ecx
jae    113b <n_to_base+0x1b>
shl    $0x3,%ecx
movabs $0x4e54474341,%rax
shr    %cl,%rax
ret
push   %rax
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Error: unknown n %d\0A\00"
define signext i8 @n_to_base(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %10 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
]
5: ; preds = %1
store i8 65, i8* %3
br label %14
6: ; preds = %1
store i8 67, i8* %3
br label %14
7: ; preds = %1
store i8 71, i8* %3
br label %14
8: ; preds = %1
store i8 84, i8* %3
br label %14
9: ; preds = %1
store i8 78, i8* %3
br label %14
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 3)
unreachable
14: ; preds = %9, %8, %7, %6, %5
%15 = load i8, i8* %3
ret i8 %15
}

LLVM IR (-O2):
@.str = [21 x i8] c"Error: unknown n %d\0A\00"
define signext i8 @n_to_base(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 5
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @exit(i32 3)
unreachable
7: ; preds = %1
%8 = zext i32 %2 to i40
%9 = shl nuw nsw i40 %8, 3
%10 = lshr i40 336421405505, %9
%11 = trunc i40 %10 to i8
ret i8 %11
}
/* Variables and functions */
bool nrf51_errata_57(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_57() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_mov32(int, int);
void gen_op_pack_f32_32(int dest, int src) { gen_op_mov32(dest, src); }


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

x86 assembly (clang, -O2):
<gen_op_pack_f32_32>:
jmp    1030 <gen_op_mov32@plt>

LLVM IR (-O0):
define void @gen_op_pack_f32_32(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 = call i32 @gen_op_mov32(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @gen_op_pack_f32_32(i32 %0, i32 %1) {
%3 = tail call i32 @gen_op_mov32(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
size_t BonRoundUp(size_t value, size_t multiple) {
  if (multiple == 0) {
    return value;
  } else {
    const size_t remainder = value % multiple;
    if (remainder == 0)
      return value;
    return value + multiple - remainder;
  }
}


x86 assembly (clang, -O0):
<BonRoundUp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1124 <BonRoundUp+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115c <BonRoundUp+0x5c>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114c <BonRoundUp+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115c <BonRoundUp+0x5c>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BonRoundUp>:
test   %rsi,%rsi
je     112e <BonRoundUp+0x2e>
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     111b <BonRoundUp+0x1b>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
jmp    1121 <BonRoundUp+0x21>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
add    %rdi,%rsi
sub    %rdx,%rsi
test   %rdx,%rdx
cmovne %rsi,%rdi
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @BonRoundUp(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = urem i64 %0, %1
%6 = icmp eq i64 %5, 0
%7 = add i64 %1, %0
%8 = sub i64 %7, %5
%9 = select i1 %6, i64 %0, i64 %8
br label %10
10: ; preds = %2, %4
%11 = phi i64 [ %9, %4 ], [ %0, %2 ]
ret i64 %11
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createIsExpression(struct memorycontainer *expression1,
                   struct memorycontainer *expression2) {
  return createExpression(0x20, expression1, expression2);
}


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

x86 assembly (clang, -O2):
<createIsExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x20,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createIsExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 32, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createIsExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 32, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int /*<<< orphan*/ f3();
void foo() {
  bar(0);
  f3();
  bar(1);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <bar@plt>
mov    $0x0,%al
call   1040 <f3@plt>
mov    $0x1,%edi
call   1030 <bar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %edi,%edi
call   1030 <bar@plt>
xor    %eax,%eax
call   1040 <f3@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @bar(i32 0)
%2 = call i32 (...) @f3()
%3 = call i32 @bar(i32 1)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @bar(i32 0)
%2 = tail call i32 (...) @f3()
%3 = tail call i32 @bar(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __syscall_getsid(int /*<<< orphan*/);
pid_t getsid(pid_t pid) { return (__syscall_getsid(pid)); }


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

x86 assembly (clang, -O2):
<getsid>:
jmp    1030 <__syscall_getsid@plt>

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

LLVM IR (-O2):
define i32 @getsid(i32 %0) {
%2 = tail call i32 @__syscall_getsid(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ forloop(int /*<<< orphan*/);
void op_forloop() { forloop(0); }


x86 assembly (clang, -O0):
<op_forloop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <forloop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_forloop>:
xor    %edi,%edi
jmp    1030 <forloop@plt>

LLVM IR (-O0):
define void @op_forloop() {
%1 = call i32 @forloop(i32 0)
ret void
}

LLVM IR (-O2):
define void @op_forloop() {
%1 = tail call i32 @forloop(i32 0)
ret void
}
/* Variables and functions */
char *xml_deserialize_(char *, int);
char *xml_deserialize_inplace(char **str) {
  char *s = xml_deserialize_(*str, 1);
  *str = s;
  return s;
}


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

x86 assembly (clang, -O2):
<xml_deserialize_inplace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0x1,%esi
call   1030 <xml_deserialize_@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @xml_deserialize_inplace(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i8* @xml_deserialize_(i8* %2, i32 1)
store i8* %3, i8** %0
ret i8* %3
}
unsigned get_padding(unsigned width_or_height) {
  if (width_or_height % (1 << 3)) {
    return (1 << 3) - (width_or_height % (1 << 3));
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_padding>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7,%eax
cmp    $0x0,%eax
je     112b <get_padding+0x2b>
mov    -0x8(%rbp),%ecx
and    $0x7,%ecx
mov    $0x8,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <get_padding+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_padding>:
and    $0x7,%edi
mov    $0x8,%eax
sub    %edi,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @get_padding(i32 %0) {
%2 = and i32 %0, 7
%3 = icmp eq i32 %2, 0
%4 = sub nuw nsw i32 8, %2
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
__typeof__(aligned_alloc(1, 1)) test_aligned_alloc_90(void) {
  return aligned_alloc(1, 1);
}


x86 assembly (clang, -O0):
<test_aligned_alloc_90>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %rsi,%rdi
call   1030 <aligned_alloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_aligned_alloc_90>:
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <aligned_alloc@plt>

LLVM IR (-O0):
define i8* @test_aligned_alloc_90() {
%1 = call i8* @aligned_alloc(i64 1, i64 1)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @test_aligned_alloc_90() {
%1 = tail call align 1 dereferenceable_or_null(1) i8* @aligned_alloc(i64 1, i64 1)
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
uint32_t read_uint32(FILE *in) {
  uint32_t x;
  assert(fread(&x, sizeof(uint32_t), 1, in) == 1);
  return x;
}


x86 assembly (clang, -O0):
<read_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint32>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_uint32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(i32* %3, i32 4, i32 1, i32* %4)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_uint32(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i32* %2, i32 4, i32 1, i32* %0)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  int flag = 1;
  scanf("%d", &number);
  if (number % 2 == 0) {
    flag = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1151 <main+0x41>
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
double fmod(double, double);
double zipf_ggl(double *seed) {
  double t, d2 = 0.2147483647e10;
  t = *seed;
  t = fmod(0.16807e5 * t, d2);
  *seed = t;
  return (t - 1.0e0) / (d2 - 1.0e0);
}


x86 assembly (clang, -O0):
<zipf_ggl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeca(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
movsd  0xe94(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe83(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zipf_ggl>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
mulsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,(%rbx)
addsd  0xed7(%rip),%xmm0
divsd  0xed7(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @zipf_ggl(double* %0) {
%2 = alloca double*
%3 = alloca double
%4 = alloca double
store double* %0, double** %2
store double 0x41DFFFFFFFC00000, double* %4
%5 = load double*, double** %2
%6 = load double, double* %5
store double %6, double* %3
%7 = load double, double* %3
%8 = fmul double 1.680700e+04, %7
%9 = load double, double* %4
%10 = call double @fmod(double %8, double %9)
store double %10, double* %3
%11 = load double, double* %3
%12 = load double*, double** %2
store double %11, double* %12
%13 = load double, double* %3
%14 = fsub double %13, 1.000000e+00
%15 = load double, double* %4
%16 = fsub double %15, 1.000000e+00
%17 = fdiv double %14, %16
ret double %17
}

LLVM IR (-O2):
define double @zipf_ggl(double* nocapture %0) {
%2 = load double, double* %0
%3 = fmul double %2, 1.680700e+04
%4 = tail call double @fmod(double %3, double 0x41DFFFFFFFC00000)
store double %4, double* %0
%5 = fadd double %4, -1.000000e+00
%6 = fdiv double %5, 0x41DFFFFFFF800000
ret double %6
}
signed long long int slifatorial(signed long long int n) {
  if (n > 1)
    return (n * slifatorial(n - 1));
  else
    return 1;
}


x86 assembly (clang, -O0):
<slifatorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jle    1150 <slifatorial+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <slifatorial@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1158 <slifatorial+0x48>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slifatorial>:
mov    $0x1,%eax
cmp    $0x2,%rdi
jl     1121 <slifatorial+0x21>
mov    $0x1,%eax
imul   %rdi,%rax
lea    -0x1(%rdi),%rcx
cmp    $0x2,%rdi
mov    %rcx,%rdi
ja     1110 <slifatorial+0x10>
ret

LLVM IR (-O0):
define i64 @slifatorial(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sgt i64 %4, 1
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i64, i64* %3
%8 = load i64, i64* %3
%9 = sub nsw i64 %8, 1
%10 = call i64 @slifatorial(i64 %9)
%11 = mul nsw i64 %7, %10
store i64 %11, i64* %2
br label %13
12: ; preds = %1
store i64 1, i64* %2
br label %13
13: ; preds = %12, %6
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
define i64 @slifatorial(i64 %0) {
%2 = icmp sgt i64 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = phi i64 [ %7, %3 ], [ 1, %1 ]
%6 = add nsw i64 %4, -1
%7 = mul nsw i64 %4, %5
%8 = icmp ugt i64 %4, 2
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i64 [ 1, %1 ], [ %7, %3 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int platform_numcores(void) { return sysconf(_SC_NPROCESSORS_ONLN); }


x86 assembly (clang, -O0):
<platform_numcores>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_numcores>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @platform_numcores() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @platform_numcores() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3_lerp(float *, float *, float *, float);
__attribute__((always_)) struct vec3 *
psvec3_lerp(struct vec3 *result, struct vec3 *a, struct vec3 *b, float p) {
  vec3_lerp((float *)result, (float *)a, (float *)b, p);
  return result;
}


x86 assembly (clang, -O0):
<psvec3_lerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movss  -0x1c(%rbp),%xmm0
call   1030 <vec3_lerp@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec3_lerp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3_lerp@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_lerp(%struct.vec3* %0, %struct.vec3* %1, %struct.vec3* %2, float %3) {
%5 = alloca %struct.vec3*
%6 = alloca %struct.vec3*
%7 = alloca %struct.vec3*
%8 = alloca float
store %struct.vec3* %0, %struct.vec3** %5
store %struct.vec3* %1, %struct.vec3** %6
store %struct.vec3* %2, %struct.vec3** %7
store float %3, float* %8
%9 = load %struct.vec3*, %struct.vec3** %5
%10 = bitcast %struct.vec3* %9 to float*
%11 = load %struct.vec3*, %struct.vec3** %6
%12 = bitcast %struct.vec3* %11 to float*
%13 = load %struct.vec3*, %struct.vec3** %7
%14 = bitcast %struct.vec3* %13 to float*
%15 = load float, float* %8
%16 = call i32 @vec3_lerp(float* %10, float* %12, float* %14, float %15)
%17 = load %struct.vec3*, %struct.vec3** %5
ret %struct.vec3* %17
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_lerp(%struct.vec3* returned %0, %struct.vec3* %1, %struct.vec3* %2, float %3) {
%5 = bitcast %struct.vec3* %0 to float*
%6 = bitcast %struct.vec3* %1 to float*
%7 = bitcast %struct.vec3* %2 to float*
%8 = tail call i32 @vec3_lerp(float* %5, float* %6, float* %7, float %3)
ret %struct.vec3* %0
}
int GetSectorSize(int N) {
  if (N < 8)
    return (1 << N) << 7;
  else
    return 0x0200;
}


x86 assembly (clang, -O0):
<GetSectorSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1126 <GetSectorSize+0x26>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
shl    $0x7,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <GetSectorSize+0x2d>
movl   $0x200,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetSectorSize>:
mov    %edi,%ecx
mov    $0x80,%edx
shl    %cl,%edx
cmp    $0x8,%edi
mov    $0x200,%eax
cmovl  %edx,%eax
ret

LLVM IR (-O0):
define i32 @GetSectorSize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 8
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = shl i32 1, %7
%9 = shl i32 %8, 7
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 512, i32* %2
br label %11
11: ; preds = %10, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @GetSectorSize(i32 %0) {
%2 = icmp slt i32 %0, 8
%3 = shl i32 128, %0
%4 = select i1 %2, i32 %3, i32 512
ret i32 %4
}
/* Type definitions */
struct can_filter {
  int can_id;
  int can_mask;
};
typedef int /*<<< orphan*/ rfilter;

/* Variables and functions */
int /*<<< orphan*/ CAN_RAW_FILTER;
int /*<<< orphan*/ SOL_CAN_RAW;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
               struct can_filter **, int);
int can_filter_clear(int sock) {
  struct can_filter rfilter[1];
  rfilter[0].can_id = 0x00;
  rfilter[0].can_mask = 0x00;
  return setsockopt(sock, SOL_CAN_RAW, CAN_RAW_FILTER, &rfilter,
                    sizeof(rfilter));
}


x86 assembly (clang, -O0):
<can_filter_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rcx
mov    $0x8,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_filter_clear>:
push   %rax
movq   $0x0,(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
mov    $0x8,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.can_filter = type { i32, i32 }
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
define i32 @can_filter_clear(i32 %0) {
%2 = alloca i32
%3 = alloca [1 x %struct.can_filter]
store i32 %0, i32* %2
%4 = getelementptr inbounds [1 x %struct.can_filter], [1 x %struct.can_filter]* %3, i64 0, i64 0
%5 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %4, i32 0, i32 0
store i32 0, i32* %5
%6 = getelementptr inbounds [1 x %struct.can_filter], [1 x %struct.can_filter]* %3, i64 0, i64 0
%7 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %6, i32 0, i32 1
store i32 0, i32* %7
%8 = load i32, i32* %2
%9 = load i32, i32* @SOL_CAN_RAW
%10 = load i32, i32* @CAN_RAW_FILTER
%11 = bitcast [1 x %struct.can_filter]* %3 to %struct.can_filter**
%12 = call i32 @setsockopt(i32 %8, i32 %9, i32 %10, %struct.can_filter** %11, i32 8)
ret i32 %12
}

LLVM IR (-O2):
%struct.can_filter = type { i32, i32 }
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
define i32 @can_filter_clear(i32 %0) {
%2 = alloca %struct.can_filter*
%3 = bitcast %struct.can_filter** %2 to [1 x %struct.can_filter]*
%4 = bitcast %struct.can_filter** %2 to i8*
%5 = bitcast %struct.can_filter** %2 to i32*
store i32 0, i32* %5
%6 = getelementptr inbounds [1 x %struct.can_filter], [1 x %struct.can_filter]* %3, i64 0, i64 0, i32 1
store i32 0, i32* %6
%7 = load i32, i32* @SOL_CAN_RAW
%8 = load i32, i32* @CAN_RAW_FILTER
%9 = call i32 @setsockopt(i32 %0, i32 %7, i32 %8, %struct.can_filter** %2, i32 8)
ret i32 %9
}
OP(fd, d2) { op_d2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_d2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_d2()
ret i32 undef
}
void swap_int(int a, int b) {
  int t = a;
  a = b;
  b = t;
}


x86 assembly (clang, -O0):
<swap_int>:
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
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap_int(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
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
ret void
}

LLVM IR (-O2):
define void @swap_int(i32 %0, i32 %1) {
ret void
}
int test_imm_9Buint16_mem(unsigned short *val) {
  return ((*val) & (-0x9B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Buint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff65,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Buint16_mem>:
movzwl (%rdi),%eax
test   $0xff65,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Buint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -155
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_9Buint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -155
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double timer_stop(double timestamp) {
  struct timeval time;
  double million = 1e6;
  gettimeofday(&time, 0);
  return time.tv_sec + time.tv_usec / million - timestamp;
}


x86 assembly (clang, -O0):
<timer_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm0
subsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_stop>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xecd(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
subsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @timer_stop(double %0) {
%2 = alloca double
%3 = alloca %struct.timeval
%4 = alloca double
store double %0, double* %2
store double 1.000000e+06, double* %4
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%9 = load double, double* %8
%10 = load double, double* %4
%11 = fdiv double %9, %10
%12 = fadd double %7, %11
%13 = load double, double* %2
%14 = fsub double %12, %13
ret double %14
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @timer_stop(double %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %6, %9
%11 = fsub double %10, %0
ret double %11
}
int test2(int b) { return (b & 1) == 0; }


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

x86 assembly (clang, -O2):
<test2>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @test2(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
void remove_magnetic_sensor(struct ssp_data *data) { return; }


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
define void @remove_magnetic_sensor(%struct.ssp_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
main() {
  int i;
  printf("emp\n");
  system("type ..\\create\\emp");
  printf("over\n");
  system("type ..\\create\\over");
  scanf("%d", &i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
call   1030 <system@plt>
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
call   1030 <system@plt>
lea    0xec3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <system@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb7(%rip),%rdi
call   1040 <system@plt>
lea    0xebf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"emp\0A\00"
@.str.1 = [19 x i8] c"type ..\\create\\emp\00"
@.str.2 = [6 x i8] c"over\0A\00"
@.str.3 = [20 x i8] c"type ..\\create\\over\00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"type ..\\create\\emp\00"
@.str.3 = [20 x i8] c"type ..\\create\\over\00"
@.str.4 = [3 x i8] c"%d\00"
@str = [4 x i8] c"emp\00"
@str.5 = [5 x i8] c"over\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.5, i64 0, i64 0))
%6 = tail call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RamWrite32A(int, int);
unsigned char RdStatus(int);
void SetPanTiltMode(unsigned char UcPnTmod) {
  unsigned char UcStRd = 1;
  switch (UcPnTmod) {
  case 0x00:
    RamWrite32A(0xF011, 0x00000000);
    break;
  case 0x01:
    RamWrite32A(0xF011, 0x00000001);
    break;
  }
  while (UcStRd) {
    UcStRd = RdStatus(1);
  }
}


x86 assembly (clang, -O0):
<SetPanTiltMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x1,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1157 <SetPanTiltMode+0x37>
jmp    1146 <SetPanTiltMode+0x26>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1168 <SetPanTiltMode+0x48>
jmp    1177 <SetPanTiltMode+0x57>
mov    $0xf011,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
jmp    1177 <SetPanTiltMode+0x57>
mov    $0xf011,%edi
mov    $0x1,%esi
call   1030 <RamWrite32A@plt>
jmp    117c <SetPanTiltMode+0x5c>
cmpb   $0x0,-0x2(%rbp)
je     1198 <SetPanTiltMode+0x78>
mov    $0x1,%edi
call   1040 <RdStatus@plt>
mov    %al,-0x2(%rbp)
jmp    117c <SetPanTiltMode+0x5c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetPanTiltMode>:
push   %rax
test   %edi,%edi
je     1132 <SetPanTiltMode+0x12>
cmp    $0x1,%dil
jne    1140 <SetPanTiltMode+0x20>
mov    $0x1,%esi
jmp    1134 <SetPanTiltMode+0x14>
xor    %esi,%esi
mov    $0xf011,%edi
call   1030 <RamWrite32A@plt>
xchg   %ax,%ax
mov    $0x1,%edi
call   1040 <RdStatus@plt>
test   %al,%al
jne    1140 <SetPanTiltMode+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @SetPanTiltMode(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 1, i8* %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
switch i32 %5, label %10 [
i32 0, label %6
i32 1, label %8
]
6: ; preds = %1
%7 = call i32 @RamWrite32A(i32 61457, i32 0)
br label %10
8: ; preds = %1
%9 = call i32 @RamWrite32A(i32 61457, i32 1)
br label %10
10: ; preds = %1, %8, %6
br label %11
11: ; preds = %14, %10
%12 = load i8, i8* %3
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call zeroext i8 @RdStatus(i32 1)
store i8 %15, i8* %3
br label %11
16: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @SetPanTiltMode(i8 zeroext %0) {
switch i8 %0, label %6 [
i8 0, label %3
i8 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 1, %2 ], [ 0, %1 ]
%5 = tail call i32 @RamWrite32A(i32 61457, i32 %4)
br label %6
6: ; preds = %3, %1
br label %7
7: ; preds = %6, %7
%8 = tail call zeroext i8 @RdStatus(i32 1)
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %7
10: ; preds = %7
ret void
}
int test_imm_78uint16_mem(unsigned short *val) {
  return ((*val) & (-0x78 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_78uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff88,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_78uint16_mem>:
movzwl (%rdi),%eax
test   $0xff88,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_78uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -120
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_78uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -120
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_03(unsigned char *x) { return x[32]; }


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

x86 assembly (clang, -O2):
<test_03>:
movzbl 0x20(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test_03(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 32
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_03(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 32
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ isnumchar(char);
int rightNumIndex(char str[200], int start) {
  int i = start + 1;
  while (isnumchar(str[i])) {
    i++;
  }
  return i - 1;
}


x86 assembly (clang, -O0):
<rightNumIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isnumchar@plt>
cmp    $0x0,%rax
je     1151 <rightNumIndex+0x41>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <rightNumIndex+0x18>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightNumIndex>:
push   %rbp
push   %rbx
push   %rax
movslq %esi,%rax
lea    -0x1(%rax),%ebp
lea    (%rax,%rdi,1),%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <isnumchar@plt>
add    $0x1,%ebp
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <rightNumIndex+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @rightNumIndex(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %6, %4 ], [ %3, %2 ]
%6 = add nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i64 @isnumchar(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = trunc i64 %5 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *getIsoDate() {
  time_t rawtime;
  time(&rawtime);
  struct tm *timeinfo;
  timeinfo = gmtime(&rawtime);
  char *date = (char *)malloc(128);
  date[0] = 0;
  strftime(date, 128, "%a, %d %b %Y %H:%M:%S GMT", timeinfo);
  return date;
}


x86 assembly (clang, -O0):
<getIsoDate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <time@plt>
lea    -0x4(%rbp),%rdi
call   1060 <gmtime@plt>
mov    %rax,-0x10(%rbp)
mov    $0x80,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x80,%esi
lea    0xe79(%rip),%rdx
call   1050 <strftime@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIsoDate>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <time@plt>
mov    %rbx,%rdi
call   1060 <gmtime@plt>
mov    %rax,%r14
mov    $0x80,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movb   $0x0,(%rax)
lea    0xe8d(%rip),%rdx
mov    %rax,%rdi
mov    $0x80,%esi
mov    %r14,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [26 x i8] c"%a, %d %b %Y %H:%M:%S GMT\00"
define i8* @getIsoDate() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca i8*
%4 = call i32 @time(i32* %1)
%5 = call %struct.tm* @gmtime(i32* %1)
store %struct.tm* %5, %struct.tm** %2
%6 = call i64 @malloc(i32 128)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 0, i8* %9
%10 = load i8*, i8** %3
%11 = load %struct.tm*, %struct.tm** %2
%12 = call i32 @strftime(i8* %10, i32 128, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), %struct.tm* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [26 x i8] c"%a, %d %b %Y %H:%M:%S GMT\00"
define i8* @getIsoDate() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @gmtime(i32* %1)
%5 = call i64 @malloc(i32 128)
%6 = inttoptr i64 %5 to i8*
store i8 0, i8* %6
%7 = call i32 @strftime(i8* %6, i32 128, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i8* %6
}
/* Variables and functions */
unsigned int list_init(int /*<<< orphan*/ *);
bool test_list_init_null_params(void) {
  bool pass = false;
  unsigned int res = list_init(NULL);
  if (res == 1) {
    pass = true;
  }
  return pass;
}


x86 assembly (clang, -O0):
<test_list_init_null_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <list_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    113c <test_list_init_null_params+0x2c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_list_init_null_params>:
push   %rax
xor    %edi,%edi
call   1030 <list_init@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_list_init_null_params() {
%1 = tail call i32 @list_init(i32* null)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void bad_input(const char *arg) {
  printf("usage: %s -p <port> -c </full/path/to/commands_file> "
         "-u </full/path/to/users_file>\n",
         arg);
  exit(0);
}


x86 assembly (clang, -O0):
<bad_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bad_input>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [84 x i8] c"usage: %s -p <port> -c </full/path/to/commands_file> -u </full/path/to/users_file>\0A\00"
define void @bad_input(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [84 x i8] c"usage: %s -p <port> -c </full/path/to/commands_file> -u </full/path/to/users_file>\0A\00"
define void @bad_input(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SYS_chroot;
int syscall1(int /*<<< orphan*/, long);
int chroot(char *dir) { return syscall1(SYS_chroot, (long)dir); }


x86 assembly (clang, -O0):
<chroot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <syscall1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chroot>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall1@plt>

LLVM IR (-O0):
@SYS_chroot = global i32 0
define i32 @chroot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @SYS_chroot
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = call i32 @syscall1(i32 %3, i64 %5)
ret i32 %6
}

LLVM IR (-O2):
@SYS_chroot = global i32 0
define i32 @chroot(i8* %0) {
%2 = load i32, i32* @SYS_chroot
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @syscall1(i32 %2, i64 %3)
ret i32 %4
}
int benchmark_consumer(struct mq_ws_msg *m __attribute__((unused)),
                       void *data __attribute__((unused))) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.mq_ws_msg = type opaque
define i32 @benchmark_consumer(%struct.mq_ws_msg* %0, i8* %1) {
%3 = alloca %struct.mq_ws_msg*
%4 = alloca i8*
store %struct.mq_ws_msg* %0, %struct.mq_ws_msg** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.mq_ws_msg = type opaque
define i32 @benchmark_consumer(%struct.mq_ws_msg* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}