xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int NumDigits(int i) {
  int num;
  if (i < 0) {
    printf("internal error: negative number passed to NumDigits\n");
    exit(1);
  }
  num = 0;
  while (i > 0) {
    num++;
    i = i / 10;
  }
  return (num);
}


x86 assembly (clang, -O0):
<NumDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    114b <NumDigits+0x2b>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1178 <NumDigits+0x58>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1152 <NumDigits+0x32>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumDigits>:
test   %edi,%edi
js     1148 <NumDigits+0x28>
je     1145 <NumDigits+0x25>
xor    %eax,%eax
mov    $0xcccccccd,%ecx
nopl   (%rax)
add    $0x1,%eax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
cmp    $0x9,%edi
mov    %edx,%edi
ja     1130 <NumDigits+0x10>
ret
xor    %eax,%eax
ret
push   %rax
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"internal error: negative number passed to NumDigits\0A\00"
define i32 @NumDigits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
store i32 0, i32* %3
br label %10
10: ; preds = %13, %9
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = load i32, i32* %2
%17 = sdiv i32 %16, 10
store i32 %17, i32* %2
br label %10
18: ; preds = %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@str = [52 x i8] c"internal error: negative number passed to NumDigits\00"
define i32 @NumDigits(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 0
br i1 %4, label %14, label %8
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %3, %8
%9 = phi i32 [ %11, %8 ], [ 0, %3 ]
%10 = phi i32 [ %12, %8 ], [ %0, %3 ]
%11 = add nuw nsw i32 %9, 1
%12 = udiv i32 %10, 10
%13 = icmp ult i32 %10, 10
br i1 %13, label %14, label %8
14: ; preds = %8, %3
%15 = phi i32 [ 0, %3 ], [ %11, %8 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ TwInit();
void NvMemInit(void) { TwInit(); }


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

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

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

LLVM IR (-O2):
define void @NvMemInit() {
%1 = tail call i32 (...) @TwInit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
unsigned about() {
  puts("SVM (Simplex Virtual Machine)"
       " [ "
       "v0.1"
       " ] by InternetBowser\n");
  return 1;
}


x86 assembly (clang, -O0):
<about>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [58 x i8] c"SVM (Simplex Virtual Machine) [ v0.1 ] by InternetBowser\0A\00"
define i32 @about() {
%1 = call i32 @puts(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [58 x i8] c"SVM (Simplex Virtual Machine) [ v0.1 ] by InternetBowser\0A\00"
define i32 @about() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
bool set_key_state(unsigned char *key_state, unsigned char keycode) {
  unsigned idx = keycode >> 3, bit = keycode & 7;
  bool prev = key_state[idx] & (1 << bit);
  key_state[idx] |= (1 << bit);
  return prev;
}


x86 assembly (clang, -O0):
<set_key_state>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x10(%rbp)
movzbl -0x9(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_key_state>:
mov    %esi,%ecx
mov    %esi,%edx
shr    $0x3,%rdx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
movzbl (%rdi,%rdx,1),%esi
and    %esi,%eax
bts    %ecx,%esi
mov    %sil,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define i32 @set_key_state(i8* %0, i8 zeroext %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* %4
%9 = zext i8 %8 to i32
%10 = ashr i32 %9, 3
store i32 %10, i32* %5
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = and i32 %12, 7
store i32 %13, i32* %6
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i32, i32* %6
%21 = shl i32 1, %20
%22 = and i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = shl i32 1, %23
%25 = load i8*, i8** %3
%26 = load i32, i32* %5
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = or i32 %30, %24
%32 = trunc i32 %31 to i8
store i8 %32, i8* %28
%33 = load i32, i32* %7
ret i32 %33
}

LLVM IR (-O2):
define i32 @set_key_state(i8* nocapture %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = lshr i32 %3, 3
%5 = and i32 %3, 7
%6 = zext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl nuw nsw i32 1, %5
%11 = and i32 %10, %9
%12 = trunc i32 %10 to i8
%13 = or i8 %8, %12
store i8 %13, i8* %7
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ api_end();
int /*<<< orphan*/ api_putchar(char);
void HariMain(void) {
  api_putchar('A');
  api_end();
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%edi
call   1040 <api_putchar@plt>
mov    $0x0,%al
call   1030 <api_end@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HariMain>:
push   %rax
mov    $0x41,%edi
call   1040 <api_putchar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <api_end@plt>

LLVM IR (-O0):
define void @HariMain() {
%1 = call i32 @api_putchar(i8 signext 65)
%2 = call i32 (...) @api_end()
ret void
}

LLVM IR (-O2):
define void @HariMain() {
%1 = tail call i32 @api_putchar(i8 signext 65)
%2 = tail call i32 (...) @api_end()
ret void
}
/* Variables and functions */
int GetInput();
int /*<<< orphan*/ printf(char *, int);
void BasicForLoop() {
  int repetitions = GetInput();
  for (int i = 0; i < repetitions; i++) {
    printf("Repetition: %d \n", i);
  }
}


x86 assembly (clang, -O0):
<BasicForLoop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <GetInput@plt>
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1162 <BasicForLoop+0x42>
mov    -0x8(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <BasicForLoop+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BasicForLoop>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <GetInput@plt>
test   %eax,%eax
jle    1151 <BasicForLoop+0x31>
mov    %eax,%ebp
lea    0xec6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1140 <BasicForLoop+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Repetition: %d \0A\00"
define void @BasicForLoop() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @GetInput()
store i32 %3, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Repetition: %d \0A\00"
define void @BasicForLoop() {
%1 = tail call i32 (...) @GetInput()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %0
ret void
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ 0, %0 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %3, label %4
}
/* Type definitions */
struct bitstream_elmt_t {
  int dummy;
};

/* Variables and functions */
unsigned int _read_bits(struct bitstream_elmt_t *, int, int);
int bitstream_i(struct bitstream_elmt_t *bs, int bits) {
  unsigned int value;
  value = _read_bits(bs, bits, 1);
  return ~value + 1;
}


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

x86 assembly (clang, -O2):
<bitstream_i>:
push   %rax
mov    $0x1,%edx
call   1030 <_read_bits@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.bitstream_elmt_t = type { i32 }
define i32 @bitstream_i(%struct.bitstream_elmt_t* %0, i32 %1) {
%3 = alloca %struct.bitstream_elmt_t*
%4 = alloca i32
%5 = alloca i32
store %struct.bitstream_elmt_t* %0, %struct.bitstream_elmt_t** %3
store i32 %1, i32* %4
%6 = load %struct.bitstream_elmt_t*, %struct.bitstream_elmt_t** %3
%7 = load i32, i32* %4
%8 = call i32 @_read_bits(%struct.bitstream_elmt_t* %6, i32 %7, i32 1)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = xor i32 %9, -1
%11 = add i32 %10, 1
ret i32 %11
}

LLVM IR (-O2):
%struct.bitstream_elmt_t = type { i32 }
define i32 @bitstream_i(%struct.bitstream_elmt_t* %0, i32 %1) {
%3 = tail call i32 @_read_bits(%struct.bitstream_elmt_t* %0, i32 %1, i32 1)
%4 = sub i32 0, %3
ret i32 %4
}
int rem_by_value(int dividend, int divisor) { return dividend % divisor; }


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

x86 assembly (clang, -O2):
<rem_by_value>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @rem_by_value(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ gen_is_atom(int);
bool gen_is_desktop(int devid) {
  assert(!gen_is_atom(devid));
  return ((devid & 0xf) == 0x2);
}


x86 assembly (clang, -O0):
<gen_is_desktop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <gen_is_atom@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
and    $0xf,%eax
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_is_desktop>:
push   %rbx
mov    %edi,%ebx
call   1040 <gen_is_atom@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
and    $0xf,%ebx
xor    %eax,%eax
cmp    $0x2,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gen_is_desktop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @gen_is_atom(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %2
%10 = and i32 %9, 15
%11 = icmp eq i32 %10, 2
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @gen_is_desktop(i32 %0) {
%2 = tail call i32 @gen_is_atom(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = and i32 %0, 15
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
ret i32 %8
}
void divisionByZeroError() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct stack *);
int /*<<< orphan*/ stack_clear(struct stack *);
void stack_free(struct stack *theStack) {
  stack_clear(theStack);
  free(theStack);
  return;
}


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

x86 assembly (clang, -O2):
<stack_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <stack_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.stack = type { i32 }
define void @stack_free(%struct.stack* %0) {
%2 = tail call i32 @stack_clear(%struct.stack* %0)
%3 = tail call i32 @free(%struct.stack* %0)
ret void
}
int foo2(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @foo2() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @foo2() {
ret i32 -1
}
void delay(const unsigned long time) {}


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

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

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

LLVM IR (-O2):
define void @delay(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strcasecmp(char *, char *);
void strcasecmp_2() {
  char *x = "abc";
  char *y = "Bcd";
  clang_analyzer_eval(strcasecmp(x, y) == -1);
}


x86 assembly (clang, -O0):
<strcasecmp_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcasecmp_2>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Bcd\00"
define void @strcasecmp_2() {
%1 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void error2(const char *msg) {
  printf("%s\n", msg);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @error2(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t binarise(size_t num) {
  return (num == 0 || num == 1 ? num : ((num % 2) + 10 * binarise(num / 2)));
}


x86 assembly (clang, -O0):
<binarise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1132 <binarise+0x22>
cmpq   $0x1,-0x8(%rbp)
jne    113f <binarise+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    116a <binarise+0x5a>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
shr    $0x1,%rdi
call   1030 <binarise@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binarise>:
cmp    $0x1,%rdi
jbe    112f <binarise+0x1f>
push   %rbx
mov    %edi,%ebx
and    $0x1,%ebx
shr    %rdi
call   1030 <binarise@plt>
add    %rax,%rax
lea    (%rax,%rax,4),%rdi
or     %rbx,%rdi
pop    %rbx
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @binarise(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5, %1
%9 = load i64, i64* %2
br label %18
10: ; preds = %5
%11 = load i64, i64* %2
%12 = urem i64 %11, 2
%13 = load i64, i64* %2
%14 = udiv i64 %13, 2
%15 = call i64 @binarise(i64 %14)
%16 = mul i64 10, %15
%17 = add i64 %12, %16
br label %18
18: ; preds = %10, %8
%19 = phi i64 [ %9, %8 ], [ %17, %10 ]
ret i64 %19
}

LLVM IR (-O2):
define i64 @binarise(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i64 [ %10, %5 ], [ %0, %1 ]
ret i64 %4
5: ; preds = %1
%6 = and i64 %0, 1
%7 = lshr i64 %0, 1
%8 = tail call i64 @binarise(i64 %7)
%9 = mul i64 %8, 10
%10 = or i64 %9, %6
br label %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ADCComparatorIntEnable(uint32_t ui32Base, uint32_t ui32SequenceNum) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) |= 0x10000
                                                       << ui32SequenceNum;
}


x86 assembly (clang, -O0):
<ADCComparatorIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x10000,%edx
shl    %cl,%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCComparatorIntEnable>:
mov    %esi,%ecx
mov    $0x10000,%eax
shl    %cl,%eax
movslq %edi,%rcx
or     %eax,0x8(%rcx)
ret

LLVM IR (-O0):
define void @ADCComparatorIntEnable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 65536, %5
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 8
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = or i32 %11, %6
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @ADCComparatorIntEnable(i32 %0, i32 %1) {
%3 = shl i32 65536, %1
%4 = add nsw i32 %0, 8
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, %3
store volatile i32 %8, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void main() {
  char a;
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext undef)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_subs_epu16(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_subs_epu16(__m128i A, __m128i B) {
  return _mm_subs_epu16(A, B);
}


x86 assembly (clang, -O0):
<test_mm_subs_epu16>:
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 <_mm_subs_epu16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_subs_epu16>:
jmp    1030 <_mm_subs_epu16@plt>

LLVM IR (-O0):
define i32 @test_mm_subs_epu16(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 @_mm_subs_epu16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_subs_epu16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_subs_epu16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int);
int main() {
  f(1, 2);
  f(1, 5);
  f(6, 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
mov    $0x1,%edi
mov    $0x5,%esi
call   1030 <f@plt>
mov    $0x6,%edi
mov    $0x5,%esi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
mov    $0x1,%edi
mov    $0x5,%esi
call   1030 <f@plt>
mov    $0x6,%edi
mov    $0x5,%esi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 1, i32 2)
%2 = call i32 @f(i32 1, i32 5)
%3 = call i32 @f(i32 6, i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2)
%2 = tail call i32 @f(i32 1, i32 5)
%3 = tail call i32 @f(i32 6, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  do {
    (void)(argc);
  } while (0);
  do {
    (void)(argv);
  } while (0);
  puts("OutOfMemoryError");
  return (-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    112b <main+0x1b>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"OutOfMemoryError\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
char *StrUnderline(const char *in, char *out) {
  char *scan = out;
  while (*in != '\0') {
    if ((*in >= ' ') || (*in < '\0'))
      *scan++ = '-';
    in++;
  }
  *scan = '\0';
  return out;
}


x86 assembly (clang, -O0):
<StrUnderline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1167 <StrUnderline+0x67>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jge    1144 <StrUnderline+0x44>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jge    1156 <StrUnderline+0x56>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x2d,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <StrUnderline+0x14>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrUnderline>:
mov    %rsi,%rax
mov    (%rdi),%dl
mov    %rsi,%rcx
test   %dl,%dl
je     1139 <StrUnderline+0x39>
add    $0x1,%rdi
mov    %rax,%rcx
jmp    112b <StrUnderline+0x2b>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%edx
add    $0x1,%rdi
test   %dl,%dl
je     1139 <StrUnderline+0x39>
cmp    $0x20,%dl
jb     1120 <StrUnderline+0x20>
movb   $0x2d,(%rcx)
add    $0x1,%rcx
jmp    1120 <StrUnderline+0x20>
movb   $0x0,(%rcx)
ret

LLVM IR (-O0):
define i8* @StrUnderline(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
br label %7
7: ; preds = %25, %2
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %28
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 32
br i1 %16, label %22, label %17
17: ; preds = %12
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %17, %12
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %5
store i8 45, i8* %23
br label %25
25: ; preds = %22, %17
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
br label %7
28: ; preds = %7
%29 = load i8*, i8** %5
store i8 0, i8* %29
%30 = load i8*, i8** %4
ret i8* %30
}

LLVM IR (-O2):
define i8* @StrUnderline(i8* nocapture %0, i8* returned writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %12
%6 = phi i8 [ %15, %12 ], [ %3, %2 ]
%7 = phi i8* [ %13, %12 ], [ %1, %2 ]
%8 = phi i8* [ %14, %12 ], [ %0, %2 ]
%9 = icmp ugt i8 %6, 31
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
store i8 45, i8* %7
br label %12
12: ; preds = %5, %10
%13 = phi i8* [ %11, %10 ], [ %7, %5 ]
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %12, %2
%18 = phi i8* [ %1, %2 ], [ %13, %12 ]
store i8 0, i8* %18
ret i8* %1
}
int mq_unlink(const char *mq_name) {
  ((void)mq_name);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @mq_unlink(i8* nocapture readnone %0) {
ret i32 0
}
int double_imp(int x) { return x << 1; }


x86 assembly (clang, -O0):
<double_imp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_imp>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @double_imp(i32 %0) {
%2 = shl i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mifuncion(void) {
  printf("hola intel-BUAP\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"hola intel-BUAP\0A\00"
define void @mifuncion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"hola intel-BUAP\00"
define void @mifuncion() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int tcflush(int, int /*<<< orphan*/);
int /*<<< orphan*/ usleep(int);
int serial_flush(int fd) {
  usleep(10000);
  return tcflush(fd, TCIOFLUSH);
}


x86 assembly (clang, -O0):
<serial_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2710,%edi
call   1040 <usleep@plt>
mov    -0x4(%rbp),%edi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_flush>:
push   %rbx
mov    %edi,%ebx
mov    $0x2710,%edi
call   1040 <usleep@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@TCIOFLUSH = global i32 0
define i32 @serial_flush(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @usleep(i32 10000)
%4 = load i32, i32* %2
%5 = load i32, i32* @TCIOFLUSH
%6 = call i32 @tcflush(i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define i32 @serial_flush(i32 %0) {
%2 = tail call i32 @usleep(i32 10000)
%3 = load i32, i32* @TCIOFLUSH
%4 = tail call i32 @tcflush(i32 %0, i32 %3)
ret i32 %4
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double mSecCount() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return ((double)tv.tv_sec * 1000.0 + (double)tv.tv_usec / 1000.0);
}


x86 assembly (clang, -O0):
<mSecCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mSecCount>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
cvtsi2sdq 0x8(%rsp),%xmm1
movsd  0xeca(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @mSecCount() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+03
%10 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+03, double %9)
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @mSecCount() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+03
%11 = call double @llvm.fmuladd.f64(double %6, double 1.000000e+03, double %10)
ret double %11
}
int _int(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<_int>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @_int(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
scalar_t__ isEmptyDynArr(struct DynArr *);
double log10(double);
int /*<<< orphan*/ popDynArr(struct DynArr *);
int /*<<< orphan*/ pushDynArr(struct DynArr *, double);
double topDynArr(struct DynArr *);
void base10log(struct DynArr *stack) {
  double a, c;
  if (isEmptyDynArr(stack))
    return;
  a = topDynArr(stack);
  popDynArr(stack);
  c = log10(a);
  pushDynArr(stack, c);
}


x86 assembly (clang, -O0):
<base10log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <isEmptyDynArr@plt>
cmp    $0x0,%rax
je     1174 <base10log+0x24>
jmp    11a8 <base10log+0x58>
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
movsd  -0x10(%rbp),%xmm0
call   1060 <log10@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
call   1070 <pushDynArr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base10log>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1050 <isEmptyDynArr@plt>
test   %rax,%rax
je     1168 <base10log+0x18>
add    $0x10,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
movsd  0x8(%rsp),%xmm0
call   1060 <log10@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1070 <pushDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define void @base10log(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
%3 = alloca double
%4 = alloca double
store %struct.DynArr* %0, %struct.DynArr** %2
%5 = load %struct.DynArr*, %struct.DynArr** %2
%6 = call i64 @isEmptyDynArr(%struct.DynArr* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %19
9: ; preds = %1
%10 = load %struct.DynArr*, %struct.DynArr** %2
%11 = call double @topDynArr(%struct.DynArr* %10)
store double %11, double* %3
%12 = load %struct.DynArr*, %struct.DynArr** %2
%13 = call i32 @popDynArr(%struct.DynArr* %12)
%14 = load double, double* %3
%15 = call double @log10(double %14)
store double %15, double* %4
%16 = load %struct.DynArr*, %struct.DynArr** %2
%17 = load double, double* %4
%18 = call i32 @pushDynArr(%struct.DynArr* %16, double %17)
br label %19
19: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define void @base10log(%struct.DynArr* %0) {
%2 = tail call i64 @isEmptyDynArr(%struct.DynArr* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call double @topDynArr(%struct.DynArr* %0)
%6 = tail call i32 @popDynArr(%struct.DynArr* %0)
%7 = tail call double @log10(double %5)
%8 = tail call i32 @pushDynArr(%struct.DynArr* %0, double %7)
br label %9
9: ; preds = %1, %4
ret void
}
void ff_hevc_put_hevc_uni_pel_pixels64_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_pel_pixels64_8_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g(int);
int /*<<< orphan*/ h();
int main() {
  f();
  g(12);
  h();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <f@plt>
mov    $0xc,%edi
call   1050 <g@plt>
mov    $0x0,%al
call   1030 <h@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
mov    $0xc,%edi
call   1050 <g@plt>
xor    %eax,%eax
call   1030 <h@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @f()
%2 = call i32 @g(i32 12)
%3 = call i32 (...) @h()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @g(i32 12)
%3 = tail call i32 (...) @h()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_AVTransport_GetTransportSettings(void *, char *,
                                                                 char *);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPAVTransport_GetTransportSettings(void *upnptoken,
                                          unsigned int InstanceID) {
  printf("Invoke: UPnPAVTransport_GetTransportSettings(%u);\r\n", InstanceID);
  UPnPResponse_AVTransport_GetTransportSettings(upnptoken, "Sample String",
                                                "Sample String");
}


x86 assembly (clang, -O0):
<UPnPAVTransport_GetTransportSettings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeeb(%rip),%rdx
mov    %rdx,%rsi
call   1040 <UPnPResponse_AVTransport_GetTransportSettings@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPAVTransport_GetTransportSettings>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xefd(%rip),%rdx
mov    %rbx,%rdi
mov    %rdx,%rsi
pop    %rbx
jmp    1040 <UPnPResponse_AVTransport_GetTransportSettings@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"Invoke: UPnPAVTransport_GetTransportSettings(%u);\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UPnPAVTransport_GetTransportSettings(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_AVTransport_GetTransportSettings(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"Invoke: UPnPAVTransport_GetTransportSettings(%u);\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UPnPAVTransport_GetTransportSettings(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_AVTransport_GetTransportSettings(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atan(double);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  double param, result;
  param = 1.0;
  result = atan(param) * 180 / 3.14159265;
  printf("The arc tangent of %f is %.3f degrees\n", param, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <atan@plt>
imul   $0xb4,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  0xea8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <atan@plt>
imul   $0xb4,%eax,%eax
cvtsi2sd %eax,%xmm1
divsd  0xec8(%rip),%xmm1
lea    0xec9(%rip),%rdi
movsd  0xeb1(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"The arc tangent of %f is %.3f degrees\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 1.000000e+00, double* %2
%4 = load double, double* %2
%5 = call i32 @atan(double %4)
%6 = mul nsw i32 %5, 180
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 0x400921FB53C8D4F1
store double %8, double* %3
%9 = load double, double* %2
%10 = load double, double* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), double %9, double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"The arc tangent of %f is %.3f degrees\0A\00"
define i32 @main() {
%1 = tail call i32 @atan(double 1.000000e+00)
%2 = mul nsw i32 %1, 180
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 0x400921FB53C8D4F1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), double 1.000000e+00, double %4)
ret i32 0
}
unsigned short
unsignedshort_ignoring_signedlonglongint(unsigned short x,
                                         signed long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshort_ignoring_signedlonglongint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedshort_ignoring_signedlonglongint>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @unsignedshort_ignoring_signedlonglongint(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshort_ignoring_signedlonglongint(i16 returned zeroext %0, i64 %1) {
ret i16 %0
}
/* Variables and functions */
double log(double);
double get_energy_loss(double beta, double xi, double xlam, double lnepp) {
  double delta;
  delta = xi * (xlam + log(xi) - lnepp + 0.423);
  return (delta);
}


x86 assembly (clang, -O0):
<get_energy_loss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movsd  -0x38(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
addsd  %xmm2,%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  0xe98(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_energy_loss>:
sub    $0x18,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,(%rsp)
movapd %xmm1,%xmm0
movsd  %xmm1,0x8(%rsp)
call   1030 <log@plt>
addsd  (%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
addsd  0xebf(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @get_energy_loss(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %6
%13 = call double @log(double %12)
%14 = fadd double %11, %13
%15 = load double, double* %8
%16 = fsub double %14, %15
%17 = fadd double %16, 4.230000e-01
%18 = fmul double %10, %17
store double %18, double* %9
%19 = load double, double* %9
ret double %19
}

LLVM IR (-O2):
define double @get_energy_loss(double %0, double %1, double %2, double %3) {
%5 = tail call double @log(double %1)
%6 = fadd double %5, %2
%7 = fsub double %6, %3
%8 = fadd double %7, 4.230000e-01
%9 = fmul double %8, %1
ret double %9
}
void foo426(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo426(i32 %0) {
ret void
}
int main(void) {
  int Int;
  int Calloc;
  int floaitng;
  int ReInitialize;
  int Xx;
  int _1312;
  int _;
  int alpha_beta_routine;
  int z;
  int A$;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_D5uint16_mem(unsigned short *val) {
  return ((*val) & (0xD5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D5uint16_mem>:
testb  $0xd5,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D5uint16_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, 213
%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_D5uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 213
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}