xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
char *trimWhitespace(char *);
char *strcpyAndTrim(const char *str, int len) {
  char *newStr = malloc(len + 256);
  memset(newStr, 0, len + 256);
  memcpy(newStr, str, len + 1);
  newStr[len] = 0;
  return trimWhitespace(newStr);
}


x86 assembly (clang, -O0):
<strcpyAndTrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x100,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
call   1030 <trimWhitespace@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpyAndTrim>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x100(%r15),%ebp
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <memset@plt>
lea    0x1(%r15),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <trimWhitespace@plt>

LLVM IR (-O0):
define i8* @strcpyAndTrim(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 256
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 256
%12 = call i32 @memset(i8* %9, i32 0, i32 %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = call i32 @memcpy(i8* %13, i8* %14, i32 %16)
%18 = load i8*, i8** %5
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 0, i8* %21
%22 = load i8*, i8** %5
%23 = call i8* @trimWhitespace(i8* %22)
ret i8* %23
}

LLVM IR (-O2):
define i8* @strcpyAndTrim(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 256
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i32 %3)
%6 = add nsw i32 %1, 1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %6)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
store i8 0, i8* %9
%10 = tail call i8* @trimWhitespace(i8* %4)
ret i8* %10
}
void foo028(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo028(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
long sys_epoll_ctl(va_list ap) {
  assert(!"sys_epoll_ctl not implemented");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"sys_epoll_ctl not implemented\00"
define i64 @sys_epoll_ctl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @assert(i32 0)
ret i64 0
}

LLVM IR (-O2):
define i64 @sys_epoll_ctl(i32 %0) {
%2 = tail call i32 @assert(i32 0)
ret i64 0
}
/* Variables and functions */
int memcmp(unsigned char *, unsigned char *, int);
int compare_suffix(unsigned char *suffix_string, int suffix_len,
                   unsigned char *str, int str_len) {
  if (suffix_len != str_len)
    return suffix_len - str_len;
  return memcmp(suffix_string, str, str_len);
}


x86 assembly (clang, -O0):
<compare_suffix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     1140 <compare_suffix+0x30>
mov    -0x14(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <compare_suffix+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_suffix>:
mov    %esi,%eax
sub    %ecx,%eax
jne    1124 <compare_suffix+0x14>
mov    %esi,%r8d
mov    %rdx,%rsi
mov    %r8d,%edx
jmp    1030 <memcmp@plt>
ret

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

LLVM IR (-O2):
define i32 @compare_suffix(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, %3
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = sub nsw i32 %1, %3
br label %10
8: ; preds = %4
%9 = tail call i32 @memcmp(i8* %0, i8* %2, i32 %1)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
int storage(void) {
  typedef int p;
  auto int x;
  extern int y;
  register int t;
  static int l;
}


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

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

LLVM IR (-O0):
@storage.l = internal global i32 0
define i32 @storage() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @storage() {
ret i32 undef
}
/* Variables and functions */
int *malloc(int);
void getheap1(int **p) { *p = malloc(100); }


x86 assembly (clang, -O0):
<getheap1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getheap1>:
push   %rbx
mov    %rdi,%rbx
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @getheap1(i32** nocapture writeonly %0) {
%2 = tail call i32* @malloc(i32 100)
store i32* %2, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char ch;
  ch = 'M';
  printf("character: %c\n", ch);
  ch = 65;
  printf("character: %c\n", ch);
  printf("size of char: %d byte", sizeof ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x4d,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
movb   $0x41,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4d,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"character: %c\0A\00"
@.str.1 = [22 x i8] c"size of char: %d byte\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 77, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
store i8 65, i8* %2
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"character: %c\0A\00"
@.str.1 = [22 x i8] c"size of char: %d byte\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 77)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 65)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int st103_get_epreg(int /*<<< orphan*/);
int /*<<< orphan*/ st103_set_epreg(int /*<<< orphan*/, int);
void st103_ep_clear_ctr_rx(uint8_t ep_num) {
  uint16_t value =
      st103_get_epreg(ep_num) & ~(0x8000) &
      ((0x8000) | (0x0800) | (0x0600) | (0x0100) | (0x0080) | (0x000F));
  st103_set_epreg(ep_num, value);
}


x86 assembly (clang, -O0):
<st103_ep_clear_ctr_rx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <st103_get_epreg@plt>
and    $0xffff7fff,%eax
and    $0x8f8f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <st103_set_epreg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st103_ep_clear_ctr_rx>:
push   %rbx
mov    %edi,%ebx
call   1040 <st103_get_epreg@plt>
and    $0xf8f,%eax
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <st103_set_epreg@plt>

LLVM IR (-O0):
define void @st103_ep_clear_ctr_rx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @st103_get_epreg(i32 %4)
%6 = and i32 %5, -32769
%7 = and i32 %6, 36751
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @st103_set_epreg(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @st103_ep_clear_ctr_rx(i32 %0) {
%2 = tail call i32 @st103_get_epreg(i32 %0)
%3 = and i32 %2, 3983
%4 = tail call i32 @st103_set_epreg(i32 %0, i32 %3)
ret void
}
void gdk_pixmap_create_from_data() {}


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

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

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

LLVM IR (-O2):
define void @gdk_pixmap_create_from_data() {
ret void
}
void from_liba() { printf("%s\n", __PRETTY_FUNCTION__); }


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

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

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

LLVM IR (-O2):
@__PRETTY_FUNCTION__.from_liba = [17 x i8] c"void from_liba()\00"
define void @from_liba() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @__PRETTY_FUNCTION__.from_liba, i64 0, i64 0))
ret void
}
void __attribute__((weak)) EXTI0_Callback(void) {}


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

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

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

LLVM IR (-O2):
define weak void @EXTI0_Callback() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ line;

/* Variables and functions */
int mylen(char *);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main() {
  char line[] = "Hello";
  printf("strlen = %lu\n", strlen(line));
  printf("mylen = %lu\n", mylen(line));
  printf("sizeof = %lu\n", sizeof(line));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xeb5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1050 <printf@plt>
lea    -0xa(%rbp),%rdi
call   1030 <mylen@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1050 <printf@plt>
lea    0xe99(%rip),%rdi
mov    $0x6,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x6f,0xc(%rsp)
movl   $0x6c6c6548,0x8(%rsp)
6c
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <mylen@plt>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
lea    0xea5(%rip),%rdi
mov    $0x6,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.line = [6 x i8] c"Hello\00"
@.str = [14 x i8] c"strlen = %lu\0A\00"
@.str.1 = [13 x i8] c"mylen = %lu\0A\00"
@.str.2 = [14 x i8] c"sizeof = %lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%8 = call i32 @mylen(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.line = [6 x i8] c"Hello\00"
@.str = [14 x i8] c"strlen = %lu\0A\00"
@.str.1 = [13 x i8] c"mylen = %lu\0A\00"
@.str.2 = [14 x i8] c"sizeof = %lu\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @mylen(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 6)
ret i32 0
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int wait(int *);
void sig_chld(int signo) {
  pid_t pid;
  int stat;
  printf("about to terminate child\n");
  pid = wait(&stat);
  printf("child %d terminated\n", pid);
  return;
}


x86 assembly (clang, -O0):
<sig_chld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1040 <wait@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_chld>:
push   %rax
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rdi
call   1050 <wait@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [26 x i8] c"about to terminate child\0A\00"
@.str.1 = [21 x i8] c"child %d terminated\0A\00"
define void @sig_chld(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @wait(i32* %4)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"child %d terminated\0A\00"
@str = [25 x i8] c"about to terminate child\00"
define void @sig_chld(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%5 = call i32 @wait(i32* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WriteInstruction(char *);
void CR_GetRandom(void) { WriteInstruction("call random"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"call random\00"
define void @CR_GetRandom() {
%1 = call i32 @WriteInstruction(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"call random\00"
define void @CR_GetRandom() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void print_version(void) {
  printf("Procfiled 0.2.0\n\nCopyright (C) 2011 Matvey Aksenov "
         "<matvey.aksenov@gmail.com>\nThis is free software; see the source "
         "for copying conditions.  There is NO\nwarranty; not even "
         "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [226 x i8] c"Procfiled 0.2.0\0A\0ACopyright (C) 2011 Matvey Aksenov <matvey.aksenov@gmail.com>\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\00"
@EXIT_SUCCESS = global i32 0
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([226 x i8], [226 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [225 x i8] c"Procfiled 0.2.0\0A\0ACopyright (C) 2011 Matvey Aksenov <matvey.aksenov@gmail.com>\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([225 x i8], [225 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int count(int *, int);
int test_many_groups() {
  int array[] = {3, 6, 7, 2, 9};
  return 8 == count(array, 5);
}


x86 assembly (clang, -O0):
<test_many_groups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <count@plt>
mov    %eax,%ecx
mov    $0x8,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_many_groups>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <count@plt>
xor    %ecx,%ecx
cmp    $0x8,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_many_groups.array = [5 x i32] [i32 3, i32 6, i32 7, i32 2, i32 9]
define i32 @test_many_groups() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @count(i32* %3, i32 5)
%5 = icmp eq i32 8, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_many_groups.array = [5 x i32] [i32 3, i32 6, i32 7, i32 2, i32 9]
define i32 @test_many_groups() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @count(i32* %3, i32 5)
%5 = icmp eq i32 %4, 8
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int mem_read(int);
uint16_t mem_read16(uint16_t addr) {
  uint16_t data;
  data = mem_read(addr);
  data |= ((uint16_t)mem_read(++addr)) << 8;
  return data;
}


x86 assembly (clang, -O0):
<mem_read16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mem_read@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x4(%rbp)
call   1030 <mem_read@plt>
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_read16>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <mem_read@plt>
mov    %eax,%ebp
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <mem_read@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mem_read16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @mem_read(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = call i32 @mem_read(i32 %7)
%9 = shl i32 %8, 8
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @mem_read16(i32 %0) {
%2 = tail call i32 @mem_read(i32 %0)
%3 = add nsw i32 %0, 1
%4 = tail call i32 @mem_read(i32 %3)
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
int /*<<< orphan*/ stdout;
void print_fixed_float_16(void *fixed, unsigned frac) {
  fprintf(stdout, "half fixed point[16:%2u]:        ", frac);
  fprintf(stdout, "%#04X\n", *(unsigned *)fixed);
}


x86 assembly (clang, -O0):
<print_fixed_float_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_fixed_float_16>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%edx
mov    %rdi,%rbx
mov    0x2ec0(%rip),%r14
mov    (%r14),%edi
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    (%rbx),%edx
lea    0xee7(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [34 x i8] c"half fixed point[16:%2u]: \00"
@.str.1 = [7 x i8] c"%X\0A\00"
define void @print_fixed_float_16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stdout
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [34 x i8] c"half fixed point[16:%2u]: \00"
@.str.1 = [7 x i8] c"%X\0A\00"
define void @print_fixed_float_16(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1)
%5 = load i32, i32* @stdout
%6 = bitcast i8* %0 to i32*
%7 = load i32, i32* %6
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_s3();
int /*<<< orphan*/ take_struct_s3(int /*<<< orphan*/);
void test_struct_s3() { take_struct_s3(return_struct_s3()); }


x86 assembly (clang, -O0):
<test_struct_s3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <return_struct_s3@plt>
mov    %eax,%edi
call   1040 <take_struct_s3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_s3>:
push   %rax
xor    %eax,%eax
call   1030 <return_struct_s3@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <take_struct_s3@plt>

LLVM IR (-O0):
define void @test_struct_s3() {
%1 = call i32 (...) @return_struct_s3()
%2 = call i32 @take_struct_s3(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_s3() {
%1 = tail call i32 (...) @return_struct_s3()
%2 = tail call i32 @take_struct_s3(i32 %1)
ret void
}
void msh_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @msh_cleanup() {
ret void
}
int Exp_next_power2(int a) {
  int b = 1;
  int m = 0;
  while (b < a) {
    m++;
    b *= 2;
  }
  return m;
}


x86 assembly (clang, -O0):
<Exp_next_power2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <Exp_next_power2+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <Exp_next_power2+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Exp_next_power2>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1119 <Exp_next_power2+0x19>
mov    $0x1,%ecx
xor    %eax,%eax
xchg   %ax,%ax
add    $0x1,%eax
add    %ecx,%ecx
cmp    %edi,%ecx
jl     1110 <Exp_next_power2+0x10>
ret

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

LLVM IR (-O2):
define i32 @Exp_next_power2(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 1, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = shl nsw i32 %5, 1
%8 = icmp slt i32 %7, %0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
char *strcpy(char *, char const *);
char *DWC_STRCPY(char *to, char const *from) { return strcpy(to, from); }


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

x86 assembly (clang, -O2):
<DWC_STRCPY>:
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @DWC_STRCPY(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 = load i8*, i8** %4
%7 = call i8* @strcpy(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @DWC_STRCPY(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
/* Variables and functions */
__attribute__((weak)) void __explicit_bzero_hook(void *buf
                                                 __attribute__((unused)),
                                                 size_t len
                                                 __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define weak void @__explicit_bzero_hook(i8* %0, i64 %1) {
ret void
}
int MOJOSHADER_version(void) { return 1056; }


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

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

LLVM IR (-O0):
define i32 @MOJOSHADER_version() {
ret i32 1056
}

LLVM IR (-O2):
define i32 @MOJOSHADER_version() {
ret i32 1056
}
int is_string_start(char c) { return (c == '"') ? 1 : 0; }


x86 assembly (clang, -O0):
<is_string_start>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x22,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_string_start>:
xor    %eax,%eax
cmp    $0x22,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_string_start(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 34
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_string_start(i8 signext %0) {
%2 = icmp eq i8 %0, 34
%3 = zext i1 %2 to i32
ret i32 %3
}
int win_expand(int z) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @win_expand(i32 %0) {
ret i32 -1
}
/* Type definitions */
struct stat {
  unsigned long st_size;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ fstat(int /*<<< orphan*/, struct stat *);
unsigned long filelengthq(FILE *f) {
  struct stat fileinfo;
  fstat(fileno(f), &fileinfo);
  return fileinfo.st_size;
}


x86 assembly (clang, -O0):
<filelengthq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,%edi
lea    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filelengthq>:
push   %rax
call   1030 <fileno@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1040 <fstat@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @filelengthq(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.stat
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fileno(i32* %4)
%6 = call i32 @fstat(i32 %5, %struct.stat* %3)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%8 = load i64, i64* %7
ret i64 %8
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @filelengthq(i32* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i32 @fileno(i32* %0)
%5 = call i32 @fstat(i32 %4, %struct.stat* %2)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}
void BN_get0_nist_prime_224(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_get0_nist_prime_224() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ comportement_philosophe(int);
int /*<<< orphan*/ fin_tache();
void tache_philosophe1(void) {
  comportement_philosophe(1);
  fin_tache();
}


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

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

LLVM IR (-O0):
define void @tache_philosophe1() {
%1 = call i32 @comportement_philosophe(i32 1)
%2 = call i32 (...) @fin_tache()
ret void
}

LLVM IR (-O2):
define void @tache_philosophe1() {
%1 = tail call i32 @comportement_philosophe(i32 1)
%2 = tail call i32 (...) @fin_tache()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_wmemchr();
int /*<<< orphan*/ test_wmemcmp();
int /*<<< orphan*/ test_wmemmove();
int /*<<< orphan*/ test_wmemset();
int main() {
  test_wmemset();
  test_wmemmove();
  test_wmemchr();
  test_wmemcmp();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test_wmemset@plt>
mov    $0x0,%al
call   1050 <test_wmemmove@plt>
mov    $0x0,%al
call   1040 <test_wmemchr@plt>
mov    $0x0,%al
call   1030 <test_wmemcmp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_wmemset@plt>
xor    %eax,%eax
call   1050 <test_wmemmove@plt>
xor    %eax,%eax
call   1040 <test_wmemchr@plt>
xor    %eax,%eax
call   1030 <test_wmemcmp@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_wmemset()
%3 = call i32 (...) @test_wmemmove()
%4 = call i32 (...) @test_wmemchr()
%5 = call i32 (...) @test_wmemcmp()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_wmemset()
%2 = tail call i32 (...) @test_wmemmove()
%3 = tail call i32 (...) @test_wmemchr()
%4 = tail call i32 (...) @test_wmemcmp()
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *_strndup(char *s, int len) {
  char *c;
  if ((c = (char *)malloc(len + 1))) {
    memcpy(c, s, len);
    c[len] = '\0';
  }
  return c;
}


x86 assembly (clang, -O0):
<_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1164 <_strndup+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
lea    0x1(%r14),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1151 <_strndup+0x31>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <memcpy@plt>
movslq %r14d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @_strndup(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %1)
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %7, %2
ret i8* %5
}
int f(void) {
  int x1 = 'a';
  int x2 = 'b';
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x61,-0x8(%rbp)
movl   $0x62,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
unsigned char *deserialize_u_int32_t(int /*<<< orphan*/ *, unsigned char *);
unsigned char *deserialize_u_int32_t_array3(u_int32_t dest[3],
                                            unsigned char *data) {
  int i;
  for (i = 0; i < 3; i++) {
    data = deserialize_u_int32_t(dest + i, data);
  }
  return data;
}


x86 assembly (clang, -O0):
<deserialize_u_int32_t_array3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    115b <deserialize_u_int32_t_array3+0x4b>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <deserialize_u_int32_t@plt>
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <deserialize_u_int32_t_array3+0x17>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deserialize_u_int32_t_array3>:
push   %rbx
mov    %rdi,%rbx
call   1030 <deserialize_u_int32_t@plt>
lea    0x4(%rbx),%rdi
mov    %rax,%rsi
call   1030 <deserialize_u_int32_t@plt>
add    $0x8,%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <deserialize_u_int32_t@plt>

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

LLVM IR (-O2):
define i8* @deserialize_u_int32_t_array3(i32* %0, i8* %1) {
%3 = tail call i8* @deserialize_u_int32_t(i32* %0, i8* %1)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = tail call i8* @deserialize_u_int32_t(i32* %4, i8* %3)
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = tail call i8* @deserialize_u_int32_t(i32* %6, i8* %5)
ret i8* %7
}
extern void __outbc_p(unsigned char value, unsigned short port) {
  __asm__ __volatile__("out"
                       "b"
                       " %"
                       "b"
                       "0,%"
                       ""
                       "1"
                       :
                       : "a"(value), "id"(port));
  __asm__ __volatile__("jmp 1f\n1:\tjmp 1f\n1:");
}


x86 assembly (clang, -O0):
<__outbc_p>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
jmp    111e <__outbc_p+0x1e>
jmp    1123 <__outbc_p+0x23>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outbc_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
jmp    1107 <__outbc_p+0x7>
jmp    1109 <__outbc_p+0x9>
ret

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

LLVM IR (-O2):
define void @__outbc_p(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outb ${0:b},$1", "{ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
tail call void asm sideeffect "jmp 1f\0A1:\09jmp 1f\0A1:", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void hw_resend_irq(struct irq_chip *h, unsigned int i) {}


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

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

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

LLVM IR (-O2):
%struct.irq_chip = type opaque
define void @hw_resend_irq(%struct.irq_chip* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_at(char const *, int, int);
void print(const char *message) { print_at(message, -1, -1); }


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

x86 assembly (clang, -O2):
<print>:
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
jmp    1030 <print_at@plt>

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

LLVM IR (-O2):
define void @print(i8* %0) {
%2 = tail call i32 @print_at(i8* %0, i32 -1, i32 -1)
ret void
}
void l1_symbolic_overrun_Bad(int i) {
  int a[10];
  if (i >= 10) {
    a[i] = 0;
  }
}


x86 assembly (clang, -O0):
<l1_symbolic_overrun_Bad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     111d <l1_symbolic_overrun_Bad+0x1d>
movslq -0x4(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @l1_symbolic_overrun_Bad(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %8
store i32 0, i32* %9
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @l1_symbolic_overrun_Bad(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_fini();
int /*<<< orphan*/ printf(char *);
__attribute__((__destructor__)) void actual_fini() {
  printf("dniting\n");
  my_fini();
}


x86 assembly (clang, -O0):
<actual_fini>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <my_fini@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<actual_fini>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <my_fini@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"dniting\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @actual_fini, i8* null }]
define void @actual_fini() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @my_fini()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @actual_fini, i8* null }]
@str = [8 x i8] c"dniting\00"
define void @actual_fini() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @my_fini()
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t _swapInt64(uint64_t x) {
  __asm__("bswapq %0" : "+q"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<_swapInt64>:
mov    %rdi,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i8* @_swapInt64(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "bswapq $0", "=q,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @_swapInt64(i8* readnone %0) {
%2 = tail call i8* asm "bswapq $0", "=q,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
main() {
  char *p = 1;
  *p = 'a';
  printf("value in pointer p is %c\n", *p);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x61,0x1
61
lea    0xee0(%rip),%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"value in pointer p is %c\0A\00"
define i32 @main() {
%1 = alloca i8*
store i8* inttoptr (i64 1 to i8*), i8** %1
%2 = load i8*, i8** %1
store i8 97, i8* %2
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"value in pointer p is %c\0A\00"
define i32 @main() {
store i8 97, i8* inttoptr (i64 1 to i8*)
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8 signext 97)
ret i32 0
}
/* Variables and functions */
void array_nullify(void **ptr, unsigned int len) {
  for (int i = 0; i < len; i++) {
    ptr[i] = NULL;
  }
}


x86 assembly (clang, -O0):
<array_nullify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    113c <array_nullify+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <array_nullify+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_nullify>:
test   %esi,%esi
je     1126 <array_nullify+0x16>
push   %rax
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @array_nullify(i8** nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = bitcast i8** %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}