xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int enregcomp(int, int /*<<< orphan*/ *, char const *, int);
int eregcomp(regex_t *preg, const char *regex, int cflags) {
  return enregcomp(1, preg, regex, cflags);
}


x86 assembly (clang, -O0):
<eregcomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%edi
call   1030 <enregcomp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eregcomp>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <enregcomp@plt>

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

LLVM IR (-O2):
define i32 @eregcomp(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @enregcomp(i32 1, i32* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
char *safe_malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
char *path_join(const char *a, const char *b) {
  char *buffer = safe_malloc(4096);
  snprintf(buffer, 4096, "%s/%s", a, b);
  return buffer;
}


x86 assembly (clang, -O0):
<path_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1000,%edi
call   1030 <safe_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0x1000,%esi
lea    0xeaa(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_join>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x1000,%edi
call   1030 <safe_malloc@plt>
mov    %rax,%rbx
lea    0xec1(%rip),%rdx
mov    %rax,%rdi
mov    $0x1000,%esi
mov    %r15,%rcx
mov    %r14,%r8
call   1040 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
define i8* @path_join(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i8* @safe_malloc(i32 4096)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @snprintf(i8* %7, i32 4096, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
define i8* @path_join(i8* %0, i8* %1) {
%3 = tail call i8* @safe_malloc(i32 4096)
%4 = tail call i32 @snprintf(i8* %3, i32 4096, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ __svgalib_driver16_getbox(int, int, int, int, void *, int);
void __svgalib_driver16_getboxpart(int x, int y, int w, int h, int ow, int oh,
                                   void *b, int xo, int yo) {
  __svgalib_driver16_getbox(x, y, w, h, b + yo * ow + xo, ow);
}


x86 assembly (clang, -O0):
<__svgalib_driver16_getboxpart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x10(%rbp),%r8
mov    0x20(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
add    %rax,%r8
movslq 0x18(%rbp),%rax
add    %rax,%r8
mov    -0x14(%rbp),%r9d
call   1030 <__svgalib_driver16_getbox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_driver16_getboxpart>:
mov    %r8d,%r9d
movslq 0x10(%rsp),%r10
mov    0x18(%rsp),%eax
imul   %r8d,%eax
movslq %eax,%r8
add    0x8(%rsp),%r8
add    %r10,%r8
jmp    1030 <__svgalib_driver16_getbox@plt>

LLVM IR (-O0):
define void @__svgalib_driver16_getboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i8* %6, i8** %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %13
%23 = load i8*, i8** %16
%24 = load i32, i32* %18
%25 = load i32, i32* %14
%26 = mul nsw i32 %24, %25
%27 = sext i32 %26 to i64
%28 = getelementptr i8, i8* %23, i64 %27
%29 = load i32, i32* %17
%30 = sext i32 %29 to i64
%31 = getelementptr i8, i8* %28, i64 %30
%32 = load i32, i32* %14
%33 = call i32 @__svgalib_driver16_getbox(i32 %19, i32 %20, i32 %21, i32 %22, i8* %31, i32 %32)
ret void
}

LLVM IR (-O2):
define void @__svgalib_driver16_getboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = mul nsw i32 %8, %4
%11 = sext i32 %10 to i64
%12 = getelementptr i8, i8* %6, i64 %11
%13 = sext i32 %7 to i64
%14 = getelementptr i8, i8* %12, i64 %13
%15 = tail call i32 @__svgalib_driver16_getbox(i32 %0, i32 %1, i32 %2, i32 %3, i8* %14, i32 %4)
ret void
}
void I2CStopSend(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= 0x00000200;
}


x86 assembly (clang, -O0):
<I2CStopSend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x200,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CStopSend>:
orq    $0x200,(%rdi)
ret

LLVM IR (-O0):
define void @I2CStopSend(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 512
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CStopSend(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = or i64 %3, 512
store volatile i64 %4, i64* %2
ret void
}
int doSubstraction(int v1, int v2) { return v1 - v2; }


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

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

LLVM IR (-O0):
define i32 @doSubstraction(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @doSubstraction(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int execvp(char const *, char *const *);
int _execvp(const char *path, char *const argv[]) { return execvp(path, argv); }


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

x86 assembly (clang, -O2):
<_execvp>:
jmp    1030 <execvp@plt>

LLVM IR (-O0):
define i32 @_execvp(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 i32 @execvp(i8* %5, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_execvp(i8* %0, i8** %1) {
%3 = tail call i32 @execvp(i8* %0, i8** %1)
ret i32 %3
}
void my_path_join(char *join_path, const char *path, const char *file) {
  char separator;
  separator = '/';
  snprintf(join_path, 4096, "%s%c%s", path, separator, file);
  join_path[4096 - 1] = '\0';
}


x86 assembly (clang, -O0):
<my_path_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0x2f,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
movsbl -0x19(%rbp),%r8d
mov    -0x18(%rbp),%r9
mov    $0x1000,%esi
lea    0xebb(%rip),%rdx
mov    $0x0,%al
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
movb   $0x0,0xfff(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_path_join>:
push   %rbx
mov    %rdx,%r9
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xedf(%rip),%rdx
mov    $0x1000,%esi
mov    $0x2f,%r8d
xor    %eax,%eax
call   1030 <snprintf@plt>
movb   $0x0,0xfff(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s%c%s\00"
define void @my_path_join(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i8 47, i8* %7
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i8, i8* %7
%11 = sext i8 %10 to i32
%12 = load i8*, i8** %6
%13 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %8, i64 4096, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %11, i8* %12)
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 4095
store i8 0, i8* %15
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%c%s\00"
define void @my_path_join(i8* nocapture writeonly %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* dereferenceable(1) %0, i64 4096, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i32 47, i8* %2)
%5 = getelementptr inbounds i8, i8* %0, i64 4095
store i8 0, i8* %5
ret void
}
/* Variables and functions */
char toupper(char);
void sqchat_trie_strtoupper(char *s) {
  for (int i = 0; s[i] != '\0'; i++)
    s[i] = toupper(s[i]);
}


x86 assembly (clang, -O0):
<sqchat_trie_strtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <sqchat_trie_strtoupper+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <sqchat_trie_strtoupper+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqchat_trie_strtoupper>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <sqchat_trie_strtoupper+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <sqchat_trie_strtoupper+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @sqchat_trie_strtoupper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = phi i8 [ %12, %5 ], [ %2, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = tail call signext i8 @toupper(i8 signext %7)
store i8 %9, i8* %8
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ set_palette(int /*<<< orphan*/, int, unsigned char *);
void init_palette(void) {
  unsigned char table_rgb[16 * 3] = {
      0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00,
      0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
      0xc6, 0xc6, 0xc6, 0x84, 0x00, 0x00, 0x00, 0x84, 0x00, 0x84, 0x84, 0x00,
      0x00, 0x00, 0x84, 0x84, 0x00, 0x84, 0x00, 0x84, 0x84, 0x84, 0x84, 0x84};
  set_palette(0, 15, table_rgb);
  return;
}


x86 assembly (clang, -O0):
<init_palette>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x30,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdx
xor    %edi,%edi
mov    $0xf,%esi
call   1040 <set_palette@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_palette>:
sub    $0x38,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
xor    %edi,%edi
mov    $0xf,%esi
call   1030 <set_palette@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.init_palette.table_rgb = [48 x i8] c"\00\00\00\FF\00\00\00\FF\00\FF\FF\00\00\00\FF\FF\00\FF\00\FF\FF\FF\FF\FF\C6\C6\C6\84\00\00\00\84\00\84\84\00\00\00\84\84\00\84\00\84\84\84\84\84"
define void @init_palette() {
%1 = alloca [48 x i8]
%2 = bitcast [48 x i8]* %1 to i8*
%3 = getelementptr inbounds [48 x i8], [48 x i8]* %1, i64 0, i64 0
%4 = call i32 @set_palette(i32 0, i32 15, i8* %3)
ret void
}

LLVM IR (-O2):
@__const.init_palette.table_rgb = [48 x i8] c"\00\00\00\FF\00\00\00\FF\00\FF\FF\00\00\00\FF\FF\00\FF\00\FF\FF\FF\FF\FF\C6\C6\C6\84\00\00\00\84\00\84\84\00\00\00\84\84\00\84\00\84\84\84\84\84"
define void @init_palette() {
%1 = alloca [48 x i8]
%2 = getelementptr inbounds [48 x i8], [48 x i8]* %1, i64 0, i64 0
%3 = call i32 @set_palette(i32 0, i32 15, i8* %2)
ret void
}
sudomain(addr) char *addr;
{
  int len;
  len = strlen(addr);
  if (len >= 3 && !strcmp(addr + len - 3, ".su"))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<sudomain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jl     1172 <sudomain+0x52>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
add    $0xfffffffffffffffd,%rdi
lea    0xea8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1172 <sudomain+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1179 <sudomain+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sudomain>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x3,%eax
jl     1148 <sudomain+0x28>
cltq
lea    (%rbx,%rax,1),%rdi
add    $0xfffffffffffffffd,%rdi
lea    0xec1(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     114c <sudomain+0x2c>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c".su\00"
define i32 @sudomain(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 2
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = shl i64 %2, 32
%7 = ashr exact i64 %6, 32
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = getelementptr inbounds i8, i8* %8, i64 -3
%10 = tail call i32 @strcmp(i8* %9, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %5, %1
br label %13
13: ; preds = %5, %12
%14 = phi i32 [ 0, %12 ], [ 1, %5 ]
ret i32 %14
}
void single_r() {
  register int out0 = 0;
  register int in1 = 1;
  asm("foo %1,%0" : "=r"(out0) : "r"(in1));
}


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

LLVM IR (-O0):
LLVM IR (-O2):
define void @single_r() {
%1 = tail call i32 asm "foo $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 1)
ret void
}
/* Variables and functions */
scalar_t__ irafncmp(char *, char *, int);
scalar_t__ strncmp(char *, char *, int);
int pix_version(char *irafheader) {
  if (irafncmp(irafheader, "impix", 5) != 0) {
    if (strncmp(irafheader, "impv2", 5) != 0)
      return (0);
    else
      return (2);
  } else
    return (1);
}


x86 assembly (clang, -O0):
<pix_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x5,%edx
call   1040 <irafncmp@plt>
cmp    $0x0,%rax
je     1182 <pix_version+0x62>
mov    -0x10(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1176 <pix_version+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1189 <pix_version+0x69>
movl   $0x2,-0x4(%rbp)
jmp    1189 <pix_version+0x69>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pix_version>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x5,%edx
call   1040 <irafncmp@plt>
test   %rax,%rax
je     115d <pix_version+0x3d>
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"impix\00"
@.str.1 = [6 x i8] c"impv2\00"
define i32 @pix_version(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @irafncmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @strncmp(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %2
br label %14
12: ; preds = %7
store i32 2, i32* %2
br label %14
13: ; preds = %1
store i32 1, i32* %2
br label %14
14: ; preds = %13, %12, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"impix\00"
@.str.1 = [6 x i8] c"impv2\00"
define i32 @pix_version(i8* %0) {
%2 = tail call i64 @irafncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 2, i32 0
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t nmemb, size_t size) {
  void *malloc(size_t size);
  void *s;
  ;
  size *= nmemb;
  if ((s = malloc(size)) == NULL)
    return NULL;
  memset(s, 0, size);
  return s;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1161 <calloc+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1178 <calloc+0x58>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %2, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int strtol(char *, char **, int /*<<< orphan*/);
int ReadCoords(int *x, int *y) {
  char input[80];
  char *pEnd;
  fgets(input, 80, stdin);
  *x = strtol(input, &pEnd, 0);
  *y = strtol(pEnd, NULL, 0);
  return 0;
}


x86 assembly (clang, -O0):
<ReadCoords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1030 <fgets@plt>
lea    -0x60(%rbp),%rdi
lea    -0x68(%rbp),%rsi
xor    %edx,%edx
call   1040 <strtol@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x68(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtol@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadCoords>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x50,%esi
call   1030 <fgets@plt>
lea    0x8(%rsp),%rsi
mov    %r15,%rdi
xor    %edx,%edx
call   1040 <strtol@plt>
mov    %eax,(%rbx)
mov    0x8(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <strtol@plt>
mov    %eax,(%r14)
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @ReadCoords(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [80 x i8]
%6 = alloca i8*
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %7, i32 80, i32 %8)
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%11 = call i32 @strtol(i8* %10, i8** %6, i32 0)
%12 = load i32*, i32** %3
store i32 %11, i32* %12
%13 = load i8*, i8** %6
%14 = call i32 @strtol(i8* %13, i8** null, i32 0)
%15 = load i32*, i32** %4
store i32 %14, i32* %15
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @ReadCoords(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = alloca [80 x i8]
%4 = alloca i8*
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = bitcast i8** %4 to i8*
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %5, i32 80, i32 %7)
%9 = call i32 @strtol(i8* %5, i8** %4, i32 0)
store i32 %9, i32* %0
%10 = load i8*, i8** %4
%11 = call i32 @strtol(i8* nocapture %10, i8** null, i32 0)
store i32 %11, i32* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _IO(unsigned char, int);
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int usb_raw_run(int fd) { return ioctl(fd, _IO('U', 1), 0); }


x86 assembly (clang, -O0):
<usb_raw_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x55,%edi
mov    $0x1,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_raw_run>:
push   %rbx
mov    %edi,%ebx
mov    $0x55,%edi
mov    $0x1,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @usb_raw_run(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i8 zeroext 85, i32 1)
%5 = call i32 @ioctl(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @usb_raw_run(i32 %0) {
%2 = tail call i32 @_IO(i8 zeroext 85, i32 1)
%3 = tail call i32 @ioctl(i32 %0, i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
double pow10(double);
double test3(double x) { return pow10(x); }


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

x86 assembly (clang, -O2):
<test3>:
jmp    1030 <pow10@plt>

LLVM IR (-O0):
define double @test3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow10(double %3)
ret double %4
}

LLVM IR (-O2):
define double @test3(double %0) {
%2 = tail call double @pow10(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr,
          "Usage: gpmimult [-ip d/s] [-op d/s] [-silent] [-v] [-l/-h]\n");
  fprintf(stderr, "\t\t[-pref prefix]  groupname [cosname].\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xef3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badusage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"Usage: gpmimult [-ip d/s] [-op d/s] [-silent] [-v] [-l/-h]\0A\00"
@.str.1 = [40 x i8] c"\09\09[-pref prefix] groupname [cosname].\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"Usage: gpmimult [-ip d/s] [-op d/s] [-silent] [-v] [-l/-h]\0A\00"
@.str.1 = [40 x i8] c"\09\09[-pref prefix] groupname [cosname].\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int *array, int l, int r) {
  int j;
  if (l < r) {
    j = partition(array, l, r);
    quick_sort(array, l, j - 1);
    quick_sort(array, j + 1, r);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void f(char x[]) {}


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

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

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

LLVM IR (-O2):
define void @f(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int f2(int /*<<< orphan*/, int);
int g2(void) { return f2(0, 1); }


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <f2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <f2@plt>

LLVM IR (-O0):
define i32 @g2() {
%1 = call i32 @f2(i32 0, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @g2() {
%1 = tail call i32 @f2(i32 0, i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sqlite3_free(void *);
void *sqlite3_realloc(void *, int);
void *fts3ReallocOrFree(void *pOrig, int nNew) {
  void *pRet = sqlite3_realloc(pOrig, nNew);
  if (!pRet) {
    sqlite3_free(pOrig);
  }
  return pRet;
}


x86 assembly (clang, -O0):
<fts3ReallocOrFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <sqlite3_realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <fts3ReallocOrFree+0x33>
mov    -0x8(%rbp),%rdi
call   1030 <sqlite3_free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fts3ReallocOrFree>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <sqlite3_realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <fts3ReallocOrFree+0x1c>
mov    %r14,%rdi
call   1030 <sqlite3_free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @fts3ReallocOrFree(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 i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @sqlite3_realloc(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @sqlite3_free(i8* %12)
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @fts3ReallocOrFree(i8* %0, i32 %1) {
%3 = tail call i8* @sqlite3_realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @sqlite3_free(i8* %0)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t getIncrement() {
  static uint64_t i = 0;
  i = (i + 1) & ~(1 << (15));
  return i;
}


x86 assembly (clang, -O0):
<getIncrement>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
and    $0xffff7fff,%eax
mov    %eax,0x2f0c(%rip)
mov    0x2f06(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIncrement>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
and    $0xffff7fff,%eax
mov    %eax,0x2f10(%rip)
ret

LLVM IR (-O0):
@getIncrement.i = internal global i32 0
define i32 @getIncrement() {
%1 = load i32, i32* @getIncrement.i
%2 = add nsw i32 %1, 1
%3 = and i32 %2, -32769
store i32 %3, i32* @getIncrement.i
%4 = load i32, i32* @getIncrement.i
ret i32 %4
}

LLVM IR (-O2):
@getIncrement.i = internal unnamed_addr global i32 0
define i32 @getIncrement() {
%1 = load i32, i32* @getIncrement.i
%2 = add nsw i32 %1, 1
%3 = and i32 %2, -32769
store i32 %3, i32* @getIncrement.i
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wrefresh(WINDOW *w) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wrefresh(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_stack_empty();
int /*<<< orphan*/ test_stack_move();
int /*<<< orphan*/ test_stack_push_pop();
int /*<<< orphan*/ test_stack_top();
int main(void) {
  test_stack_empty();
  test_stack_top();
  test_stack_push_pop();
  test_stack_move();
  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_stack_empty@plt>
mov    $0x0,%al
call   1040 <test_stack_top@plt>
mov    $0x0,%al
call   1050 <test_stack_push_pop@plt>
mov    $0x0,%al
call   1030 <test_stack_move@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_stack_empty@plt>
xor    %eax,%eax
call   1040 <test_stack_top@plt>
xor    %eax,%eax
call   1050 <test_stack_push_pop@plt>
xor    %eax,%eax
call   1030 <test_stack_move@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_stack_empty()
%3 = call i32 (...) @test_stack_top()
%4 = call i32 (...) @test_stack_push_pop()
%5 = call i32 (...) @test_stack_move()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_stack_empty()
%2 = tail call i32 (...) @test_stack_top()
%3 = tail call i32 (...) @test_stack_push_pop()
%4 = tail call i32 (...) @test_stack_move()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sigchld_hdl(int sig) {
  while (waitpid(-1, NULL, WNOHANG) > 0) {
  }
}


x86 assembly (clang, -O0):
<sigchld_hdl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <sigchld_hdl+0x31>
jmp    111b <sigchld_hdl+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld_hdl>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <sigchld_hdl+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @sigchld_hdl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @sigchld_hdl(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
/* Type definitions */
struct map_t {
  int dummy;
};

/* Variables and functions */
char *map_get(struct map_t *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
void display_both(struct map_t *m, char *first) {
  printf("%s %s\n", first, map_get(m, first));
}


x86 assembly (clang, -O0):
<display_both>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <map_get@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_both>:
push   %rbx
mov    %rsi,%rbx
call   1030 <map_get@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.map_t = type { i32 }
@.str = [7 x i8] c"%s %s\0A\00"
define void @display_both(%struct.map_t* %0, i8* %1) {
%3 = alloca %struct.map_t*
%4 = alloca i8*
store %struct.map_t* %0, %struct.map_t** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load %struct.map_t*, %struct.map_t** %3
%7 = load i8*, i8** %4
%8 = call i8* @map_get(%struct.map_t* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %8)
ret void
}

LLVM IR (-O2):
%struct.map_t = type { i32 }
@.str = [7 x i8] c"%s %s\0A\00"
define void @display_both(%struct.map_t* %0, i8* %1) {
%3 = tail call i8* @map_get(%struct.map_t* %0, i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _bytecode_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
uint32_t bytecode_call(uint8_t r0) {
  return _bytecode_write(11, 0, 0, r0, 0, 0);
}


x86 assembly (clang, -O0):
<bytecode_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xb,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%r8d
call   1030 <_bytecode_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytecode_call>:
mov    %edi,%ecx
mov    $0xb,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <_bytecode_write@plt>

LLVM IR (-O0):
define i32 @bytecode_call(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_bytecode_write(i32 11, i32 0, i32 0, i32 %3, i32 0, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @bytecode_call(i32 %0) {
%2 = tail call i32 @_bytecode_write(i32 11, i32 0, i32 0, i32 %0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int SIM_power_draincap(double, int, int);
scalar_t__ SIM_power_gatecap(double, int /*<<< orphan*/);
double SIM_matrix_arbiter_int_cap() {
  double Ctotal = 0;
  Ctotal += 2 * SIM_power_draincap((5.4 * 0.0875), 1, 1) +
            SIM_power_draincap((30.5 * 0.0875), 0, 2);
  Ctotal += SIM_power_gatecap((5.4 * 0.0875) + (30.5 * 0.0875), 0);
  return Ctotal;
}


x86 assembly (clang, -O0):
<SIM_matrix_arbiter_int_cap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xed8(%rip),%xmm0
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <SIM_power_draincap@plt>
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsd  0xeb6(%rip),%xmm0
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe85(%rip),%xmm0
xor    %edi,%edi
call   1040 <SIM_power_gatecap@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_matrix_arbiter_int_cap>:
push   %rbx
sub    $0x10,%rsp
movsd  0xed3(%rip),%xmm0
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ebx
movsd  0xec2(%rip),%xmm0
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <SIM_power_draincap@plt>
lea    (%rax,%rbx,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xea6(%rip),%xmm0
xor    %edi,%edi
call   1040 <SIM_power_gatecap@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @SIM_matrix_arbiter_int_cap() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = call i32 @SIM_power_draincap(double 4.725000e-01, i32 1, i32 1)
%3 = mul nsw i32 2, %2
%4 = call i32 @SIM_power_draincap(double 0x4005599999999999, i32 0, i32 2)
%5 = add nsw i32 %3, %4
%6 = sitofp i32 %5 to double
%7 = load double, double* %1
%8 = fadd double %7, %6
store double %8, double* %1
%9 = call i64 @SIM_power_gatecap(double 3.141250e+00, i32 0)
%10 = sitofp i64 %9 to double
%11 = load double, double* %1
%12 = fadd double %11, %10
store double %12, double* %1
%13 = load double, double* %1
ret double %13
}

LLVM IR (-O2):
define double @SIM_matrix_arbiter_int_cap() {
%1 = tail call i32 @SIM_power_draincap(double 4.725000e-01, i32 1, i32 1)
%2 = shl nsw i32 %1, 1
%3 = tail call i32 @SIM_power_draincap(double 0x4005599999999999, i32 0, i32 2)
%4 = add nsw i32 %2, %3
%5 = sitofp i32 %4 to double
%6 = tail call i64 @SIM_power_gatecap(double 3.141250e+00, i32 0)
%7 = sitofp i64 %6 to double
%8 = fadd double %5, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void clearCls(void) { system("clear"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @clearCls() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ ltr_int_log_message(char *, int /*<<< orphan*/);
char *strdup(char const *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
char *ltr_int_my_strdup(const char *s) {
  char *ptr = strdup(s);
  if (ptr == NULL) {
    ltr_int_log_message("Can't strdup! %s\n", strerror(errno));
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<ltr_int_my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118a <ltr_int_my_strdup+0x4a>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
call   1030 <ltr_int_log_message@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltr_int_my_strdup>:
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     114d <ltr_int_my_strdup+0xd>
pop    %rcx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
call   1030 <ltr_int_log_message@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Can't strdup! %s\0A\00"
@errno = global i32 0
define i8* @ltr_int_my_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @ltr_int_log_message(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [18 x i8] c"Can't strdup! %s\0A\00"
@errno = global i32 0
define noalias i8* @ltr_int_my_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @ltr_int_log_message(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
long generate_id(char *);
char *who_has_id(long);
char *who_has(char *filename) {
  long obj = generate_id(filename);
  return who_has_id(obj);
}


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

x86 assembly (clang, -O2):
<who_has>:
push   %rax
call   1030 <generate_id@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <who_has_id@plt>

LLVM IR (-O0):
define i8* @who_has(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @generate_id(i8* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i8* @who_has_id(i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @who_has(i8* %0) {
%2 = tail call i64 @generate_id(i8* %0)
%3 = tail call i8* @who_has_id(i64 %2)
ret i8* %3
}
void foo792() {}


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

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

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

LLVM IR (-O2):
define void @foo792() {
ret void
}
/* Variables and functions */
char get_char_configurable(int);
char get_char() { return get_char_configurable(1); }


x86 assembly (clang, -O0):
<get_char>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <get_char_configurable@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char>:
mov    $0x1,%edi
jmp    1030 <get_char_configurable@plt>

LLVM IR (-O0):
define signext i8 @get_char() {
%1 = call signext i8 @get_char_configurable(i32 1)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @get_char() {
%1 = tail call signext i8 @get_char_configurable(i32 1)
ret i8 %1
}