xunge/DecIR huggingface dataset:
void DMTimerCompareSet(unsigned int baseAdd, unsigned int compareVal) {
  (*((volatile unsigned int *)(baseAdd + (0x4C)))) = compareVal;
}


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

x86 assembly (clang, -O2):
<DMTimerCompareSet>:
add    $0x4c,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @DMTimerCompareSet(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 = load i32, i32* %3
%7 = add i32 %6, 76
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @DMTimerCompareSet(i32 %0, i32 %1) {
%3 = add i32 %0, 76
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
int comparefunc(const void *a, const void *b) {
  int aa, bb;
  aa = *(int *)a;
  bb = *(int *)b;
  return (aa - bb);
}


x86 assembly (clang, -O0):
<comparefunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @comparefunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @comparefunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
size_t strnlen(const char *s, size_t len) {
  size_t cnt = 0;
  while (cnt < len && *s++ != '\0') {
    cnt++;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    1142 <strnlen+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1152 <strnlen+0x52>
jmp    1163 <strnlen+0x63>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %11, %9 ], [ 0, %2 ]
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add nuw i64 %5, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %2
%14 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ closedown();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ tape_detach();
void sigquit_handler(int signum) {
  tape_detach();
  closedown();
  exit(1);
}


x86 assembly (clang, -O0):
<sigquit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <tape_detach@plt>
mov    $0x0,%al
call   1040 <closedown@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sigquit_handler>:
push   %rax
xor    %eax,%eax
call   1030 <tape_detach@plt>
xor    %eax,%eax
call   1040 <closedown@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @sigquit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @tape_detach()
%4 = call i32 (...) @closedown()
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sigquit_handler(i32 %0) {
%2 = tail call i32 (...) @tape_detach()
%3 = tail call i32 (...) @closedown()
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t endswap16(uint16_t x) { return ((x >> 8) | (x << 8)); }


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

x86 assembly (clang, -O2):
<endswap16>:
mov    %edi,%eax
sar    $0x8,%eax
shl    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @endswap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @endswap16(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
void gameplay_stop_button_click(struct button *button, struct world *world) {}


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

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

LLVM IR (-O0):
%struct.button = type opaque
%struct.world = type opaque
define void @gameplay_stop_button_click(%struct.button* %0, %struct.world* %1) {
%3 = alloca %struct.button*
%4 = alloca %struct.world*
store %struct.button* %0, %struct.button** %3
store %struct.world* %1, %struct.world** %4
ret void
}

LLVM IR (-O2):
%struct.button = type opaque
%struct.world = type opaque
define void @gameplay_stop_button_click(%struct.button* nocapture %0, %struct.world* nocapture %1) {
ret void
}
int main(void) {
  int i;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
  { int i; }
#pragma GCC diagnostic pop
}


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
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void insertion_sort(int *vetor, int n) {}


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

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

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

LLVM IR (-O2):
define void @insertion_sort(i32* nocapture %0, i32 %1) {
ret void
}
int test_imm_C8int16_mem(short *val) {
  return ((*val) & (0xC8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C8int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 200
%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_C8int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 200
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ closedir(void *);
void close_dir(void *stream) { closedir(stream); }


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

x86 assembly (clang, -O2):
<close_dir>:
jmp    1030 <closedir@plt>

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

LLVM IR (-O2):
define void @close_dir(i8* nocapture %0) {
%2 = tail call i32 @closedir(i8* %0)
ret void
}
/* Variables and functions */
unsigned int csum_add(unsigned int, unsigned int);
unsigned int csum_sub(unsigned int csum, unsigned int addend) {
  return csum_add(csum, ~addend);
}


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

x86 assembly (clang, -O2):
<csum_sub>:
not    %esi
jmp    1030 <csum_add@plt>

LLVM IR (-O0):
define i32 @csum_sub(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 = xor i32 %6, -1
%8 = call i32 @csum_add(i32 %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @csum_sub(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = tail call i32 @csum_add(i32 %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int getrand();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", getrand());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getrand()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct inode_type {
  int dummy;
};
typedef int int32_t;

/* Variables and functions */
int32_t romfs_unlink_inode(struct inode_type *inode) { return -30; }


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

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

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

LLVM IR (-O2):
%struct.inode_type = type { i32 }
define i32 @romfs_unlink_inode(%struct.inode_type* nocapture readnone %0) {
ret i32 -30
}
/* Variables and functions */
char *nextSlash(char *ptr) {
  for (; *ptr != '/'; ptr++) {
    if (*ptr == '\0')
      return NULL;
  }
  return ptr + 1;
}


x86 assembly (clang, -O0):
<nextSlash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     114b <nextSlash+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1135 <nextSlash+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1157 <nextSlash+0x57>
jmp    113a <nextSlash+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <nextSlash+0x8>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextSlash>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
test   %cl,%cl
je     1122 <nextSlash+0x22>
cmp    $0x2f,%cl
jne    1110 <nextSlash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @nextSlash(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 47, label %7
i8 0, label %9
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 1
br label %9
9: ; preds = %2, %7
%10 = phi i8* [ %8, %7 ], [ null, %2 ]
ret i8* %10
}
void rop3_156_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_156_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_156_0_0>:
mov    (%rdi),%al
not    %al
and    %dl,%al
xor    %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_156_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = xor i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_156_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = and i8 %5, %2
%7 = xor i8 %6, %1
store i8 %7, i8* %0
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(int);
uint32_t UARTRxErrorGet(uint32_t ui32Base) {
  ASSERT(_UARTBaseValid(ui32Base));
  return ((*((volatile uint32_t *)(ui32Base + 0x00000004))) & 0x0000000F);
}


x86 assembly (clang, -O0):
<UARTRxErrorGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x4,%eax
cltq
mov    (%rax),%eax
and    $0xf,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTRxErrorGet>:
push   %rbx
mov    %edi,%ebx
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebx,%rax
mov    0x4(%rax),%eax
and    $0xf,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @UARTRxErrorGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_UARTBaseValid(i32 %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 4
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, 15
ret i32 %11
}

LLVM IR (-O2):
define i32 @UARTRxErrorGet(i32 %0) {
%2 = tail call i32 @_UARTBaseValid(i32 %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = add nsw i32 %0, 4
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 15
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_usage(void) {
  printf("Run as:\t time /bin/sh/ script.sh argScript0 argScript1 ...\n");
}


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

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

LLVM IR (-O0):
@.str = [60 x i8] c"Run as:\09 time /bin/sh/ script.sh argScript0 argScript1 ...\0A\00"
define void @show_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [59 x i8] c"Run as:\09 time /bin/sh/ script.sh argScript0 argScript1 ...\00"
define void @show_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
void s_strncpy(char *dest, const char *src, size_t _size) {
  strncpy(dest, src, _size);
  dest[_size - 1] = '\0';
}


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

x86 assembly (clang, -O2):
<s_strncpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @s_strncpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
define void @s_strncpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret void
}
/* Variables and functions */
double pow(double, double);
double z0_m(double ndvi, double ndvi_max) {
  return (0.005 + 0.5 * pow((ndvi / ndvi_max), 2.5));
}


x86 assembly (clang, -O0):
<z0_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
call   1030 <pow@plt>
movsd  0xebf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<z0_m>:
push   %rax
divsd  %xmm1,%xmm0
movsd  0xee3(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xede(%rip),%xmm0
addsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @z0_m(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
%8 = call double @pow(double %7, double 2.500000e+00)
%9 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %8, double 5.000000e-03)
ret double %9
}

LLVM IR (-O2):
define double @z0_m(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @pow(double %3, double 2.500000e+00)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 5.000000e-01, double 5.000000e-03)
ret double %5
}
void CS_IRQHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<CS_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <CS_IRQHandler+0x9>
jmp    1109 <CS_IRQHandler+0x9>

x86 assembly (clang, -O2):
<CS_IRQHandler>:
jmp    1100 <CS_IRQHandler>

LLVM IR (-O0):
define void @CS_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @CS_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, short, int);
int fun_call_align_8(int a, short b, int c) {
  printf("a = %d, b = %d, c = %d\n", a, b, c);
  return a + b + c;
}


x86 assembly (clang, -O0):
<fun_call_align_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x6(%rbp),%ax
mov    -0xc(%rbp),%ecx
lea    0xeca(%rip),%rdi
movswl %ax,%edx
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
movswl -0x6(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_call_align_8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xede(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <printf@plt>
add    %ebx,%ebp
add    %r14d,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"a = %d, b = %d, c = %d\0A\00"
define i32 @fun_call_align_8(i32 %0, i16 signext %1, i32 %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i32
store i32 %0, i32* %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i16, i16* %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7, i16 signext %8, i32 %9)
%11 = load i32, i32* %4
%12 = load i16, i16* %5
%13 = sext i16 %12 to i32
%14 = add nsw i32 %11, %13
%15 = load i32, i32* %6
%16 = add nsw i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
@.str = [24 x i8] c"a = %d, b = %d, c = %d\0A\00"
define i32 @fun_call_align_8(i32 %0, i16 signext %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, i16 signext %1, i32 %2)
%5 = sext i16 %1 to i32
%6 = add nsw i32 %5, %0
%7 = add nsw i32 %6, %2
ret i32 %7
}
void swap(int *A, int a, int b) {
  int tmp = A[a];
  A[a] = A[b];
  A[b] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_COM(int);
int /*<<< orphan*/ LCD_DATA(int);
int /*<<< orphan*/ ili9163_set_window(int, int, int, int);
void GUI_DrawPixel(int x, int y) {
  ili9163_set_window(x, y, 1, 1);
  LCD_COM(0x2C);
  LCD_DATA(0x5555 >> 8);
  LCD_DATA(0x5555 & 0xFF);
}


x86 assembly (clang, -O0):
<GUI_DrawPixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1040 <ili9163_set_window@plt>
mov    $0x2c,%edi
call   1050 <LCD_COM@plt>
mov    $0x55,%edi
call   1030 <LCD_DATA@plt>
mov    $0x55,%edi
call   1030 <LCD_DATA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GUI_DrawPixel>:
push   %rax
mov    $0x1,%edx
mov    $0x1,%ecx
call   1040 <ili9163_set_window@plt>
mov    $0x2c,%edi
call   1050 <LCD_COM@plt>
mov    $0x55,%edi
call   1030 <LCD_DATA@plt>
mov    $0x55,%edi
pop    %rax
jmp    1030 <LCD_DATA@plt>

LLVM IR (-O0):
define void @GUI_DrawPixel(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 @ili9163_set_window(i32 %5, i32 %6, i32 1, i32 1)
%8 = call i32 @LCD_COM(i32 44)
%9 = call i32 @LCD_DATA(i32 85)
%10 = call i32 @LCD_DATA(i32 85)
ret void
}

LLVM IR (-O2):
define void @GUI_DrawPixel(i32 %0, i32 %1) {
%3 = tail call i32 @ili9163_set_window(i32 %0, i32 %1, i32 1, i32 1)
%4 = tail call i32 @LCD_COM(i32 44)
%5 = tail call i32 @LCD_DATA(i32 85)
%6 = tail call i32 @LCD_DATA(i32 85)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
int /*<<< orphan*/ printf(char *);
int main() {
  f1();
  f2();
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <f1@plt>
mov    $0x0,%al
call   1030 <f2@plt>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <f1@plt>
xor    %eax,%eax
call   1030 <f2@plt>
lea    0xeaa(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f2()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
unsigned long _sdbm(unsigned char *);
unsigned long hash_sdbm(unsigned char *str, int table_size) {
  unsigned long hash = _sdbm(str);
  return (hash < 0) ? (hash * -1) % table_size : hash % table_size;
}


x86 assembly (clang, -O0):
<hash_sdbm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_sdbm@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jae    114e <hash_sdbm+0x3e>
imul   $0xffffffffffffffff,-0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x20(%rbp)
jmp    115f <hash_sdbm+0x4f>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_sdbm>:
push   %rbx
mov    %esi,%ebx
call   1030 <_sdbm@plt>
movslq %ebx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1131 <hash_sdbm+0x21>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @hash_sdbm(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i64 @_sdbm(i8* %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = icmp ult i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i64, i64* %5
%12 = mul i64 %11, -1
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = urem i64 %12, %14
br label %21
16: ; preds = %2
%17 = load i64, i64* %5
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = urem i64 %17, %19
br label %21
21: ; preds = %16, %10
%22 = phi i64 [ %15, %10 ], [ %20, %16 ]
ret i64 %22
}

LLVM IR (-O2):
define i64 @hash_sdbm(i8* %0, i32 %1) {
%3 = tail call i64 @_sdbm(i8* %0)
%4 = sext i32 %1 to i64
%5 = urem i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ configure_umip_recovery();
int /*<<< orphan*/ print_cr0();
int /*<<< orphan*/ print_gdt_limits();
int /*<<< orphan*/ print_segment_bases();
int /*<<< orphan*/ print_segments();
int /*<<< orphan*/ printf(char *);
int main(void) {
  configure_umip_recovery();
  print_segments();
  printf("\n");
  print_segment_bases();
  printf("\n");
  print_gdt_limits();
  printf("\n");
  print_cr0();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <configure_umip_recovery@plt>
mov    $0x0,%al
call   1060 <print_segments@plt>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1070 <print_segment_bases@plt>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1080 <print_gdt_limits@plt>
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <print_cr0@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <configure_umip_recovery@plt>
xor    %eax,%eax
call   1060 <print_segments@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1070 <print_segment_bases@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1080 <print_gdt_limits@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <print_cr0@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @configure_umip_recovery()
%3 = call i32 (...) @print_segments()
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @print_segment_bases()
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @print_gdt_limits()
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @print_cr0()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @configure_umip_recovery()
%2 = tail call i32 (...) @print_segments()
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 (...) @print_segment_bases()
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 (...) @print_gdt_limits()
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 (...) @print_cr0()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int BIO_tell(int /*<<< orphan*/ *);
int BioTell(BIO *bio) {
  if (!bio) {
    return -1;
  }
  return BIO_tell(bio);
}


x86 assembly (clang, -O0):
<BioTell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <BioTell+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    113f <BioTell+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <BIO_tell@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BioTell>:
test   %rdi,%rdi
je     111a <BioTell+0xa>
jmp    1030 <BIO_tell@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @BioTell(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @BIO_tell(i32* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_sll_pi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_sll_pi32(__m64 a, __m64 b) { return _mm_sll_pi32(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_sll_pi32>:
jmp    1030 <_mm_sll_pi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_sll_pi32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sll_pi32(i32 %0, i32 %1)
ret i32 %3
}
void sh_veu_destroy(void) {}


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

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

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

LLVM IR (-O2):
define void @sh_veu_destroy() {
ret void
}
void delay(int c) {
  volatile int i;
  for (i = 0; i < c; i++)
    continue;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <delay+0x2d>
jmp    111f <delay+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp),%eax
cmp    %edi,%eax
jge    111f <delay+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <delay+0x10>
ret

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

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = load volatile i32, i32* %2
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp slt i32 %9, %0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
int test_sec_mem_clear(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @test_sec_mem_clear() {
ret i32 1
}
void _swap(int *a, int *b) {
  int temp = 0;
  temp = *a;
  *a = *b;
  *b = temp;
}


x86 assembly (clang, -O0):
<_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
char toAscii(char c) {
  if (c >= 32 && c <= 126)
    return c;
  return '.';
}


x86 assembly (clang, -O0):
<toAscii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jl     112f <toAscii+0x2f>
movsbl -0x2(%rbp),%eax
cmp    $0x7e,%eax
jg     112f <toAscii+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1133 <toAscii+0x33>
movb   $0x2e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toAscii>:
lea    -0x20(%rdi),%eax
cmp    $0x5f,%al
mov    $0x2e,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @toAscii(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 126
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %14
13: ; preds = %7, %1
store i8 46, i8* %2
br label %14
14: ; preds = %13, %11
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @toAscii(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = select i1 %3, i8 %0, i8 46
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ *getcwd(char *, int);
int /*<<< orphan*/ plintf(char *, char *);
int get_directory(char *direct) {
  if (getcwd(direct, 1024) == NULL) {
    plintf("%s\n", "Can't get current directory");
    *direct = '\0';
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<get_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x400,%esi
call   1030 <getcwd@plt>
cmp    $0x0,%rax
jne    116a <get_directory+0x4a>
lea    0xeb5(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <plintf@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1171 <get_directory+0x51>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_directory>:
push   %rbx
mov    %rdi,%rbx
mov    $0x400,%esi
call   1030 <getcwd@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113d <get_directory+0x1d>
pop    %rbx
ret
lea    0xebc(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <plintf@plt>
movb   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [28 x i8] c"Can't get current directory\00"
define i32 @get_directory(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32* @getcwd(i8* %4, i32 1024)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @plintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8*, i8** %3
store i8 0, i8* %9
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [28 x i8] c"Can't get current directory\00"
define i32 @get_directory(i8* %0) {
%2 = tail call i32* @getcwd(i8* %0, i32 1024)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @plintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
store i8 0, i8* %0
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
void add_data(int keys[8], int i, int data) { keys[i] = data; }


x86 assembly (clang, -O0):
<add_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_data>:
movslq %esi,%rax
mov    %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @add_data(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 %7, i32* %11
ret void
}

LLVM IR (-O2):
define void @add_data(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %2, i32* %5
ret void
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("p_bench_getpid [-d?] [-c count]\n");
  errno = 0;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
movq   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"p_bench_getpid [-d?] [-c count]\0A\00"
@errno = global i64 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i64 0, i64* @errno
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@str = [32 x i8] c"p_bench_getpid [-d?] [-c count]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
store i64 0, i64* @errno
ret void
}
/* Variables and functions */
scalar_t__ floor(double);
int my_round(double d) { return (int)floor(d + 0.5); }


x86 assembly (clang, -O0):
<my_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_round>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @my_round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = call i64 @floor(double %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @my_round(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call i64 @floor(double %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i < 10000000; i++)
    printf("\r%i", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x989680,-0x8(%rbp)
jge    1150 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x989680,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0D%i\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 10000000
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Type definitions */
struct timer_list {
  int dummy;
};
struct lock_class_key {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ init_timer_key(struct timer_list *, char const *,
                                  struct lock_class_key *);
void init_timer_on_stack_key(struct timer_list *timer, const char *name,
                             struct lock_class_key *key) {
  init_timer_key(timer, name, key);
}


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

x86 assembly (clang, -O2):
<init_timer_on_stack_key>:
jmp    1030 <init_timer_key@plt>

LLVM IR (-O0):
%struct.timer_list = type { i32 }
%struct.lock_class_key = type { i32 }
define void @init_timer_on_stack_key(%struct.timer_list* %0, i8* %1, %struct.lock_class_key* %2) {
%4 = alloca %struct.timer_list*
%5 = alloca i8*
%6 = alloca %struct.lock_class_key*
store %struct.timer_list* %0, %struct.timer_list** %4
store i8* %1, i8** %5
store %struct.lock_class_key* %2, %struct.lock_class_key** %6
%7 = load %struct.timer_list*, %struct.timer_list** %4
%8 = load i8*, i8** %5
%9 = load %struct.lock_class_key*, %struct.lock_class_key** %6
%10 = call i32 @init_timer_key(%struct.timer_list* %7, i8* %8, %struct.lock_class_key* %9)
ret void
}

LLVM IR (-O2):
%struct.timer_list = type { i32 }
%struct.lock_class_key = type { i32 }
define void @init_timer_on_stack_key(%struct.timer_list* %0, i8* %1, %struct.lock_class_key* %2) {
%4 = tail call i32 @init_timer_key(%struct.timer_list* %0, i8* %1, %struct.lock_class_key* %2)
ret void
}