xunge/DecIR huggingface dataset:
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char toupper(char);
char get_command(void) {
  char command, ignore;
  printf("Enter (D)elete, (I)nsert, (F)ind or (Q)uit: ");
  scanf(" %c", &command);
  do
    ignore = getchar();
  while (ignore != '\n');
  return (toupper(command));
}


x86 assembly (clang, -O0):
<get_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jne    1164 <get_command+0x24>
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_command>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1060 <scanf@plt>
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    1160 <get_command+0x20>
movsbl 0x7(%rsp),%edi
call   1030 <toupper@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Enter (D)elete, (I)nsert, (F)ind or (Q)uit: \00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @get_command() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %5
5: ; preds = %7, %0
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %2
br label %7
7: ; preds = %5
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %5, label %11
11: ; preds = %7
%12 = load i8, i8* %1
%13 = call signext i8 @toupper(i8 signext %12)
ret i8 %13
}

LLVM IR (-O2):
@.str = [45 x i8] c"Enter (D)elete, (I)nsert, (F)ind or (Q)uit: \00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @get_command() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %4
4: ; preds = %4, %0
%5 = call signext i8 (...) @getchar()
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %4
7: ; preds = %4
%8 = load i8, i8* %1
%9 = call signext i8 @toupper(i8 signext %8)
ret i8 %9
}
/* Type definitions */
struct dbuf {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ freaduntil(int, struct dbuf *, struct dbuf *, char, size_t);
ssize_t freadline(int fd, struct dbuf *buffer, struct dbuf *overflow,
                  size_t readbytes) {
  return freaduntil(fd, buffer, overflow, '\n', readbytes);
}


x86 assembly (clang, -O0):
<freadline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    $0xa,%ecx
call   1030 <freaduntil@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freadline>:
mov    %rcx,%r8
mov    $0xa,%ecx
jmp    1030 <freaduntil@plt>

LLVM IR (-O0):
%struct.dbuf = type { i32 }
define i32 @freadline(i32 %0, %struct.dbuf* %1, %struct.dbuf* %2, i64 %3) {
%5 = alloca i32
%6 = alloca %struct.dbuf*
%7 = alloca %struct.dbuf*
%8 = alloca i64
store i32 %0, i32* %5
store %struct.dbuf* %1, %struct.dbuf** %6
store %struct.dbuf* %2, %struct.dbuf** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load %struct.dbuf*, %struct.dbuf** %6
%11 = load %struct.dbuf*, %struct.dbuf** %7
%12 = load i64, i64* %8
%13 = call i32 @freaduntil(i32 %9, %struct.dbuf* %10, %struct.dbuf* %11, i8 signext 10, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.dbuf = type { i32 }
define i32 @freadline(i32 %0, %struct.dbuf* %1, %struct.dbuf* %2, i64 %3) {
%5 = tail call i32 @freaduntil(i32 %0, %struct.dbuf* %1, %struct.dbuf* %2, i8 signext 10, i64 %3)
ret i32 %5
}
void ff_hevc_put_hevc_epel_h24_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h24_12_sse4() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t getMinBitCount(uint32_t size) { return (size * 11 + 7) >> 3; }


x86 assembly (clang, -O0):
<getMinBitCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xb,-0x4(%rbp),%eax
add    $0x7,%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMinBitCount>:
lea    (%rdi,%rdi,4),%eax
lea    (%rdi,%rax,2),%eax
add    $0x7,%eax
sar    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @getMinBitCount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 11
%5 = add nsw i32 %4, 7
%6 = ashr i32 %5, 3
ret i32 %6
}

LLVM IR (-O2):
define i32 @getMinBitCount(i32 %0) {
%2 = mul nsw i32 %0, 11
%3 = add nsw i32 %2, 7
%4 = ashr i32 %3, 3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ command_process(int, char **);
int main(int argc, char **argv) {
  command_process(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @command_process(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
unsigned int getParameter(unsigned int, int);
int /*<<< orphan*/ writeMessage(unsigned int, unsigned int);
unsigned int wrapper_writeMailBox(unsigned int pc, unsigned int sp,
                                  unsigned int spsr) {
  unsigned int nBuz = getParameter(sp, 0);
  unsigned int messageDir = getParameter(sp, 1);
  writeMessage(nBuz, messageDir);
  return sp;
}


x86 assembly (clang, -O0):
<wrapper_writeMailBox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1040 <getParameter@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1040 <getParameter@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <writeMessage@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapper_writeMailBox>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %esi,%edi
xor    %esi,%esi
call   1040 <getParameter@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x1,%esi
call   1040 <getParameter@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <writeMessage@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @wrapper_writeMailBox(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = call i32 @getParameter(i32 %9, i32 0)
store i32 %10, i32* %7
%11 = load i32, i32* %5
%12 = call i32 @getParameter(i32 %11, i32 1)
store i32 %12, i32* %8
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = call i32 @writeMessage(i32 %13, i32 %14)
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @wrapper_writeMailBox(i32 %0, i32 returned %1, i32 %2) {
%4 = tail call i32 @getParameter(i32 %1, i32 0)
%5 = tail call i32 @getParameter(i32 %1, i32 1)
%6 = tail call i32 @writeMessage(i32 %4, i32 %5)
ret i32 %1
}
int equal_int(void *ip, void *jp) { return *((int *)ip) == *((int *)jp); }


x86 assembly (clang, -O0):
<equal_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_int>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @equal_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @equal_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void gen_color(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _list_splice(struct list_head *, struct list_head *);
int /*<<< orphan*/ list_empty(struct list_head *);
void list_splice(struct list_head *list, struct list_head *head) {
  if (!list_empty(list))
    _list_splice(list, head);
}


x86 assembly (clang, -O0):
<list_splice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <list_empty@plt>
cmp    $0x0,%eax
jne    114f <list_splice+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_list_splice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_splice>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <list_empty@plt>
test   %eax,%eax
je     113b <list_splice+0x1b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <_list_splice@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_splice(%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 = call i32 @list_empty(%struct.list_head* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load %struct.list_head*, %struct.list_head** %3
%10 = load %struct.list_head*, %struct.list_head** %4
%11 = call i32 @_list_splice(%struct.list_head* %9, %struct.list_head* %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_splice(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_empty(%struct.list_head* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @_list_splice(%struct.list_head* %0, %struct.list_head* %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long quot;
  long rem;
};
typedef TYPE_1__ ldiv_t;

/* Variables and functions */
ldiv_t ldiv(long numer, long denom) {
  ldiv_t ret;
  ret.quot = numer / denom;
  ret.rem = numer % denom;
  return ret;
}


x86 assembly (clang, -O0):
<ldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <ldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = sdiv i64 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = srem i64 %10, %11
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i64 %12, i64* %13
%14 = bitcast %struct.TYPE_3__* %3 to { i64, i64 }*
%15 = load { i64, i64 }, { i64, i64 }* %14
ret { i64, i64 } %15
}

LLVM IR (-O2):
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = srem i64 %0, %1
%5 = insertvalue { i64, i64 } poison, i64 %3, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
/* Variables and functions */
char toupper(char);
char *up_string(char *s) {
  char *hold = s;
  while (*s) {
    *s = toupper(*s);
    s++;
  }
  return hold;
}


x86 assembly (clang, -O0):
<up_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <up_string+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <up_string+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<up_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <up_string+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <up_string+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @up_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = call signext i8 @toupper(i8 signext %11)
%13 = load i8*, i8** %2
store i8 %12, i8* %13
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
br label %5
16: ; preds = %5
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @up_string(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
int execute_setitimer() { return 0; }


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

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

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

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

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ POLICY_MAPPING_it;
POLICY_MAPPING *POLICY_MAPPING_new(void) {
  return (POLICY_MAPPING *)ASN1_item_new(&POLICY_MAPPING_it);
}


x86 assembly (clang, -O0):
<POLICY_MAPPING_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<POLICY_MAPPING_new>:
mov    0x2ed1(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@POLICY_MAPPING_it = global i32 0
define i32* @POLICY_MAPPING_new() {
%1 = call i64 @ASN1_item_new(i32* @POLICY_MAPPING_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@POLICY_MAPPING_it = global i32 0
define i32* @POLICY_MAPPING_new() {
%1 = tail call i64 @ASN1_item_new(i32* @POLICY_MAPPING_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
int TestAccessProc3(path, mode) const char *path;
int mode;
{ return ((strstr(path, "testAccess3%.fil") == 0) ? -1 : 0); }


x86 assembly (clang, -O0):
<TestAccessProc3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestAccessProc3>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"testAccess3%.fil\00"
define i32 @TestAccessProc3(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i8* @strstr(i8* %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i8* %6, null
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -1, i32 0
ret i32 %9
}

LLVM IR (-O2):
@.str = [17 x i8] c"testAccess3%.fil\00"
define i32 @TestAccessProc3(i8* %0, i32 %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
%5 = sext i1 %4 to i32
ret i32 %5
}
void genbc1f() {}


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

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

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

LLVM IR (-O2):
define void @genbc1f() {
ret void
}
int hwp_hex(int c) {
  return ((c >= 'a') && (c <= 'f'))   ? c - 'a' + 10
         : ((c >= '0') && (c <= '9')) ? c - '0'
         : ((c >= 'A') && (c <= 'F')) ? c - 'A' + 10
                                      : -1;
}


x86 assembly (clang, -O0):
<hwp_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     112c <hwp_hex+0x2c>
cmpl   $0x66,-0x4(%rbp)
jg     112c <hwp_hex+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    118c <hwp_hex+0x8c>
cmpl   $0x30,-0x4(%rbp)
jl     114e <hwp_hex+0x4e>
cmpl   $0x39,-0x4(%rbp)
jg     114e <hwp_hex+0x4e>
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    1186 <hwp_hex+0x86>
cmpl   $0x41,-0x4(%rbp)
jl     1173 <hwp_hex+0x73>
cmpl   $0x46,-0x4(%rbp)
jg     1173 <hwp_hex+0x73>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x10(%rbp)
jmp    1180 <hwp_hex+0x80>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1180 <hwp_hex+0x80>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hwp_hex>:
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     110e <hwp_hex+0xe>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <hwp_hex+0x27>
lea    -0x41(%rdi),%eax
add    $0xffffffc9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @hwp_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 102
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 97
%11 = add nsw i32 %10, 10
br label %36
12: ; preds = %5, %1
%13 = load i32, i32* %2
%14 = icmp sge i32 %13, 48
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 57
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %2
%20 = sub nsw i32 %19, 48
br label %34
21: ; preds = %15, %12
%22 = load i32, i32* %2
%23 = icmp sge i32 %22, 65
br i1 %23, label %24, label %31
24: ; preds = %21
%25 = load i32, i32* %2
%26 = icmp sle i32 %25, 70
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = load i32, i32* %2
%29 = sub nsw i32 %28, 65
%30 = add nsw i32 %29, 10
br label %32
31: ; preds = %24, %21
br label %32
32: ; preds = %31, %27
%33 = phi i32 [ %30, %27 ], [ -1, %31 ]
br label %34
34: ; preds = %32, %18
%35 = phi i32 [ %20, %18 ], [ %33, %32 ]
br label %36
36: ; preds = %34, %8
%37 = phi i32 [ %11, %8 ], [ %35, %34 ]
ret i32 %37
}

LLVM IR (-O2):
define i32 @hwp_hex(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nsw i32 %0, -87
br label %14
6: ; preds = %1
%7 = add i32 %0, -48
%8 = icmp ult i32 %7, 10
br i1 %8, label %14, label %9
9: ; preds = %6
%10 = add i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -55
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %6, %9, %4
%15 = phi i32 [ %5, %4 ], [ %13, %9 ], [ %7, %6 ]
ret i32 %15
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_GREEN_LED_PIN() { return 0x01 & (inp_emulate(0x38) >> 6); }


x86 assembly (clang, -O0):
<TOSH_READ_GREEN_LED_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
call   1030 <inp_emulate@plt>
sar    $0x6,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_GREEN_LED_PIN>:
push   %rax
mov    $0x38,%edi
call   1030 <inp_emulate@plt>
shr    $0x6,%al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_GREEN_LED_PIN() {
%1 = call i32 @inp_emulate(i32 56)
%2 = ashr i32 %1, 6
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_GREEN_LED_PIN() {
%1 = tail call i32 @inp_emulate(i32 56)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 6
%4 = and i8 %3, 1
ret i8 %4
}
/* Type definitions */
struct YsGLSL3DRenderer {
  int dummy;
};

/* Variables and functions */
struct YsGLSL3DRenderer *YsGLSLCreateVariColorBillBoard3DRenderer();
struct YsGLSL3DRenderer *YsGLSLCreateMonoColorBillBoard3DRenderer(void) {
  return YsGLSLCreateVariColorBillBoard3DRenderer();
}


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

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

LLVM IR (-O0):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateMonoColorBillBoard3DRenderer() {
%1 = call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColorBillBoard3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}

LLVM IR (-O2):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateMonoColorBillBoard3DRenderer() {
%1 = tail call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColorBillBoard3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}
void vlib_stats_delete_cm(void *notused) {}


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

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

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

LLVM IR (-O2):
define void @vlib_stats_delete_cm(i8* nocapture %0) {
ret void
}
double cond_dummy_size(const struct XCSF *xcsf, const struct Cl *c) {
  (void)xcsf;
  (void)c;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define double @cond_dummy_size(%struct.XCSF* %0, %struct.Cl* %1) {
%3 = alloca %struct.XCSF*
%4 = alloca %struct.Cl*
store %struct.XCSF* %0, %struct.XCSF** %3
store %struct.Cl* %1, %struct.Cl** %4
%5 = load %struct.XCSF*, %struct.XCSF** %3
%6 = load %struct.Cl*, %struct.Cl** %4
ret double 0.000000e+00
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define double @cond_dummy_size(%struct.XCSF* nocapture readnone %0, %struct.Cl* nocapture readnone %1) {
ret double 0.000000e+00
}
int power_of_two_greater_than(int x) {
  x--;
  x |= (x >> 1);
  x |= (x >> 2);
  x |= (x >> 4);
  x |= (x >> 8);
  x |= (x >> 16);
  return (x + 1);
}


x86 assembly (clang, -O0):
<power_of_two_greater_than>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_of_two_greater_than>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @power_of_two_greater_than(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
ret i32 %26
}

LLVM IR (-O2):
define i32 @power_of_two_greater_than(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t unicode_reverse_byte_order_utf16(uint16_t value, bool reverse) {
  if (reverse)
    return ((value << 8) & 0xFF00) | ((value >> 8) & 0x00FF);
  else
    return value;
}


x86 assembly (clang, -O0):
<unicode_reverse_byte_order_utf16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1135 <unicode_reverse_byte_order_utf16+0x35>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    113b <unicode_reverse_byte_order_utf16+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unicode_reverse_byte_order_utf16>:
mov    %edi,%eax
rol    $0x8,%ax
test   %esi,%esi
movzwl %ax,%eax
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @unicode_reverse_byte_order_utf16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i32, i32* %4
%10 = shl i32 %9, 8
%11 = and i32 %10, 65280
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = or i32 %11, %14
store i32 %15, i32* %3
br label %18
16: ; preds = %2
%17 = load i32, i32* %4
store i32 %17, i32* %3
br label %18
18: ; preds = %16, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @unicode_reverse_byte_order_utf16(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = trunc i32 %0 to i16
%5 = tail call i16 @llvm.bswap.i16(i16 %4)
%6 = zext i16 %5 to i32
%7 = select i1 %3, i32 %0, i32 %6
ret i32 %7
}
unsigned int str_array_len(const char **arr) {
  unsigned int i = 0;
  while (arr && arr[i]) {
    i += 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<str_array_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1131 <str_array_len+0x31>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpq   $0x0,(%rax,%rcx,8)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1141 <str_array_len+0x41>
jmp    114f <str_array_len+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_array_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_array_len>:
test   %rdi,%rdi
je     111b <str_array_len+0x1b>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi,%rax,8)
jne    1110 <str_array_len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_array_len(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
%9 = add i32 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %4, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
void *realloc(void *ptr, size_t size) {
  void *tmp;
  tmp = malloc(size);
  if (!tmp)
    return NULL;
  if (ptr) {
    memcpy((char *)tmp, (char *)ptr, size);
    free(ptr);
  }
  return tmp;
}


x86 assembly (clang, -O0):
<realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1165 <realloc+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1192 <realloc+0x62>
cmpq   $0x0,-0x10(%rbp)
je     118a <realloc+0x5a>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %r14,%r14
je     1166 <realloc+0x36>
test   %rbx,%rbx
je     1166 <realloc+0x36>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %2
store i8* null, i8** %3
br label %24
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i8*, i8** %6
%17 = load i8*, i8** %4
%18 = load i64, i64* %5
%19 = call i32 @memcpy(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %4
%21 = call i32 @free(i8* %20)
br label %22
22: ; preds = %15, %12
%23 = load i8*, i8** %6
store i8* %23, i8** %3
br label %24
24: ; preds = %22, %11
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @realloc(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp eq i8* %0, null
%6 = or i1 %5, %4
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
%9 = tail call i32 @free(i8* %0)
br label %10
10: ; preds = %7, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ xprintf(char *, char *);
void die(char *why) { xprintf("FATAL: %s\n", why); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"FATAL: %s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @xprintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"FATAL: %s\0A\00"
define void @die(i8* %0) {
%2 = tail call i32 @xprintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_splice(struct list_head const *, struct list_head *);
int /*<<< orphan*/ list_empty(struct list_head const *);
void list_splice(const struct list_head *list, struct list_head *head) {
  if (!list_empty(list))
    __list_splice(list, head);
}


x86 assembly (clang, -O0):
<list_splice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <list_empty@plt>
cmp    $0x0,%eax
jne    114f <list_splice+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__list_splice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_splice>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <list_empty@plt>
test   %eax,%eax
je     113b <list_splice+0x1b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__list_splice@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_splice(%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 = call i32 @list_empty(%struct.list_head* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load %struct.list_head*, %struct.list_head** %3
%10 = load %struct.list_head*, %struct.list_head** %4
%11 = call i32 @__list_splice(%struct.list_head* %9, %struct.list_head* %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_splice(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_empty(%struct.list_head* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @__list_splice(%struct.list_head* %0, %struct.list_head* %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
char *malloc(int const);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *copyBuffer(const char *buffer) {
  const int bufferLen = strlen(buffer) + 1;
  char *output = malloc(bufferLen * sizeof(char));
  if (output) {
    strcpy(output, buffer);
  }
  return output;
}


x86 assembly (clang, -O0):
<copyBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1176 <copyBuffer+0x46>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyBuffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1157 <copyBuffer+0x27>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copyBuffer(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 1
%11 = trunc i64 %10 to i32
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %19
15: ; preds = %1
%16 = load i8*, i8** %4
%17 = load i8*, i8** %2
%18 = call i32 @strcpy(i8* %16, i8* %17)
br label %19
19: ; preds = %15, %1
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
define i8* @copyBuffer(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int pot, n;
  pot = n * n;
  printf("entre com um número: ");
  scanf("%d", &n);
  printf("pot=%d", pot);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"entre com um n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"pot=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %3
%5 = load i32, i32* %3
%6 = mul nsw i32 %4, %5
store i32 %6, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"entre com um n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"pot=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 undef)
ret i32 0
}
void border_nesw_double_diagonal_special_sand_only(unsigned char *pic,
                                                   unsigned char *mirr) {
  *pic = 0x2A;
  *mirr = 0x02;
}


x86 assembly (clang, -O0):
<border_nesw_double_diagonal_special_sand_only>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2a,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_nesw_double_diagonal_special_sand_only>:
movb   $0x2a,(%rdi)
movb   $0x2,(%rsi)
ret

LLVM IR (-O0):
define void @border_nesw_double_diagonal_special_sand_only(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
store i8 42, i8* %5
%6 = load i8*, i8** %4
store i8 2, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_nesw_double_diagonal_special_sand_only(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 42, i8* %0
store i8 2, i8* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int, int);
void draw_node(FILE *fp, int x, int y, char *id) {
  fprintf(fp, "(%s) %d %d node\n", id, x, y);
}


x86 assembly (clang, -O0):
<draw_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_node>:
mov    %edx,%r8d
mov    %esi,%eax
lea    0xee4(%rip),%rsi
mov    %rcx,%rdx
mov    %eax,%ecx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"(%s) %d %d node\0A\00"
define void @draw_node(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = load i8*, i8** %8
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"(%s) %d %d node\0A\00"
define void @draw_node(i32* nocapture %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t __ashldi3(uint64_t v, int cnt) {
  int c = cnt & 31;
  uint32_t vl = (uint32_t)v;
  uint32_t vh = (uint32_t)(v >> 32);
  if (cnt & 32) {
    vh = (vl << c);
    vl = 0;
  } else {
    vh = (vh << c) + (vl >> (32 - c));
    vl = (vl << c);
  }
  return ((uint64_t)vh << 32) + vl;
}


x86 assembly (clang, -O0):
<__ashldi3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     114c <__ashldi3+0x4c>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    1173 <__ashldi3+0x73>
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x10(%rbp),%edx
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__ashldi3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = and i32 %8, 31
store i32 %9, i32* %5
%10 = load i32, i32* %3
store i32 %10, i32* %6
%11 = load i32, i32* %3
%12 = ashr i32 %11, 32
store i32 %12, i32* %7
%13 = load i32, i32* %4
%14 = and i32 %13, 32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %2
%17 = load i32, i32* %6
%18 = load i32, i32* %5
%19 = shl i32 %17, %18
store i32 %19, i32* %7
store i32 0, i32* %6
br label %32
20: ; preds = %2
%21 = load i32, i32* %7
%22 = load i32, i32* %5
%23 = shl i32 %21, %22
%24 = load i32, i32* %6
%25 = load i32, i32* %5
%26 = sub nsw i32 32, %25
%27 = ashr i32 %24, %26
%28 = add nsw i32 %23, %27
store i32 %28, i32* %7
%29 = load i32, i32* %6
%30 = load i32, i32* %5
%31 = shl i32 %29, %30
store i32 %31, i32* %6
br label %32
32: ; preds = %20, %16
%33 = load i32, i32* %7
%34 = shl i32 %33, 32
%35 = load i32, i32* %6
%36 = add nsw i32 %34, %35
ret i32 %36
}

LLVM IR (-O2):
define i32 @__ashldi3(i32 %0, i32 %1) {
ret i32 poison
}
void Affiche_Explication() {}


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

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

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

LLVM IR (-O2):
define void @Affiche_Explication() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushpul(int /*<<< orphan*/);
stacks() { pushpul(0); }


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

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

LLVM IR (-O0):
define i32 @stacks() {
%1 = alloca i32
%2 = call i32 @pushpul(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @stacks() {
%1 = tail call i32 @pushpul(i32 0)
ret i32 undef
}
void ff_hevc_put_hevc_uni_w_qpel_v24_10_sse4() {}


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

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

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

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