xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ piece(char *, char, char *, int);
int /*<<< orphan*/ remove_parans(char *, char *);
int get_parameter(char *destination, char *source, int parameter_index) {
  char without_parans[128];
  remove_parans(without_parans, source);
  if (!piece(destination, ',', without_parans, parameter_index)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<get_parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <remove_parans@plt>
mov    -0x10(%rbp),%rdi
lea    -0xa0(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x2c,%esi
call   1040 <piece@plt>
cmp    $0x0,%eax
jne    1173 <get_parameter+0x53>
movl   $0x0,-0x4(%rbp)
jmp    117a <get_parameter+0x5a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_parameter>:
push   %rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <remove_parans@plt>
mov    %rbx,%rdi
mov    $0x2c,%esi
mov    %r14,%rdx
mov    %ebp,%ecx
call   1040 <piece@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_parameter(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [128 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%10 = load i8*, i8** %6
%11 = call i32 @remove_parans(i8* %9, i8* %10)
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%14 = load i32, i32* %7
%15 = call i32 @piece(i8* %12, i8 signext 44, i8* %13, i32 %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %3
store i32 0, i32* %4
br label %19
18: ; preds = %3
store i32 1, i32* %4
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @get_parameter(i8* %0, i8* %1, i32 %2) {
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = call i32 @remove_parans(i8* %5, i8* %1)
%7 = call i32 @piece(i8* %0, i8 signext 44, i8* %5, i32 %2)
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printusage_reader(char *program) {
  printf("Usage : %s input_patternfile(binary) output_patternfile(txt)\n\n",
         program);
}


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

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

LLVM IR (-O0):
@.str = [63 x i8] c"Usage : %s input_patternfile(binary) output_patternfile(txt)\0A\0A\00"
define void @printusage_reader(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"Usage : %s input_patternfile(binary) output_patternfile(txt)\0A\0A\00"
define void @printusage_reader(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void shell_remove_from_buffer(char *buffer, int *index) {
  index[0]--;
  buffer[*index] = 0;
}


x86 assembly (clang, -O0):
<shell_remove_from_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell_remove_from_buffer>:
movslq (%rsi),%rax
lea    -0x1(%rax),%rcx
mov    %ecx,(%rsi)
movb   $0x0,-0x1(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @shell_remove_from_buffer(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = add nsw i32 %7, -1
store i32 %8, i32* %6
%9 = load i8*, i8** %3
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
store i8 0, i8* %13
ret void
}

LLVM IR (-O2):
define void @shell_remove_from_buffer(i8* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
store i32 %4, i32* %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret void
}
void _ps2sdk_stdlib_init() {}


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

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

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

LLVM IR (-O2):
define void @_ps2sdk_stdlib_init() {
ret void
}
void RTFileCopyEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileCopyEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
unsigned long SPIIntNumberGet(unsigned long);
void SPIIntUnregister(unsigned long ulBase) {
  unsigned long ulInt;
  ulInt = SPIIntNumberGet(ulBase);
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<SPIIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <SPIIntNumberGet@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x10(%rbp),%rdi
call   1040 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIIntUnregister>:
push   %rbx
call   1050 <SPIIntNumberGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @SPIIntUnregister(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @SPIIntNumberGet(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @IntDisable(i64 %6)
%8 = load i64, i64* %3
%9 = call i32 @IntUnregister(i64 %8)
ret void
}

LLVM IR (-O2):
define void @SPIIntUnregister(i64 %0) {
%2 = tail call i64 @SPIIntNumberGet(i64 %0)
%3 = tail call i32 @IntDisable(i64 %2)
%4 = tail call i32 @IntUnregister(i64 %2)
ret void
}
long hash2(const char *s, long sz) {
  long h;
  for (h = 0; *s != '\0'; s++) {
    h = (long)*s + 31 * h;
  }
  return h % sz;
}


x86 assembly (clang, -O0):
<hash2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <hash2+0x49>
mov    -0x8(%rbp),%rax
movsbq (%rax),%rax
imul   $0x1f,-0x18(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <hash2+0x14>
mov    -0x18(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash2>:
mov    (%rdi),%cl
test   %cl,%cl
je     112e <hash2+0x2e>
add    $0x1,%rdi
xor    %edx,%edx
mov    %rdx,%rax
nop
movsbq %cl,%rcx
shl    $0x5,%rax
sub    %rdx,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %rax,%rdx
test   %cl,%cl
jne    1110 <hash2+0x10>
jmp    1130 <hash2+0x30>
xor    %eax,%eax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1145 <hash2+0x45>
cqto
idiv   %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @hash2(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 i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i64
%15 = load i64, i64* %5
%16 = mul nsw i64 31, %15
%17 = add nsw i64 %14, %16
store i64 %17, i64* %5
br label %18
18: ; preds = %11
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %6
21: ; preds = %6
%22 = load i64, i64* %5
%23 = load i64, i64* %4
%24 = srem i64 %22, %23
ret i64 %24
}

LLVM IR (-O2):
define i64 @hash2(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i64 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i64
%10 = mul nsw i64 %7, 31
%11 = add nsw i64 %10, %9
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 0, %2 ], [ %11, %5 ]
%17 = srem i64 %16, %1
ret i64 %17
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *old_entry,
                       struct list_head *new_entry) {
  list_replace(old_entry, new_entry);
  INIT_LIST_HEAD(old_entry);
}


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

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
/* Type definitions */
typedef int __u64;

/* Variables and functions */
__u64 ethtool_get_flow_spec_ring_vf(__u64 ring_cookie) {
  return (0x000000FF00000000LL & ring_cookie) >> 32;
}


x86 assembly (clang, -O0):
<ethtool_get_flow_spec_ring_vf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xff00000000,%rcx
and    %rcx,%rax
sar    $0x20,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ethtool_get_flow_spec_ring_vf>:
sar    $0x1f,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @ethtool_get_flow_spec_ring_vf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = and i64 1095216660480, %4
%6 = ashr i64 %5, 32
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @ethtool_get_flow_spec_ring_vf(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 255, i32 0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ si475xFMRX_powerdown();
void si47xxFMRX_powerdown(void) { si475xFMRX_powerdown(); }


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

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

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

LLVM IR (-O2):
define void @si47xxFMRX_powerdown() {
%1 = tail call i32 (...) @si475xFMRX_powerdown()
ret void
}
int cstrcmp(const char *s1, const char *s2) {
  while (*s1 == *s2++)
    if (*s1++ == 0)
      return (0);
  return (*(unsigned char *)s1 - *(unsigned char *)--s2);
}


x86 assembly (clang, -O0):
<cstrcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <cstrcmp+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <cstrcmp+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1178 <cstrcmp+0x78>
jmp    110c <cstrcmp+0xc>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
movzbl -0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstrcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%eax
movzbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <cstrcmp+0x27>
add    $0x1,%rcx
test   %eax,%eax
jne    1110 <cstrcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @cstrcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %17, label %3
13: ; preds = %3
%14 = zext i8 %6 to i32
%15 = zext i8 %7 to i32
%16 = sub nsw i32 %14, %15
br label %17
17: ; preds = %9, %13
%18 = phi i32 [ %16, %13 ], [ 0, %9 ]
ret i32 %18
}
char *getVersion() { return "0.12.6"; }


x86 assembly (clang, -O0):
<getVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"0.12.6\00"
define i8* @getVersion() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"0.12.6\00"
define i8* @getVersion() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
void INT_Excep_PERIA_INTA246(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA246() {
ret void
}
/* Variables and functions */
double wtime();
void udelay(unsigned int micros) {
  double __ts_end = wtime() + ((double)micros / 1000000);
  while (wtime() < __ts_end)
    ;
}


x86 assembly (clang, -O0):
<udelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
call   1030 <wtime@plt>
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm1
movsd  0xece(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <wtime@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115d <udelay+0x4d>
jmp    113f <udelay+0x2f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udelay>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <wtime@plt>
mov    %ebx,%eax
cvtsi2sd %rax,%xmm1
divsd  0xed3(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <wtime@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     1140 <udelay+0x30>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @udelay(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = call double (...) @wtime()
%5 = load i32, i32* %2
%6 = uitofp i32 %5 to double
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %4, %7
store double %8, double* %3
br label %9
9: ; preds = %13, %1
%10 = call double (...) @wtime()
%11 = load double, double* %3
%12 = fcmp olt double %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @udelay(i32 %0) {
%2 = tail call double (...) @wtime()
%3 = uitofp i32 %0 to double
%4 = fdiv double %3, 1.000000e+06
%5 = fadd double %4, %2
br label %6
6: ; preds = %6, %1
%7 = tail call double (...) @wtime()
%8 = fcmp olt double %7, %5
br i1 %8, label %6, label %9
9: ; preds = %6
ret void
}
/* Variables and functions */
char *make_return_packet(int /*<<< orphan*/);
char *gdb_search(long addr, long pat, long mask) {
  return (make_return_packet(0));
}


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

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

LLVM IR (-O0):
define i8* @gdb_search(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = call i8* @make_return_packet(i32 0)
ret i8* %7
}

LLVM IR (-O2):
define i8* @gdb_search(i64 %0, i64 %1, i64 %2) {
%4 = tail call i8* @make_return_packet(i32 0)
ret i8* %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
struct TYPE_4__ {
  TYPE_1__ xfocus;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xfocus_type(void *_p, int _v) {
  ((XEvent *)_p)->xfocus.type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xfocus_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xfocus_type(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xfocus_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
unsigned long sdbmhash(unsigned char *str) {
  unsigned long hash = 0;
  int c;
  while ((c = *str++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<sdbmhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1155 <sdbmhash+0x55>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <sdbmhash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdbmhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <sdbmhash+0x29>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <sdbmhash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @sdbmhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = zext i8 %5 to i64
%10 = mul i64 %7, 65599
%11 = add i64 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int escrMemoria(uint8_t opCode) {
  switch (opCode) {
  case 0x03:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<escrMemoria>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
jne    1124 <escrMemoria+0x24>
jmp    1118 <escrMemoria+0x18>
movl   $0x1,-0x4(%rbp)
jmp    112b <escrMemoria+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<escrMemoria>:
xor    %eax,%eax
cmp    $0x3,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @escrMemoria(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 3, label %5
]
5: ; preds = %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @escrMemoria(i32 %0) {
%2 = icmp eq i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
float min(float x) { return 0.0; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @min(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @min(float %0) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char const *,
                           unsigned int, unsigned char const *,
                           unsigned char const *);
int /*<<< orphan*/ stderr;
unsigned int arikkei_emit_fail_warning(const unsigned char *file,
                                       unsigned int line,
                                       const unsigned char *method,
                                       const unsigned char *expr) {
  fprintf(stderr, "File %s line %d (%s): Assertion %s failed\n", file, line,
          method, expr);
  return 1;
}


x86 assembly (clang, -O0):
<arikkei_emit_fail_warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arikkei_emit_fail_warning>:
push   %rax
mov    %rcx,%r9
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"File %s line %d (%s): Assertion %s failed\0A\00"
define i32 @arikkei_emit_fail_warning(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12, i8* %13)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"File %s line %d (%s): Assertion %s failed\0A\00"
define i32 @arikkei_emit_fail_warning(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i8* %3)
ret i32 1
}
/* Variables and functions */
int bar2();
int bar1(void) { return bar2(); }


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

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

LLVM IR (-O0):
define i32 @bar1() {
%1 = call i32 (...) @bar2()
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar1() {
%1 = tail call i32 (...) @bar2()
ret i32 %1
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void msleep(int ms) {
  struct timespec time;
  time.tv_sec = ms / 1000;
  time.tv_nsec = (ms % 1000) * (1000 * 1000);
  nanosleep(&time, NULL);
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @msleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = srem i32 %7, 1000
%9 = mul nsw i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @msleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
void yy_1_SemiPreLine(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_SemiPreLine(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit2(int);
void test4(int c) {
  isdigit2(c);
  isdigit2(10);
  isdigit2(-10);
}


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

x86 assembly (clang, -O2):
<test4>:
push   %rax
call   1030 <isdigit2@plt>
mov    $0xa,%edi
call   1030 <isdigit2@plt>
mov    $0xfffffff6,%edi
pop    %rax
jmp    1030 <isdigit2@plt>

LLVM IR (-O0):
define void @test4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isdigit2(i32 %3)
%5 = call i32 @isdigit2(i32 10)
%6 = call i32 @isdigit2(i32 -10)
ret void
}

LLVM IR (-O2):
define void @test4(i32 %0) {
%2 = tail call i32 @isdigit2(i32 %0)
%3 = tail call i32 @isdigit2(i32 10)
%4 = tail call i32 @isdigit2(i32 -10)
ret void
}
void XrmSetDatabase() {}


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

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

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

LLVM IR (-O2):
define void @XrmSetDatabase() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ReadEvent(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void ClearRunningStatus(void) { ReadEvent(NULL, NULL); }


x86 assembly (clang, -O0):
<ClearRunningStatus>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <ReadEvent@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearRunningStatus>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <ReadEvent@plt>

LLVM IR (-O0):
define void @ClearRunningStatus() {
%1 = call i32 @ReadEvent(i32* null, i32* null)
ret void
}

LLVM IR (-O2):
define void @ClearRunningStatus() {
%1 = tail call i32 @ReadEvent(i32* null, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MT_initialize(unsigned long);
int /*<<< orphan*/ reload();
void MT_seedfinal(unsigned long oneSeed) {
  MT_initialize(oneSeed);
  reload();
}


x86 assembly (clang, -O0):
<MT_seedfinal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <MT_initialize@plt>
mov    $0x0,%al
call   1030 <reload@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MT_seedfinal>:
push   %rax
call   1040 <MT_initialize@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <reload@plt>

LLVM IR (-O0):
define void @MT_seedfinal(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @MT_initialize(i64 %3)
%5 = call i32 (...) @reload()
ret void
}

LLVM IR (-O2):
define void @MT_seedfinal(i64 %0) {
%2 = tail call i32 @MT_initialize(i64 %0)
%3 = tail call i32 (...) @reload()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() { printf("Usage:\r\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"Usage:\0D\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int recv(int, char *, int, int /*<<< orphan*/);
int receber(int sock, char *buf, int size) {
  int num;
  if ((num = recv(sock, buf, size, 0)) == -1) {
    perror("recv");
    return 0;
  }
  buf[num] = '\0';
  return 1;
}


x86 assembly (clang, -O0):
<receber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    1167 <receber+0x47>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    117a <receber+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receber>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %ebp,%ebp
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     1148 <receber+0x28>
cltq
movb   $0x0,(%rbx,%rax,1)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
jmp    113f <receber+0x1f>

LLVM IR (-O0):
@.str = [5 x i8] c"recv\00"
define i32 @receber(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call i32 @recv(i32 %9, i8* %10, i32 %11, i32 0)
store i32 %12, i32* %8
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %21
16: ; preds = %3
%17 = load i8*, i8** %6
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 0, i8* %20
store i32 1, i32* %4
br label %21
21: ; preds = %16, %14
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@.str = [5 x i8] c"recv\00"
define i32 @receber(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %3
%9 = sext i32 %4 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ 0, %6 ], [ 1, %8 ]
ret i32 %12
}
/* Type definitions */
struct mat3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat3_adjugate(float *, float *);
__attribute__((always_)) struct mat3 *psmat3_adjugate(struct mat3 *result,
                                                      struct mat3 *m) {
  mat3_adjugate((float *)result, (float *)m);
  return result;
}


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

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

LLVM IR (-O0):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_adjugate(%struct.mat3* %0, %struct.mat3* %1) {
%3 = alloca %struct.mat3*
%4 = alloca %struct.mat3*
store %struct.mat3* %0, %struct.mat3** %3
store %struct.mat3* %1, %struct.mat3** %4
%5 = load %struct.mat3*, %struct.mat3** %3
%6 = bitcast %struct.mat3* %5 to float*
%7 = load %struct.mat3*, %struct.mat3** %4
%8 = bitcast %struct.mat3* %7 to float*
%9 = call i32 @mat3_adjugate(float* %6, float* %8)
%10 = load %struct.mat3*, %struct.mat3** %3
ret %struct.mat3* %10
}

LLVM IR (-O2):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_adjugate(%struct.mat3* returned %0, %struct.mat3* %1) {
%3 = bitcast %struct.mat3* %0 to float*
%4 = bitcast %struct.mat3* %1 to float*
%5 = tail call i32 @mat3_adjugate(float* %3, float* %4)
ret %struct.mat3* %0
}
int foo(char x) { return 0; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i8 signext %0) {
ret i32 0
}
int test_imm_06int64_midword_reg(long long val) {
  return ((val >> 16) & (0x06 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_06int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_06int64_midword_reg>:
test   $0x60000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_06int64_midword_reg(i64 %0) {
%2 = and i64 %0, 393216
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int fun1238() { return 1238; }


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

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

LLVM IR (-O0):
define i32 @fun1238() {
ret i32 1238
}

LLVM IR (-O2):
define i32 @fun1238() {
ret i32 1238
}
/* Variables and functions */
void putc(char c) {
  unsigned int *base;
  base = (unsigned int *)0xF0300000;
  while ((*(base + 2) & 1) == 0)
    ;
  *(base + 3) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xf0300000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    112b <putc+0x2b>
jmp    1113 <putc+0x13>
movsbl -0x1(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
mov    $0xf0300008,%eax
testb  $0x1,(%rax)
jne    1112 <putc+0x12>
nopw   0x0(%rax,%rax,1)
jmp    1110 <putc+0x10>
movsbl %dil,%ecx
mov    %ecx,0x4(%rax)
ret

LLVM IR (-O0):
define void @putc(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32*
store i8 %0, i8* %2
store i32* inttoptr (i64 4029677568 to i32*), i32** %3
br label %4
4: ; preds = %10, %1
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load i32, i32* %6
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %4
br label %4
11: ; preds = %4
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 3
store i32 %13, i32* %15
ret void
}

LLVM IR (-O2):
define void @putc(i8 signext %0) {
%2 = load i32, i32* inttoptr (i64 4029677576 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1, %5
br label %5
6: ; preds = %1
%7 = sext i8 %0 to i32
store i32 %7, i32* inttoptr (i64 4029677580 to i32*)
ret void
}
/* Variables and functions */
int local_endian();
int compare_endian(int eEndian) { return local_endian() ^ (eEndian == 0); }


x86 assembly (clang, -O0):
<compare_endian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <local_endian@plt>
cmpl   $0x0,-0x4(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_endian>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <local_endian@plt>
xor    %ecx,%ecx
test   %ebx,%ebx
sete   %cl
xor    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @compare_endian(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @local_endian()
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = xor i32 %3, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @compare_endian(i32 %0) {
%2 = tail call i32 (...) @local_endian()
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
%5 = xor i32 %2, %4
ret i32 %5
}
/* Type definitions */
struct lwan {
  int dummy;
};

/* Variables and functions */
void lwan_status_shutdown(struct lwan *l __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
%struct.lwan = type { i32 }
define void @lwan_status_shutdown(%struct.lwan* nocapture %0) {
ret void
}
/* Type definitions */
struct stack_st_OPENSSL_STRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int OPENSSL_sk_push(int /*<<< orphan*/ *, void const *);
int sk_OPENSSL_STRING_push(struct stack_st_OPENSSL_STRING *sk, char *ptr) {
  return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_STRING_push>:
jmp    1030 <OPENSSL_sk_push@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define i32 @sk_OPENSSL_STRING_push(%struct.stack_st_OPENSSL_STRING* %0, i8* %1) {
%3 = alloca %struct.stack_st_OPENSSL_STRING*
%4 = alloca i8*
store %struct.stack_st_OPENSSL_STRING* %0, %struct.stack_st_OPENSSL_STRING** %3
store i8* %1, i8** %4
%5 = load %struct.stack_st_OPENSSL_STRING*, %struct.stack_st_OPENSSL_STRING** %3
%6 = bitcast %struct.stack_st_OPENSSL_STRING* %5 to i32*
%7 = load i8*, i8** %4
%8 = call i32 @OPENSSL_sk_push(i32* %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define i32 @sk_OPENSSL_STRING_push(%struct.stack_st_OPENSSL_STRING* %0, i8* %1) {
%3 = getelementptr %struct.stack_st_OPENSSL_STRING, %struct.stack_st_OPENSSL_STRING* %0, i64 0, i32 0
%4 = tail call i32 @OPENSSL_sk_push(i32* %3, i8* %1)
ret i32 %4
}
void foo_2_2_1_2_1_1_1_1_2() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct stack *);
void deletestack(struct stack *stk) { free(stk); }


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

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

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

LLVM IR (-O2):
%struct.stack = type { i32 }
define void @deletestack(%struct.stack* nocapture %0) {
%2 = tail call i32 @free(%struct.stack* %0)
ret void
}
unsigned long rdtscllp(void) {
  unsigned int a, d;
  asm volatile("rdtscp" : "=a"(a), "=d"(d) : : "%rbx", "%rcx");
  return ((unsigned long)a) | (((unsigned long)d) << 32);
}


x86 assembly (clang, -O0):
<rdtscllp>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
rdtscp
mov    %eax,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtscllp>:
push   %rbx
rdtscp
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
pop    %rbx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @SPI_RP_SaveConfig() {
ret void
}
int test_imm_8Duint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x8D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Duint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x8d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Duint64_highword_reg>:
movabs $0x8d00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Duint64_highword_reg(i64 %0) {
%2 = and i64 %0, 605590388736
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_outl(unsigned int, unsigned short);
void outl(unsigned int value, unsigned short port) {
  __builtin_outl(value, port);
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
movzwl -0x6(%rbp),%esi
call   1030 <__builtin_outl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl>:
jmp    1030 <__builtin_outl@plt>

LLVM IR (-O0):
define void @outl(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
%7 = call i32 @__builtin_outl(i32 %5, i16 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @outl(i32 %0, i16 zeroext %1) {
%3 = tail call i32 @__builtin_outl(i32 %0, i16 zeroext %1)
ret void
}