xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ caculate(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  char *ifn = NULL;
  if (argc < 2) {
    printf("wrong command format! usage:parallel_pagerank INPUTFILENAME\n");
    return 0;
  } else {
    ifn = argv[1];
    caculate(ifn);
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1160 <main+0x40>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    117c <main+0x5c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <caculate@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1134 <main+0x14>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
jmp    113d <main+0x1d>
mov    0x8(%rsi),%rdi
call   1040 <caculate@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [61 x i8] c"wrong command format! usage:parallel_pagerank INPUTFILENAME\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %17
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = call i32 @caculate(i8* %15)
store i32 0, i32* %3
br label %17
17: ; preds = %11, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@str = [60 x i8] c"wrong command format! usage:parallel_pagerank INPUTFILENAME\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @caculate(i8* %8)
br label %10
10: ; preds = %6, %4
ret i32 0
}
void not_a_real_crt0(void) {}


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

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

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

LLVM IR (-O2):
define void @not_a_real_crt0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void newUserNameClashDetector(char *userName) {
  printf("inside new user name clash detector\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"inside new user name clash detector\0A\00"
define void @newUserNameClashDetector(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"inside new user name clash detector\00"
define void @newUserNameClashDetector(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
int f2() {
  static enum E3 { D = 10, E, F } e;
  enum E3 e_which_stays;
}


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

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

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

LLVM IR (-O2):
define i32 @f2() {
ret i32 undef
}
/* Variables and functions */
int toupper(int const);
int asciitoupper(const int c) { return c < 0x80 ? toupper(c) : c; }


x86 assembly (clang, -O0):
<asciitoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
jge    1138 <asciitoupper+0x28>
mov    -0x4(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x8(%rbp)
jmp    113e <asciitoupper+0x2e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asciitoupper>:
cmp    $0x7f,%edi
jg     111a <asciitoupper+0xa>
jmp    1030 <toupper@plt>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @asciitoupper(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @toupper(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ %0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char title[] = "foo and stuff\n";
  printf("%s", title);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x13(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0xa666675747320,%rax
mov    %rax,0xf(%rsp)
movabs $0x20646e61206f6f66,%rax
6e 64 20
mov    %rax,0x8(%rsp)
lea    0xed6(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.title = [15 x i8] c"foo and stuff\0A\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
store i32 0, i32* %1
%3 = bitcast [15 x i8]* %2 to i8*
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.title = [15 x i8] c"foo and stuff\0A\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int is_relevant_file(const char *filename, long *uid, long *gid) { return 1; }


x86 assembly (clang, -O0):
<is_relevant_file>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_relevant_file(i8* nocapture readnone %0, i64* nocapture readnone %1, i64* nocapture readnone %2) {
ret i32 1
}
void strcopy(char *s, char *t) {
  while ((*s = *t) != '\0') {
    s++;
    t++;
  }
}


x86 assembly (clang, -O0):
<strcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1141 <strcopy+0x41>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcopy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcopy>:
mov    (%rsi),%al
mov    %al,(%rdi)
test   %al,%al
je     111f <strcopy+0x1f>
mov    $0x1,%eax
nopl   (%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcopy+0x10>
ret

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

LLVM IR (-O2):
define void @strcopy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %1, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
store i8 %10, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lw_langde_init();
int /*<<< orphan*/ lw_langdk_init();
int /*<<< orphan*/ lw_langen_init();
int /*<<< orphan*/ lw_langfr_init();
int /*<<< orphan*/ lw_langpl_init();
void lw_lang_init() {
  lw_langde_init();
  lw_langdk_init();
  lw_langen_init();
  lw_langfr_init();
  lw_langpl_init();
}


x86 assembly (clang, -O0):
<lw_lang_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <lw_langde_init@plt>
mov    $0x0,%al
call   1060 <lw_langdk_init@plt>
mov    $0x0,%al
call   1070 <lw_langen_init@plt>
mov    $0x0,%al
call   1030 <lw_langfr_init@plt>
mov    $0x0,%al
call   1040 <lw_langpl_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw_lang_init>:
push   %rax
xor    %eax,%eax
call   1050 <lw_langde_init@plt>
xor    %eax,%eax
call   1060 <lw_langdk_init@plt>
xor    %eax,%eax
call   1070 <lw_langen_init@plt>
xor    %eax,%eax
call   1030 <lw_langfr_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <lw_langpl_init@plt>

LLVM IR (-O0):
define void @lw_lang_init() {
%1 = call i32 (...) @lw_langde_init()
%2 = call i32 (...) @lw_langdk_init()
%3 = call i32 (...) @lw_langen_init()
%4 = call i32 (...) @lw_langfr_init()
%5 = call i32 (...) @lw_langpl_init()
ret void
}

LLVM IR (-O2):
define void @lw_lang_init() {
%1 = tail call i32 (...) @lw_langde_init()
%2 = tail call i32 (...) @lw_langdk_init()
%3 = tail call i32 (...) @lw_langen_init()
%4 = tail call i32 (...) @lw_langfr_init()
%5 = tail call i32 (...) @lw_langpl_init()
ret void
}
int fun333() { return 333; }


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

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

LLVM IR (-O0):
define i32 @fun333() {
ret i32 333
}

LLVM IR (-O2):
define i32 @fun333() {
ret i32 333
}
/* Type definitions */
typedef unsigned short volatile uint32_t;

/* Variables and functions */
uint32_t USBFrameNumberGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned short *)(ui32Base + 0x0000000C))));
}


x86 assembly (clang, -O0):
<USBFrameNumberGet>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%eax
add    $0xc,%eax
cltq
mov    (%rax),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBFrameNumberGet>:
mov    %di,-0x2(%rsp)
movzwl -0x2(%rsp),%eax
movzwl 0xc(%rax),%eax
ret

LLVM IR (-O0):
define zeroext i16 @USBFrameNumberGet(i16 zeroext %0) {
%2 = alloca i16
store volatile i16 %0, i16* %2
%3 = load volatile i16, i16* %2
%4 = zext i16 %3 to i32
%5 = add nsw i32 %4, 12
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i16*
%8 = load volatile i16, i16* %7
ret i16 %8
}

LLVM IR (-O2):
define zeroext i16 @USBFrameNumberGet(i16 zeroext %0) {
%2 = alloca i16
store volatile i16 %0, i16* %2
%3 = load volatile i16, i16* %2
%4 = zext i16 %3 to i64
%5 = add nuw nsw i64 %4, 12
%6 = inttoptr i64 %5 to i16*
%7 = load volatile i16, i16* %6
ret i16 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _CANBaseValid(int);
void CANRetrySet(uint32_t ui32Base, bool bAutoRetry) {
  uint32_t ui32CtlReg;
  ASSERT(_CANBaseValid(ui32Base));
  ui32CtlReg = (*((volatile uint32_t *)(ui32Base + 0x00000000)));
  if (bAutoRetry) {
    ui32CtlReg &= ~0x00000020;
  } else {
    ui32CtlReg |= 0x00000020;
  }
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) = ui32CtlReg;
}


x86 assembly (clang, -O0):
<CANRetrySet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_CANBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1162 <CANRetrySet+0x42>
mov    -0xc(%rbp),%eax
and    $0xffffffdf,%eax
mov    %eax,-0xc(%rbp)
jmp    116b <CANRetrySet+0x4b>
mov    -0xc(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANRetrySet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <_CANBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebp,%rax
mov    (%rax),%ecx
xor    %edx,%edx
test   %ebx,%ebx
sete   %dl
and    $0xffffffdf,%ecx
shl    $0x5,%edx
or     %ecx,%edx
mov    %edx,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @CANRetrySet(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 = call i32 @_CANBaseValid(i32 %6)
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 0
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load i32, i32* %5
%18 = and i32 %17, -33
store i32 %18, i32* %5
br label %22
19: ; preds = %2
%20 = load i32, i32* %5
%21 = or i32 %20, 32
store i32 %21, i32* %5
br label %22
22: ; preds = %19, %16
%23 = load i32, i32* %5
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 0
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
store volatile i32 %23, i32* %27
ret void
}

LLVM IR (-O2):
define void @CANRetrySet(i32 %0, i32 %1) {
%3 = tail call i32 @_CANBaseValid(i32 %0)
%4 = tail call i32 @ASSERT(i32 %3)
%5 = sext i32 %0 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = icmp eq i32 %1, 0
%9 = and i32 %7, -33
%10 = select i1 %8, i32 32, i32 0
%11 = or i32 %9, %10
store volatile i32 %11, i32* %6
ret void
}
OP(dd, a0) { op_a0(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_a0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_a0()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLPROC_EBPSAFE(int);
void texteffect_update_all() { RCT2_CALLPROC_EBPSAFE(0x00672AA4); }


x86 assembly (clang, -O0):
<texteffect_update_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x672aa4,%edi
call   1030 <RCT2_CALLPROC_EBPSAFE@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<texteffect_update_all>:
mov    $0x672aa4,%edi
jmp    1030 <RCT2_CALLPROC_EBPSAFE@plt>

LLVM IR (-O0):
define void @texteffect_update_all() {
%1 = call i32 @RCT2_CALLPROC_EBPSAFE(i32 6761124)
ret void
}

LLVM IR (-O2):
define void @texteffect_update_all() {
%1 = tail call i32 @RCT2_CALLPROC_EBPSAFE(i32 6761124)
ret void
}
int not_with_args_fcn(moose) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ send_to_rsocket(int /*<<< orphan*/, void *,
                                   int /*<<< orphan*/, int);
int64_t send_to_socket_confirm(int64_t s, void *data, int64_t length) {
  return send_to_rsocket(s, data, length, 4);
}


x86 assembly (clang, -O0):
<send_to_socket_confirm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x4,%ecx
call   1030 <send_to_rsocket@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_to_socket_confirm>:
mov    $0x4,%ecx
jmp    1030 <send_to_rsocket@plt>

LLVM IR (-O0):
define i32 @send_to_socket_confirm(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 @send_to_rsocket(i32 %7, i8* %8, i32 %9, i32 4)
ret i32 %10
}

LLVM IR (-O2):
define i32 @send_to_socket_confirm(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send_to_rsocket(i32 %0, i8* %1, i32 %2, i32 4)
ret i32 %4
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int, int);
int sub(int, int);
int main() {
  int r = add(45, 55);
  int s = sub(145, 55);
  printf("%d,%d\n", r, s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2d,%edi
mov    $0x37,%esi
call   1030 <add@plt>
mov    %eax,-0x8(%rbp)
mov    $0x91,%edi
mov    $0x37,%esi
call   1050 <sub@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2d,%edi
mov    $0x37,%esi
call   1030 <add@plt>
mov    %eax,%ebx
mov    $0x91,%edi
mov    $0x37,%esi
call   1050 <sub@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d,%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @add(i32 45, i32 55)
store i32 %4, i32* %2
%5 = call i32 @sub(i32 145, i32 55)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d,%d\0A\00"
define i32 @main() {
%1 = tail call i32 @add(i32 45, i32 55)
%2 = tail call i32 @sub(i32 145, i32 55)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
int snextChar(void *ud) {
  int c = **(char **)ud;
  (*(char **)ud)++;
  if (c == 0) {
    return -1;
  }
  return c;
}


x86 assembly (clang, -O0):
<snextChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
cmpl   $0x0,-0x14(%rbp)
jne    1139 <snextChar+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    113f <snextChar+0x3f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<snextChar>:
mov    (%rdi),%rax
mov    (%rax),%cl
add    $0x1,%rax
mov    %rax,(%rdi)
cmp    $0x1,%cl
sbb    %eax,%eax
or     %cl,%al
movsbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @snextChar(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %5, i8** %2
%6 = icmp eq i8 %4, 0
%7 = select i1 %6, i8 -1, i8 %4
%8 = sext i8 %7 to i32
ret i32 %8
}
void gx_reply_ok(char *buf) {
  buf[0] = 'O';
  buf[1] = 'K';
  buf[2] = '\0';
}


x86 assembly (clang, -O0):
<gx_reply_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x4f,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x4b,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gx_reply_ok>:
movw   $0x4b4f,(%rdi)
movb   $0x0,0x2(%rdi)
ret

LLVM IR (-O0):
define void @gx_reply_ok(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 79, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 75, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @gx_reply_ok(i8* nocapture writeonly %0) {
store i8 79, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 75, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 0, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func_no_leaf();
__attribute__((optimize("no-omit-frame-pointer"))) void func2(void) {
  int a = 0;
  func_no_leaf();
}


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

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

LLVM IR (-O0):
define void @func2() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @func_no_leaf()
ret void
}

LLVM IR (-O2):
define void @func2() {
%1 = tail call i32 (...) @func_no_leaf()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ascii_valid() {
  printf("NOT IMPLEMENTED:"
         "pa_ascii_valid"
         "\n");
}


x86 assembly (clang, -O0):
<pa_ascii_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_ascii_valid\0A\00"
define i32 @pa_ascii_valid() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_ascii_valid\00"
define i32 @pa_ascii_valid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned int);
__attribute__((weak)) extern void __aeabi_memcpy(void *dest, void *src,
                                                 unsigned int n) {
  memcpy(dest, src, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memcpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define weak void @__aeabi_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
void BSP_SetPageAttribute(unsigned long addr, unsigned long attr) {
  ({
    unsigned long __v = attr;
    (*(volatile unsigned long *)((0x01848000 + 4 * (addr / 16777216))) = (__v));
    __v;
  });
}


x86 assembly (clang, -O0):
<BSP_SetPageAttribute>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
shl    $0x2,%rax
add    $0x1848000,%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_SetPageAttribute>:
shr    $0x18,%rdi
mov    %rsi,0x1848000(,%rdi,4)
01
ret

LLVM IR (-O0):
define void @BSP_SetPageAttribute(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = load i64, i64* %3
%10 = udiv i64 %9, 16777216
%11 = mul i64 4, %10
%12 = add i64 25460736, %11
%13 = inttoptr i64 %12 to i64*
store volatile i64 %8, i64* %13
%14 = load i64, i64* %5
store i64 %14, i64* %6
%15 = load i64, i64* %6
ret void
}

LLVM IR (-O2):
define void @BSP_SetPageAttribute(i64 %0, i64 %1) {
%3 = lshr i64 %0, 22
%4 = and i64 %3, 4398046511100
%5 = add nuw nsw i64 %4, 25460736
%6 = inttoptr i64 %5 to i64*
store volatile i64 %1, i64* %6
ret void
}
int inside_gamut(double r, double g, double b) {
  return (r >= 0) && (g >= 0) && (b >= 0);
}


x86 assembly (clang, -O0):
<inside_gamut>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jb     1153 <inside_gamut+0x53>
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jb     1153 <inside_gamut+0x53>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inside_gamut>:
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
setae  %al
ucomisd %xmm3,%xmm1
setae  %cl
and    %al,%cl
ucomisd %xmm3,%xmm2
setae  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @inside_gamut(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fcmp oge double %7, 0.000000e+00
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load double, double* %5
%11 = fcmp oge double %10, 0.000000e+00
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load double, double* %6
%14 = fcmp oge double %13, 0.000000e+00
br label %15
15: ; preds = %12, %9, %3
%16 = phi i1 [ false, %9 ], [ false, %3 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @inside_gamut(double %0, double %1, double %2) {
%4 = fcmp oge double %0, 0.000000e+00
%5 = fcmp oge double %1, 0.000000e+00
%6 = and i1 %4, %5
%7 = fcmp oge double %2, 0.000000e+00
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
struct vec2i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
__attribute__((always_)) struct vec2i *psvec2i(struct vec2i *result, int32_t x,
                                               int32_t y) {
  vec2i((int32_t *)result, x, y);
  return result;
}


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

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

LLVM IR (-O0):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i(%struct.vec2i* %0, i32 %1, i32 %2) {
%4 = alloca %struct.vec2i*
%5 = alloca i32
%6 = alloca i32
store %struct.vec2i* %0, %struct.vec2i** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.vec2i*, %struct.vec2i** %4
%8 = bitcast %struct.vec2i* %7 to i32*
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @vec2i(i32* %8, i32 %9, i32 %10)
%12 = load %struct.vec2i*, %struct.vec2i** %4
ret %struct.vec2i* %12
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i(%struct.vec2i* returned %0, i32 %1, i32 %2) {
%4 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%5 = tail call i32 @vec2i(i32* %4, i32 %1, i32 %2)
ret %struct.vec2i* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int a = 0;
  if (a == 0x55) {
    printf("666\n");
  patata:
    printf("777\n");
  } else {
    printf("B\n");
    goto patata;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x55,-0x8(%rbp)
jne    114d <main+0x3d>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    115e <main+0x4e>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    113c <main+0x2c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"666\0A\00"
@.str.1 = [5 x i8] c"777\0A\00"
@.str.2 = [3 x i8] c"B\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 85
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %9, %5
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %7
11: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"B\00"
@str.3 = [4 x i8] c"777\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("I am test sub2.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"I am test sub2.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"I am test sub2.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void array(int e[]) {
  int *d;
  d[0] = 3;
  e[0] = 3;
  d[e[0]] = 3;
}


x86 assembly (clang, -O0):
<array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
movl   $0x3,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @array(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32 3, i32* %5
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 3, i32* %7
%8 = load i32*, i32** %3
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %8, i64 %12
store i32 3, i32* %13
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int is_string(char *s) {
  if (s == NULL || *s == '\0') {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1123 <is_string+0x23>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    112f <is_string+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1136 <is_string+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_string>:
test   %rdi,%rdi
je     110b <is_string+0xb>
cmpb   $0x1,(%rdi)
sbb    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @is_string(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %6, %1
store i32 -1, i32* %2
br label %13
12: ; preds = %6
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ -1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle17() { kprintf("ISR %d.\n", 17); }


x86 assembly (clang, -O0):
<isrHandle17>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x11,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrHandle17>:
lea    0xee9(%rip),%rdi
mov    $0x11,%esi
jmp    1030 <kprintf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle17() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 17)
ret void
}
int decide_k_bits(int p_bits) {
  return (p_bits <= 5120) ? p_bits / 10 + 160 : (p_bits / 8 + 200) * 3 / 2;
}


x86 assembly (clang, -O0):
<decide_k_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1400,-0x4(%rbp)
jg     112c <decide_k_bits+0x2c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0xa0,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <decide_k_bits+0x4a>
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
add    $0xc8,%eax
imul   $0x3,%eax,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decide_k_bits>:
cmp    $0x1400,%edi
jg     1125 <decide_k_bits+0x25>
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
sar    $0x22,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0xa0,%eax
ret
shr    $0x3,%edi
lea    (%rdi,%rdi,2),%eax
add    $0x258,%eax
shr    %eax
ret

LLVM IR (-O0):
define i32 @decide_k_bits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 5120
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 10
%8 = add nsw i32 %7, 160
br label %15
9: ; preds = %1
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 8
%12 = add nsw i32 %11, 200
%13 = mul nsw i32 %12, 3
%14 = sdiv i32 %13, 2
br label %15
15: ; preds = %9, %5
%16 = phi i32 [ %8, %5 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @decide_k_bits(i32 %0) {
%2 = icmp slt i32 %0, 5121
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = sdiv i32 %0, 10
%5 = add nsw i32 %4, 160
br label %11
6: ; preds = %1
%7 = lshr i32 %0, 3
%8 = mul nuw nsw i32 %7, 3
%9 = add nuw nsw i32 %8, 600
%10 = lshr i32 %9, 1
br label %11
11: ; preds = %6, %3
%12 = phi i32 [ %5, %3 ], [ %10, %6 ]
ret i32 %12
}
/* Variables and functions */
void *xzalloc(size_t);
void *xcalloc(size_t nmemb, size_t size) { return xzalloc(nmemb * size); }


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

x86 assembly (clang, -O2):
<xcalloc>:
imul   %rsi,%rdi
jmp    1030 <xzalloc@plt>

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

LLVM IR (-O2):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @xzalloc(i64 %3)
ret i8* %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ delta;
};
typedef TYPE_1__ XTextItem16;

/* Variables and functions */
int get_XTextItem16_delta(void *_p) { return (int)((XTextItem16 *)_p)->delta; }


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

x86 assembly (clang, -O2):
<get_XTextItem16_delta>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XTextItem16_delta(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XTextItem16_delta(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *coro(void *arg) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @coro(i8* nocapture readnone %0) {
ret i8* null
}
int foo21() { return 21; }


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

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

LLVM IR (-O0):
define i32 @foo21() {
ret i32 21
}

LLVM IR (-O2):
define i32 @foo21() {
ret i32 21
}
int dns_cache_check(struct dns_cache *cache) {
  (void)cache;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.dns_cache = type opaque
define i32 @dns_cache_check(%struct.dns_cache* %0) {
%2 = alloca %struct.dns_cache*
store %struct.dns_cache* %0, %struct.dns_cache** %2
%3 = load %struct.dns_cache*, %struct.dns_cache** %2
ret i32 0
}

LLVM IR (-O2):
%struct.dns_cache = type opaque
define i32 @dns_cache_check(%struct.dns_cache* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           unsigned int, char const *, char const *);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn))
__dpl_fail(const char *assertion, const char *file, unsigned int line,
           const char *function) {
  fprintf(stderr, "%s:%d: %s: dpl assertion failed: %s\n", file, line, function,
          assertion);
  abort();
}


x86 assembly (clang, -O0):
<__dpl_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x8(%rbp),%r9
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__dpl_fail>:
push   %rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%r9
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"%s:%d: %s: dpl assertion failed: %s\0A\00"
define void @__dpl_fail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = load i8*, i8** %5
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12, i8* %13)
%15 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"%s:%d: %s: dpl assertion failed: %s\0A\00"
define void @__dpl_fail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3, i8* %0)
%7 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int _stub(int /*<<< orphan*/);
int _close(int fd) { return _stub(EBADF); }


x86 assembly (clang, -O0):
<_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <_stub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_close>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_stub@plt>

LLVM IR (-O0):
@EBADF = global i32 0
define i32 @_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EBADF
%4 = call i32 @_stub(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@EBADF = global i32 0
define i32 @_close(i32 %0) {
%2 = load i32, i32* @EBADF
%3 = tail call i32 @_stub(i32 %2)
ret i32 %3
}
/* Variables and functions */
unsigned long uugcGetLineNumber();
extern unsigned long uwiGetLineNumber(void) { return uugcGetLineNumber(); }


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

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

LLVM IR (-O0):
define i64 @uwiGetLineNumber() {
%1 = call i64 (...) @uugcGetLineNumber()
ret i64 %1
}

LLVM IR (-O2):
define i64 @uwiGetLineNumber() {
%1 = tail call i64 (...) @uugcGetLineNumber()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc_model(unsigned int, unsigned int);
void *zalloc_or_die(unsigned size) {
  void *ptr = calloc_model(1U, size);
  if (ptr)
    return ptr;
  abort();
}


x86 assembly (clang, -O0):
<zalloc_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1040 <calloc_model@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1151 <zalloc_or_die+0x31>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<zalloc_or_die>:
push   %rax
mov    %edi,%esi
mov    $0x1,%edi
call   1040 <calloc_model@plt>
test   %rax,%rax
je     1134 <zalloc_or_die+0x14>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @zalloc_or_die(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @calloc_model(i32 1, i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
ret i8* %9
10: ; preds = %1
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i8* @zalloc_or_die(i32 %0) {
%2 = tail call i8* @calloc_model(i32 1, i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
size_t aeron_format_min(size_t a, size_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<aeron_format_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <aeron_format_min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <aeron_format_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_format_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @aeron_format_min(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
__attribute__((noipa)) int fn9(int x) { return x + 12; }


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

x86 assembly (clang, -O2):
<fn9>:
lea    0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @fn9(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 12
ret i32 %4
}

LLVM IR (-O2):
define i32 @fn9(i32 %0) {
%2 = add nsw i32 %0, 12
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ allot_float(int /*<<< orphan*/);
int /*<<< orphan*/ bignum_to_float(int /*<<< orphan*/);
int /*<<< orphan*/ dpeek();
int /*<<< orphan*/ drepl(int /*<<< orphan*/);
void primitive_bignum_to_float(void) {
  drepl(allot_float(bignum_to_float(dpeek())));
}


x86 assembly (clang, -O0):
<primitive_bignum_to_float>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <bignum_to_float@plt>
mov    %eax,%edi
call   1060 <allot_float@plt>
mov    %eax,%edi
call   1050 <drepl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_bignum_to_float>:
push   %rax
xor    %eax,%eax
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <bignum_to_float@plt>
mov    %eax,%edi
call   1060 <allot_float@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <drepl@plt>

LLVM IR (-O0):
define void @primitive_bignum_to_float() {
%1 = call i32 (...) @dpeek()
%2 = call i32 @bignum_to_float(i32 %1)
%3 = call i32 @allot_float(i32 %2)
%4 = call i32 @drepl(i32 %3)
ret void
}

LLVM IR (-O2):
define void @primitive_bignum_to_float() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 @bignum_to_float(i32 %1)
%3 = tail call i32 @allot_float(i32 %2)
%4 = tail call i32 @drepl(i32 %3)
ret void
}