xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void ABORT(char *file, int line) {
  fprintf(stderr, "*****\n\nABORT\nFile %s Line %d\n**********\n\n", file,
          line);
  abort();
}


x86 assembly (clang, -O0):
<ABORT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<ABORT>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"*****\0A\0AABORT\0AFile %s Line %d\0A**********\0A\0A\00"
define void @ABORT(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"*****\0A\0AABORT\0AFile %s Line %d\0A**********\0A\0A\00"
define void @ABORT(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = tail call i32 (...) @abort()
unreachable
}
int _max_number(int a, int b) { return (a < b) ? b : a; }


x86 assembly (clang, -O0):
<_max_number>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <_max_number+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <_max_number+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_max_number>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @_max_number(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pushviewport();
pushviewport_() { pushviewport(); }


x86 assembly (clang, -O0):
<pushviewport_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pushviewport@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pushviewport_() {
%1 = alloca i32
%2 = call i32 (...) @pushviewport()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @pushviewport_() {
%1 = tail call i32 (...) @pushviewport()
ret i32 undef
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t len = 0;
  while (*(s + len)) {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
int dup2(int, int);
void do_dup2(int oldfd, int newfd) {
  int status = dup2(oldfd, newfd);
  if (status == -1)
    die("dup2 failed");
}


x86 assembly (clang, -O0):
<do_dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <dup2@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1152 <do_dup2+0x32>
lea    0xeb3(%rip),%rdi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_dup2>:
push   %rax
call   1030 <dup2@plt>
cmp    $0xffffffff,%eax
je     112d <do_dup2+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <die@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"dup2 failed\00"
define void @do_dup2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @dup2(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @die(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"dup2 failed\00"
define void @do_dup2(i32 %0, i32 %1) {
%3 = tail call i32 @dup2(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ assert_or_panic(int);
void c_u16(uint16_t x) { assert_or_panic(x == 0xfffe); }


x86 assembly (clang, -O0):
<c_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xfffe,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert_or_panic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_u16>:
xor    %eax,%eax
cmp    $0xfffe,%edi
sete   %al
mov    %eax,%edi
jmp    1030 <assert_or_panic@plt>

LLVM IR (-O0):
define void @c_u16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 65534
%5 = zext i1 %4 to i32
%6 = call i32 @assert_or_panic(i32 %5)
ret void
}

LLVM IR (-O2):
define void @c_u16(i32 %0) {
%2 = icmp eq i32 %0, 65534
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert_or_panic(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char const *, int);
void yuiMkdir(const char *dir) {
  (void)dir;
  mkdir(dir, 0755);
}


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

x86 assembly (clang, -O2):
<yuiMkdir>:
mov    $0x1ed,%esi
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define void @yuiMkdir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 493)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ sleep(int);
void *func(void *p) {
  printf("Thread arg:%s id:%lu\n", (char *)p, pthread_self());
  sleep(2);
  return (void *)42;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    $0x2a,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    $0x2a,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Thread arg:%s id:%lu\0A\00"
define i8* @func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @pthread_self()
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4)
%6 = call i32 @sleep(i32 2)
ret i8* inttoptr (i64 42 to i8*)
}

LLVM IR (-O2):
@.str = [22 x i8] c"Thread arg:%s id:%lu\0A\00"
define i8* @func(i8* %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
%4 = tail call i32 @sleep(i32 2)
ret i8* inttoptr (i64 42 to i8*)
}
int is_power_of_two(int x) {
  if (x <= 0)
    return 0;
  if ((x & (x - 1)) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <is_power_of_two+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <is_power_of_two+0x44>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    113d <is_power_of_two+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <is_power_of_two+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_two>:
test   %edi,%edi
jle    110f <is_power_of_two+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_power_of_two(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ isascii(int);
scalar_t__ islower(int);
int utf32_islower(int c) { return isascii(c) && islower(c); }


x86 assembly (clang, -O0):
<utf32_islower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isascii@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1157 <utf32_islower+0x37>
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf32_islower>:
push   %rbx
mov    %edi,%ebx
call   1040 <isascii@plt>
test   %rax,%rax
je     1141 <utf32_islower+0x21>
mov    %ebx,%edi
call   1030 <islower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @utf32_islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isascii(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @islower(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @utf32_islower(i32 %0) {
%2 = tail call i64 @isascii(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @islower(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ config_cmd(unsigned char, unsigned int, unsigned int);
unsigned short inw(int);
int /*<<< orphan*/ outl(int /*<<< orphan*/, int);
unsigned short pcibios_read_config_word(unsigned char bus, unsigned devfn,
                                        unsigned where) {
  outl(config_cmd(bus, devfn, where), 0xCF8);
  return inw(0xCFC + (where & 2));
}


x86 assembly (clang, -O0):
<pcibios_read_config_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movzbl %al,%edi
call   1050 <config_cmd@plt>
mov    %eax,%edi
mov    $0xcf8,%esi
call   1040 <outl@plt>
mov    -0xc(%rbp),%edi
and    $0x2,%edi
add    $0xcfc,%edi
call   1030 <inw@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcibios_read_config_word>:
push   %rbx
mov    %edx,%ebx
call   1050 <config_cmd@plt>
mov    %eax,%edi
mov    $0xcf8,%esi
call   1040 <outl@plt>
and    $0x2,%ebx
or     $0xcfc,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <inw@plt>

LLVM IR (-O0):
define zeroext i16 @pcibios_read_config_word(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @config_cmd(i8 zeroext %7, i32 %8, i32 %9)
%11 = call i32 @outl(i32 %10, i32 3320)
%12 = load i32, i32* %6
%13 = and i32 %12, 2
%14 = add i32 3324, %13
%15 = call zeroext i16 @inw(i32 %14)
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @pcibios_read_config_word(i8 zeroext %0, i32 %1, i32 %2) {
%4 = tail call i32 @config_cmd(i8 zeroext %0, i32 %1, i32 %2)
%5 = tail call i32 @outl(i32 %4, i32 3320)
%6 = and i32 %2, 2
%7 = or i32 %6, 3324
%8 = tail call zeroext i16 @inw(i32 %7)
ret i16 %8
}
/* Variables and functions */
size_t strlen(char *);
int al_sapc(char *dest, char source, size_t maxlen) {
  register size_t len;
  len = strlen(dest);
  if (len >= maxlen)
    return 1;
  dest[len] = source;
  dest[len + 1] = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<al_sapc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jb     114d <al_sapc+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    116f <al_sapc+0x5f>
mov    -0x11(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movb   $0x0,0x1(%rax,%rcx,1)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<al_sapc>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbp
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    $0x1,%ecx
cmp    %rbp,%rax
jae    1137 <al_sapc+0x27>
mov    %r14b,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @al_sapc(i8* nocapture %0, i8 signext %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp ult i64 %4, %2
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %1, i8* %7
%8 = add nuw i64 %4, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %3, %6
%11 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %11
}
/* Type definitions */
struct t_gui_completion {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct t_gui_completion *);
int /*<<< orphan*/ gui_completion_free_data(struct t_gui_completion *);
void gui_completion_free(struct t_gui_completion *completion) {
  if (!completion)
    return;
  gui_completion_free_data(completion);
  free(completion);
}


x86 assembly (clang, -O0):
<gui_completion_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <gui_completion_free+0x1c>
jmp    114e <gui_completion_free+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <gui_completion_free_data@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_completion_free>:
test   %rdi,%rdi
je     1137 <gui_completion_free+0x17>
push   %rbx
mov    %rdi,%rbx
call   1030 <gui_completion_free_data@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>
ret

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

LLVM IR (-O2):
%struct.t_gui_completion = type { i32 }
define void @gui_completion_free(%struct.t_gui_completion* %0) {
%2 = icmp eq %struct.t_gui_completion* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @gui_completion_free_data(%struct.t_gui_completion* %0)
%5 = tail call i32 @free(%struct.t_gui_completion* %0)
br label %6
6: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_add_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) __m256i addv(__m256i a, __m256i b) {
  return _mm256_add_epi32(a, b);
}


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

x86 assembly (clang, -O2):
<addv>:
jmp    1030 <_mm256_add_epi32@plt>

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

LLVM IR (-O2):
define i32 @addv(i32 %0, i32 %1) {
%3 = tail call i32 @_mm256_add_epi32(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __wa_wrap_free(void *);
void free(void *ptr) { __wa_wrap_free(ptr); }


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

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

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

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = tail call i32 @__wa_wrap_free(i8* %0)
ret void
}
int fn3(int a, int b) {
  int tem1 = a + b;
  int tem2 = b | a;
  return tem1 - tem2;
}


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

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

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

LLVM IR (-O2):
define i32 @fn3(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ geraInstrucao(unsigned int, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/, char *);
void gerarGOTOLabel(unsigned label) { geraInstrucao(label, 2022, 0, 0, ""); }


x86 assembly (clang, -O0):
<gerarGOTOLabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x7e6,%esi
xor    %ecx,%ecx
lea    0xed4(%rip),%r8
mov    %ecx,%edx
call   1030 <geraInstrucao@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gerarGOTOLabel>:
lea    0xee9(%rip),%r8
mov    $0x7e6,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <geraInstrucao@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @gerarGOTOLabel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @geraInstrucao(i32 %3, i32 2022, i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @gerarGOTOLabel(i32 %0) {
%2 = tail call i32 @geraInstrucao(i32 %0, i32 2022, i32 0, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
int double_leq(const void *p1, const void *p2) {
  double d = *(double *)p1 - *(double *)p2;
  if (d > 0) {
    return 1;
  } else if (d < 0) {
    return -1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<double_leq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    113f <double_leq+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1160 <double_leq+0x60>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1159 <double_leq+0x59>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <double_leq+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_leq>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @double_leq(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to double*
%9 = load double, double* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
%12 = load double, double* %11
%13 = fsub double %9, %12
store double %13, double* %6
%14 = load double, double* %6
%15 = fcmp ogt double %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 1, i32* %3
br label %22
17: ; preds = %2
%18 = load double, double* %6
%19 = fcmp olt double %18, 0.000000e+00
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 -1, i32* %3
br label %22
21: ; preds = %17
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %16
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @double_leq(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = fcmp ogt double %7, 0.000000e+00
%9 = fcmp olt double %7, 0.000000e+00
%10 = sext i1 %9 to i32
%11 = select i1 %8, i32 1, i32 %10
ret i32 %11
}
int test_imm_EBuint16_mem(unsigned short *val) {
  return ((*val) & (-0xEB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_EBuint16_mem>:
movzwl (%rdi),%eax
test   $0xff15,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_EBuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -235
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *dou2pre(double);
scalar_t__ malloc(int);
double pre2dou(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char in[35] = "01100000011000010110001100000000";
  double result;
  result = pre2dou(in);
  char *out;
  out = (char *)malloc(sizeof(char) * 33);
  out = dou2pre(result);
  printf("%s\n", out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe96(%rip),%rsi
mov    $0x23,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
call   1030 <pre2dou@plt>
movsd  %xmm0,-0x38(%rbp)
mov    $0x21,%edi
call   1060 <malloc@plt>
mov    %rax,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1070 <dou2pre@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x30,0x2f(%rsp)
lea    0x10(%rsp),%rdi
call   1030 <pre2dou@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x21,%edi
call   1050 <malloc@plt>
movsd  0x8(%rsp),%xmm0
call   1060 <dou2pre@plt>
lea    0xe93(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.in = [35 x i8] c"01100000011000010110001100000000\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [35 x i8]
%3 = alloca double
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [35 x i8]* %2 to i8*
%6 = getelementptr inbounds [35 x i8], [35 x i8]* %2, i64 0, i64 0
%7 = call double @pre2dou(i8* %6)
store double %7, double* %3
%8 = call i64 @malloc(i32 33)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = load double, double* %3
%11 = call i8* @dou2pre(double %10)
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.in = [35 x i8] c"01100000011000010110001100000000\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [35 x i8]
%2 = getelementptr inbounds [35 x i8], [35 x i8]* %1, i64 0, i64 0
%3 = call double @pre2dou(i8* %2)
%4 = call i64 @malloc(i32 33)
%5 = call i8* @dou2pre(double %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_with_tab(char *);
int /*<<< orphan*/ print_label(int);
void gen_jump(int label) {
  output_with_tab("jmp \t");
  print_label(label);
  newline();
}


x86 assembly (clang, -O0):
<gen_jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_label@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_jump>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    %ebx,%edi
call   1040 <print_label@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"jmp \09\00"
define void @gen_jump(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @print_label(i32 %4)
%6 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"jmp \09\00"
define void @gen_jump(i32 %0) {
%2 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_label(i32 %0)
%4 = tail call i32 (...) @newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage_and_exit(char *error_message) {
  fprintf(stderr,
          "\n"
          "Error: %s\n"
          "\n"
          "Usage:  cat-from --offset N <file>\n"
          "\n",
          error_message);
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage_and_exit>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"\0AError: %s\0A\0AUsage: cat-from --offset N <file>\0A\0A\00"
define void @print_usage_and_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"\0AError: %s\0A\0AUsage: cat-from --offset N <file>\0A\0A\00"
define void @print_usage_and_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int HelpItem84(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem84() {
ret i32 0
}
char test13(void) { return '\n'; }


x86 assembly (clang, -O0):
<test13>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test13>:
mov    $0xa,%al
ret

LLVM IR (-O0):
define signext i8 @test13() {
ret i8 10
}

LLVM IR (-O2):
define signext i8 @test13() {
ret i8 10
}
/* Variables and functions */
int /*<<< orphan*/ sa_free(void *);
void allocationFree(void *ptr) { sa_free(ptr); }


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

x86 assembly (clang, -O2):
<allocationFree>:
jmp    1030 <sa_free@plt>

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

LLVM IR (-O2):
define void @allocationFree(i8* %0) {
%2 = tail call i32 @sa_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ foo_with_default_visibility();
int /*<<< orphan*/ foo_with_hidden_visibility();
int /*<<< orphan*/ foo_with_internal_visibility();
int /*<<< orphan*/ foo_with_protected_visibility();
int /*<<< orphan*/ foo_with_used_attribute();
void bar() {
  foo_with_default_visibility();
  foo_with_protected_visibility();
  foo_with_internal_visibility();
  foo_with_hidden_visibility();
  foo_with_used_attribute();
  foo();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <foo_with_default_visibility@plt>
mov    $0x0,%al
call   1060 <foo_with_protected_visibility@plt>
mov    $0x0,%al
call   1070 <foo_with_internal_visibility@plt>
mov    $0x0,%al
call   1050 <foo_with_hidden_visibility@plt>
mov    $0x0,%al
call   1030 <foo_with_used_attribute@plt>
mov    $0x0,%al
call   1040 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1080 <foo_with_default_visibility@plt>
xor    %eax,%eax
call   1060 <foo_with_protected_visibility@plt>
xor    %eax,%eax
call   1070 <foo_with_internal_visibility@plt>
xor    %eax,%eax
call   1050 <foo_with_hidden_visibility@plt>
xor    %eax,%eax
call   1030 <foo_with_used_attribute@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <foo@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 (...) @foo_with_default_visibility()
%2 = call i32 (...) @foo_with_protected_visibility()
%3 = call i32 (...) @foo_with_internal_visibility()
%4 = call i32 (...) @foo_with_hidden_visibility()
%5 = call i32 (...) @foo_with_used_attribute()
%6 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 (...) @foo_with_default_visibility()
%2 = tail call i32 (...) @foo_with_protected_visibility()
%3 = tail call i32 (...) @foo_with_internal_visibility()
%4 = tail call i32 (...) @foo_with_hidden_visibility()
%5 = tail call i32 (...) @foo_with_used_attribute()
%6 = tail call i32 (...) @foo()
ret void
}
unsigned int hex_to_dec(char nibble) {
  char val = 0;
  if (nibble >= 'a') {
    val = nibble - 'a' + 10;
  } else if (nibble >= 'A') {
    val = nibble - 'A' + 10;
  } else {
    val = nibble - '0';
  }
  return val;
}


x86 assembly (clang, -O0):
<hex_to_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     112d <hex_to_dec+0x2d>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x2(%rbp)
jmp    115b <hex_to_dec+0x5b>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     114c <hex_to_dec+0x4c>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x2(%rbp)
jmp    1156 <hex_to_dec+0x56>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x2(%rbp)
jmp    115b <hex_to_dec+0x5b>
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_to_dec>:
cmp    $0x41,%dil
mov    $0xc9,%eax
mov    $0xd0,%ecx
cmovge %eax,%ecx
cmp    $0x61,%dil
mov    $0xa9,%eax
cmovl  %ecx,%eax
add    %dil,%al
movsbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @hex_to_dec(i8 signext %0) {
%2 = icmp sgt i8 %0, 96
%3 = icmp sgt i8 %0, 64
%4 = select i1 %3, i8 -55, i8 -48
%5 = select i1 %2, i8 -87, i8 %4
%6 = add i8 %5, %0
%7 = sext i8 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
scalar_t__ vfork();
void spawn(char *program, char *argv[]) {
  pid_t child_pid = vfork();
  if (child_pid == 0) {
    execvp(argv[0], argv);
  }
}


x86 assembly (clang, -O0):
<spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <vfork@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <spawn+0x36>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <execvp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spawn>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <vfork@plt>
test   %rax,%rax
je     1132 <spawn+0x12>
pop    %rbx
ret
mov    (%rbx),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <execvp@plt>

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

LLVM IR (-O2):
define void @spawn(i8* nocapture readnone %0, i8** %1) {
%3 = tail call i64 (...) @vfork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 @execvp(i8* %6, i8** %1)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getNumbers(double *, double *);
double sum(double a, double b) {
  getNumbers(&a, &b);
  return (a + b);
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <getNumbers@plt>
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <getNumbers@plt>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @sum(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 @getNumbers(double* %3, double* %4)
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fadd double %6, %7
ret double %8
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzBuiltinVariable_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN_DELAYED(int, int);
int /*<<< orphan*/ SEND_DATAOFF_DELAYED(int, int /*<<< orphan*/);
void BrzBuiltinVariable_reqdown(struct comp *comp, int port) {
  struct BrzBuiltinVariable_ *c = (struct BrzBuiltinVariable_ *)comp;
  SEND_ACKDOWN_DELAYED(port, 1);
  if (port >= 1) {
    SEND_DATAOFF_DELAYED(port, 0);
  }
}


x86 assembly (clang, -O0):
<BrzBuiltinVariable_reqdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
cmpl   $0x1,-0xc(%rbp)
jl     1158 <BrzBuiltinVariable_reqdown+0x38>
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1040 <SEND_DATAOFF_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzBuiltinVariable_reqdown>:
push   %rbx
mov    %esi,%ebx
mov    %esi,%edi
mov    $0x1,%esi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
test   %ebx,%ebx
jle    113d <BrzBuiltinVariable_reqdown+0x1d>
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
jmp    1040 <SEND_DATAOFF_DELAYED@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzBuiltinVariable_ = type { i32 }
define void @BrzBuiltinVariable_reqdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzBuiltinVariable_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzBuiltinVariable_*
store %struct.BrzBuiltinVariable_* %7, %struct.BrzBuiltinVariable_** %5
%8 = load i32, i32* %4
%9 = call i32 @SEND_ACKDOWN_DELAYED(i32 %8, i32 1)
%10 = load i32, i32* %4
%11 = icmp sge i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %4
%14 = call i32 @SEND_DATAOFF_DELAYED(i32 %13, i32 0)
br label %15
15: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzBuiltinVariable_reqdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKDOWN_DELAYED(i32 %1, i32 1)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @SEND_DATAOFF_DELAYED(i32 %1, i32 0)
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3_normalize(float *, float *);
__attribute__((always_)) struct vec3 *psvec3_normalize(struct vec3 *result,
                                                       struct vec3 *a) {
  vec3_normalize((float *)result, (float *)a);
  return result;
}


x86 assembly (clang, -O0):
<psvec3_normalize>:
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 <vec3_normalize@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_normalize(%struct.vec3* returned %0, %struct.vec3* %1) {
%3 = bitcast %struct.vec3* %0 to float*
%4 = bitcast %struct.vec3* %1 to float*
%5 = tail call i32 @vec3_normalize(float* %3, float* %4)
ret %struct.vec3* %0
}
/* Variables and functions */
int /*<<< orphan*/ deinit();
int /*<<< orphan*/ init();
int /*<<< orphan*/ runBar();
int main(int argc, char *argv[]) {
  init();
  runBar();
  deinit();
  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    $0x0,%al
call   1050 <init@plt>
mov    $0x0,%al
call   1040 <runBar@plt>
mov    $0x0,%al
call   1030 <deinit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <init@plt>
xor    %eax,%eax
call   1040 <runBar@plt>
xor    %eax,%eax
call   1030 <deinit@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 = call i32 (...) @init()
%7 = call i32 (...) @runBar()
%8 = call i32 (...) @deinit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @runBar()
%5 = tail call i32 (...) @deinit()
ret i32 0
}
void XtSetSelectionTimeout() {}


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

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

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

LLVM IR (-O2):
define void @XtSetSelectionTimeout() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MD5(unsigned char const *, unsigned long long,
                       unsigned char *);
int crypto_hash(unsigned char *out, const unsigned char *in,
                unsigned long long inlen) {
  MD5(in, inlen, out);
  return 0;
}


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

x86 assembly (clang, -O2):
<crypto_hash>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <MD5@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @crypto_hash(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i8*, i8** %4
%10 = call i32 @MD5(i8* %7, i64 %8, i8* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @crypto_hash(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @MD5(i8* %1, i64 %2, i8* %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *,
                           int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void print_error(char *error, wchar_t *text) {
  fprintf(stderr, "%s%ls\n", error, text);
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s%ls\0A\00"
define void @print_error(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32*, i32** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6, i32* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s%ls\0A\00"
define void @print_error(i8* %0, i32* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32* %1)
ret void
}