xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int elibcls(void) {
  printf(
      "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
}


x86 assembly (clang, -O0):
<elibcls>:
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):
<elibcls>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [173 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define i32 @elibcls() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([173 x i8], [173 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int b(int a, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @b(i32 %0, ...) {
ret i32 0
}
/* Variables and functions */
int getAtomHashPos_(char *, char *);
int strlen(char *);
int getAtomHashPos(char *name) {
  return getAtomHashPos_(name, name + strlen(name));
}


x86 assembly (clang, -O0):
<getAtomHashPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdi
cltq
add    %rax,%rsi
call   1040 <getAtomHashPos_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAtomHashPos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rsi
add    %rbx,%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <getAtomHashPos_@plt>

LLVM IR (-O0):
define i32 @getAtomHashPos(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = call i32 @getAtomHashPos_(i8* %3, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @getAtomHashPos(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @getAtomHashPos_(i8* %0, i8* %4)
ret i32 %5
}
void dfn_ad(double d) {}


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

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

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

LLVM IR (-O2):
define void @dfn_ad(double %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int ft_putchar_count(char c) {
  write(1, &c, 1);
  return (1);
}


x86 assembly (clang, -O0):
<ft_putchar_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchar_count>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ft_putchar_count(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 1
}

LLVM IR (-O2):
define i32 @ft_putchar_count(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 1
}
unsigned roundup(unsigned v) {
  if (v == 0) {
    v = 1;
  }
  int lz = __builtin_clz((int)v);
  unsigned rounded = ((unsigned)0x80000000) >> lz;
  if (v > rounded && lz > 0) {
    rounded <<= 1;
  }
  return rounded;
}


x86 assembly (clang, -O0):
<roundup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1118 <roundup+0x18>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x80000000,%eax
shr    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1150 <roundup+0x50>
cmpl   $0x0,-0x8(%rbp)
jle    1150 <roundup+0x50>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup>:
test   %edi,%edi
mov    $0x1,%edx
cmovne %edi,%edx
bsr    %edx,%ecx
xor    $0x1f,%ecx
mov    $0x80000000,%eax
shr    %cl,%eax
cmp    %eax,%edx
seta   %dl
test   %ecx,%ecx
setne  %cl
and    %dl,%cl
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @roundup(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %2
%10 = call i32 @llvm.ctlz.i32(i32 %9, i1 true)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = lshr i32 -2147483648, %11
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = load i32, i32* %4
%15 = icmp ugt i32 %13, %14
br i1 %15, label %16, label %22
16: ; preds = %8
%17 = load i32, i32* %3
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* %4
%21 = shl i32 %20, 1
store i32 %21, i32* %4
br label %22
22: ; preds = %19, %16, %8
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @roundup(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
%4 = tail call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = lshr i32 -2147483648, %4
%6 = icmp ugt i32 %3, %5
%7 = icmp ne i32 %4, 0
%8 = and i1 %7, %6
%9 = zext i1 %8 to i32
%10 = shl nuw i32 %5, %9
ret i32 %10
}
void clk_delayms(int ms) {
  int j;
  while (--ms > 0) {
    for (j = 0; j < 1200; j++)
      ;
  }
}


x86 assembly (clang, -O0):
<clk_delayms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jle    1145 <clk_delayms+0x45>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4b0,-0x8(%rbp)
jge    1140 <clk_delayms+0x40>
jmp    1132 <clk_delayms+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1120 <clk_delayms+0x20>
jmp    1107 <clk_delayms+0x7>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @clk_delayms(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ const_ptr_and_callback(int /*<<< orphan*/, char *, int,
                                          int /*<<< orphan*/);
char *malloc(int);
void r11160612_2() {
  char *x = malloc(12);
  const_ptr_and_callback(0, x, 12, 0);
}


x86 assembly (clang, -O0):
<r11160612_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %ecx,%ecx
mov    $0xc,%edx
mov    %ecx,%edi
call   1030 <const_ptr_and_callback@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r11160612_2>:
push   %rax
mov    $0xc,%edi
call   1040 <malloc@plt>
xor    %edi,%edi
mov    %rax,%rsi
mov    $0xc,%edx
xor    %ecx,%ecx
pop    %rax
jmp    1030 <const_ptr_and_callback@plt>

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

LLVM IR (-O2):
define void @r11160612_2() {
%1 = tail call dereferenceable_or_null(12) i8* @malloc(i32 12)
%2 = tail call i32 @const_ptr_and_callback(i32 0, i8* %1, i32 12, i32 0)
ret void
}
int Gpm_Close() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Gpm_Close() {
ret i32 0
}
/* Variables and functions */
int ungetch(int);
int ncurses_ungetch(int ch) { return ungetch(ch); }


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

x86 assembly (clang, -O2):
<ncurses_ungetch>:
jmp    1030 <ungetch@plt>

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

LLVM IR (-O2):
define i32 @ncurses_ungetch(i32 %0) {
%2 = tail call i32 @ungetch(i32 %0)
ret i32 %2
}
int CHECK_PREFIX_67(unsigned char v) { return v == 0x67; }


x86 assembly (clang, -O0):
<CHECK_PREFIX_67>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x67,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @CHECK_PREFIX_67(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 103
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @CHECK_PREFIX_67(i8 zeroext %0) {
%2 = icmp eq i8 %0, 103
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void UI_RemoveBots_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/common/arrow_up_16.tga");
  trap_R_RegisterShaderNoMip("menu/common/arrow_dn_16.tga");
}


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

x86 assembly (clang, -O2):
<UI_RemoveBots_Cache>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef8(%rip),%rdi
pop    %rax
jmp    1030 <trap_R_RegisterShaderNoMip@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"menu/common/arrow_up_16.tga\00"
@.str.1 = [28 x i8] c"menu/common/arrow_dn_16.tga\00"
define void @UI_RemoveBots_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"menu/common/arrow_up_16.tga\00"
@.str.1 = [28 x i8] c"menu/common/arrow_dn_16.tga\00"
define void @UI_RemoveBots_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void U420ToARGB() {}


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

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

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

LLVM IR (-O2):
define void @U420ToARGB() {
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int SortStrcmp(const void *p1, const void *p2) {
  const char *s1 = *(const char **)p1;
  const char *s2 = *(const char **)p2;
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<SortStrcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @SortStrcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @SortStrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
unsigned short foo(unsigned char x) { return x * 255; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
imul   $0xff,%eax,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
shl    $0x8,%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @foo(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = mul nsw i32 %4, 255
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @foo(i8 zeroext %0) {
%2 = zext i8 %0 to i16
%3 = mul nuw i16 %2, 255
ret i16 %3
}
/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void flush_input(void) {
  int c;
  while ((c = fgetc(stdin)) != '\n' && (c != EOF))
    ;
}


x86 assembly (clang, -O0):
<flush_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     114b <flush_input+0x3b>
mov    -0x4(%rbp),%eax
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    115b <flush_input+0x4b>
jmp    1160 <flush_input+0x50>
jmp    1118 <flush_input+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_input>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
mov    0x2ebe(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
je     1141 <flush_input+0x31>
cmp    (%rbx),%eax
jne    1130 <flush_input+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
define void @flush_input() {
%1 = alloca i32
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* @stdin
%4 = call i32 @fgetc(i32 %3)
store i32 %4, i32* %1
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* %1
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br label %10
10: ; preds = %6, %2
%11 = phi i1 [ false, %2 ], [ %9, %6 ]
br i1 %11, label %12, label %13
12: ; preds = %10
br label %2
13: ; preds = %10
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
define void @flush_input() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @stdin
%3 = tail call i32 @fgetc(i32 %2)
%4 = icmp ne i32 %3, 10
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %3, %5
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %1, label %8
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void my_free(void *nodep) {
  if (NULL == nodep)
    return;
  free(*(void **)nodep);
}


x86 assembly (clang, -O0):
<my_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    112d <my_free+0x1d>
jmp    1139 <my_free+0x29>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_free>:
test   %rdi,%rdi
je     111d <my_free+0xd>
mov    (%rdi),%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @my_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = tail call i32 @free(i8* %5)
br label %7
7: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ BigEndianWriteU32(int /*<<< orphan*/, int /*<<< orphan*/ *);
void BigEndianWriteS32(int32_t value, uint8_t *bytes) {
  BigEndianWriteU32((uint32_t)value, bytes);
}


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

x86 assembly (clang, -O2):
<BigEndianWriteS32>:
jmp    1030 <BigEndianWriteU32@plt>

LLVM IR (-O0):
define void @BigEndianWriteS32(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i32*, i32** %4
%8 = call i32 @BigEndianWriteU32(i32 %6, i32* %7)
ret void
}

LLVM IR (-O2):
define void @BigEndianWriteS32(i64 %0, i32* %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @BigEndianWriteU32(i32 %3, i32* %1)
ret void
}
/* Type definitions */
struct ir_remote {
  int dummy;
};

/* Variables and functions */
scalar_t__ is_rc5(struct ir_remote const *);
scalar_t__ is_rc6(struct ir_remote const *);
int is_biphase(const struct ir_remote *remote) {
  if (is_rc5(remote) || is_rc6(remote))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_biphase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_rc5@plt>
cmp    $0x0,%rax
jne    1152 <is_biphase+0x32>
mov    -0x10(%rbp),%rdi
call   1040 <is_rc6@plt>
cmp    $0x0,%rax
je     115e <is_biphase+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <is_biphase+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_biphase>:
push   %rbx
mov    %rdi,%rbx
call   1030 <is_rc5@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <is_biphase+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <is_rc6@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.ir_remote = type { i32 }
define i32 @is_biphase(%struct.ir_remote* %0) {
%2 = alloca i32
%3 = alloca %struct.ir_remote*
store %struct.ir_remote* %0, %struct.ir_remote** %3
%4 = load %struct.ir_remote*, %struct.ir_remote** %3
%5 = call i64 @is_rc5(%struct.ir_remote* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load %struct.ir_remote*, %struct.ir_remote** %3
%9 = call i64 @is_rc6(%struct.ir_remote* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.ir_remote = type { i32 }
define i32 @is_biphase(%struct.ir_remote* %0) {
%2 = tail call i64 @is_rc5(%struct.ir_remote* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_rc6(%struct.ir_remote* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int cnss_logger_device_unregister(int radio, struct wiphy *wiphy) { return 0; }


x86 assembly (clang, -O0):
<cnss_logger_device_unregister>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.wiphy = type opaque
define i32 @cnss_logger_device_unregister(i32 %0, %struct.wiphy* nocapture readnone %1) {
ret i32 0
}
void qd_alloc_finalize(void) {}


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

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

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

LLVM IR (-O2):
define void @qd_alloc_finalize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ list_tar_entries(char *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ write_tar_entry(char *, char *);
int main(void) {
  printf("\n");
  write_tar_entry("tarino.tar", "Makefile");
  list_tar_entries("tarino.tar", 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <write_tar_entry@plt>
lea    0xe9d(%rip),%rdi
mov    $0x1,%esi
call   1050 <list_tar_entries@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xebe(%rip),%rbx
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <write_tar_entry@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <list_tar_entries@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [11 x i8] c"tarino.tar\00"
@.str.2 = [9 x i8] c"Makefile\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @write_tar_entry(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @list_tar_entries(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"tarino.tar\00"
@.str.2 = [9 x i8] c"Makefile\00"
define i32 @main() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @write_tar_entry(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @list_tar_entries(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
int mapping_get() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mapping_get() {
ret i32 0
}
/* Variables and functions */
int __builtin_mips_cabs_eq_d(double, double);
int test2(double a, double b) { return __builtin_mips_cabs_eq_d(a, b); }


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

x86 assembly (clang, -O2):
<test2>:
jmp    1030 <__builtin_mips_cabs_eq_d@plt>

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

LLVM IR (-O2):
define i32 @test2(double %0, double %1) {
%3 = tail call i32 @__builtin_mips_cabs_eq_d(double %0, double %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ VDP_drawText(char *, int, int);
int /*<<< orphan*/ VDP_init();
int /*<<< orphan*/ showException4WDump(int);
void _trapvinst_callback() {
  VDP_init();
  VDP_drawText("TRAPV INSTRUCTION EXCEPTION !", 5, 3);
  showException4WDump(5);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_trapvinst_callback>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VDP_init@plt>
lea    0xebe(%rip),%rdi
mov    $0x5,%esi
mov    $0x3,%edx
call   1050 <VDP_drawText@plt>
mov    $0x5,%edi
call   1040 <showException4WDump@plt>
jmp    115b <_trapvinst_callback+0x2b>

x86 assembly (clang, -O2):
<_trapvinst_callback>:
push   %rax
xor    %eax,%eax
call   1030 <VDP_init@plt>
lea    0xec1(%rip),%rdi
mov    $0x5,%esi
mov    $0x3,%edx
call   1050 <VDP_drawText@plt>
mov    $0x5,%edi
call   1040 <showException4WDump@plt>
nopl   0x0(%rax,%rax,1)
jmp    1160 <_trapvinst_callback+0x30>

LLVM IR (-O0):
@.str = [30 x i8] c"TRAPV INSTRUCTION EXCEPTION !\00"
define void @_trapvinst_callback() {
%1 = call i32 (...) @VDP_init()
%2 = call i32 @VDP_drawText(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 5, i32 3)
%3 = call i32 @showException4WDump(i32 5)
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
@.str = [30 x i8] c"TRAPV INSTRUCTION EXCEPTION !\00"
define void @_trapvinst_callback() {
%1 = tail call i32 (...) @VDP_init()
%2 = tail call i32 @VDP_drawText(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 5, i32 3)
%3 = tail call i32 @showException4WDump(i32 5)
br label %4
4: ; preds = %0, %4
br label %4
}
/* Variables and functions */
int setsockopt(int, int, int, void const *, int);
int /*<<< orphan*/ unix_error(char *);
void Setsockopt(int s, int level, int optname, const void *optval, int optlen) {
  int rc;
  if ((rc = setsockopt(s, level, optname, optval, optlen)) < 0)
    unix_error("Setsockopt error");
}


x86 assembly (clang, -O0):
<Setsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jge    1167 <Setsockopt+0x47>
lea    0xe9e(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Setsockopt>:
push   %rax
call   1030 <setsockopt@plt>
test   %eax,%eax
js     112c <Setsockopt+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"Setsockopt error\00"
define void @Setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @unix_error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int log_clock_gettime_realtime(struct timespec *ts) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  ts->tv_sec = tv.tv_sec;
  ts->tv_nsec = tv.tv_usec * 1000;
  return 0;
}


x86 assembly (clang, -O0):
<log_clock_gettime_realtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
imul   $0x3e8,-0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_clock_gettime_realtime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0xc(%rsp),%eax
mov    %eax,0x4(%rbx)
imul   $0x3e8,0x8(%rsp),%eax
mov    %eax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
%struct.timeval = type { i32, i32 }
define i32 @log_clock_gettime_realtime(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca %struct.timeval
store %struct.timespec* %0, %struct.timespec** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%6 = load i32, i32* %5
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
store i32 %6, i32* %8
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%10 = load i32, i32* %9
%11 = mul nsw i32 %10, 1000
%12 = load %struct.timespec*, %struct.timespec** %2
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %12, i32 0, i32 0
store i32 %11, i32* %13
ret i32 0
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
%struct.timeval = type { i32, i32 }
define i32 @log_clock_gettime_realtime(%struct.timespec* nocapture writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i32 %10, i32* %11
ret i32 0
}
/* Type definitions */
struct option_a {
  int dummy;
};
struct _getopt_data_a {
  int dummy;
};

/* Variables and functions */
int _getopt_internal_r_a(int, char *const *, char const *,
                         struct option_a const *, int *, int /*<<< orphan*/,
                         struct _getopt_data_a *, int /*<<< orphan*/);
int _getopt_long_r_a(int argc, char *const *argv, const char *options,
                     const struct option_a *long_options, int *opt_index,
                     struct _getopt_data_a *d) {
  return _getopt_internal_r_a(argc, argv, options, long_options, opt_index, 0,
                              d, 0);
}


x86 assembly (clang, -O0):
<_getopt_long_r_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%rax
xor    %r9d,%r9d
mov    %rax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <_getopt_internal_r_a@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getopt_long_r_a>:
push   %rax
mov    %r9,%rax
xor    %r9d,%r9d
push   $0x0
push   %rax
call   1030 <_getopt_internal_r_a@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.option_a = type { i32 }
%struct._getopt_data_a = type { i32 }
define i32 @_getopt_long_r_a(i32 %0, i8** %1, i8* %2, %struct.option_a* %3, i32* %4, %struct._getopt_data_a* %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i8*
%10 = alloca %struct.option_a*
%11 = alloca i32*
%12 = alloca %struct._getopt_data_a*
store i32 %0, i32* %7
store i8** %1, i8*** %8
store i8* %2, i8** %9
store %struct.option_a* %3, %struct.option_a** %10
store i32* %4, i32** %11
store %struct._getopt_data_a* %5, %struct._getopt_data_a** %12
%13 = load i32, i32* %7
%14 = load i8**, i8*** %8
%15 = load i8*, i8** %9
%16 = load %struct.option_a*, %struct.option_a** %10
%17 = load i32*, i32** %11
%18 = load %struct._getopt_data_a*, %struct._getopt_data_a** %12
%19 = call i32 @_getopt_internal_r_a(i32 %13, i8** %14, i8* %15, %struct.option_a* %16, i32* %17, i32 0, %struct._getopt_data_a* %18, i32 0)
ret i32 %19
}

LLVM IR (-O2):
%struct.option_a = type { i32 }
%struct._getopt_data_a = type { i32 }
define i32 @_getopt_long_r_a(i32 %0, i8** %1, i8* %2, %struct.option_a* %3, i32* %4, %struct._getopt_data_a* %5) {
%7 = tail call i32 @_getopt_internal_r_a(i32 %0, i8** %1, i8* %2, %struct.option_a* %3, i32* %4, i32 0, %struct._getopt_data_a* %5, i32 0)
ret i32 %7
}
void f(int a[2]) {}


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(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret void
}

LLVM IR (-O2):
define void @f(i32* nocapture %0) {
ret void
}
int djvu_read_doc_navm(struct djvu *doc, int len) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.djvu = type opaque
define i32 @djvu_read_doc_navm(%struct.djvu* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISDIR(int /*<<< orphan*/);
int stat(char *, struct stat *);
int _ln_is_directory(char *dest) {
  struct stat buf;
  if (stat(dest, &buf) == -1 || !S_ISDIR(buf.st_mode))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<_ln_is_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1153 <_ln_is_directory+0x33>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%eax
jne    115f <_ln_is_directory+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1166 <_ln_is_directory+0x46>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ln_is_directory>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1141 <_ln_is_directory+0x21>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @_ln_is_directory(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISDIR(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ TimerTickEnable();
void SystickEnable(void) { TimerTickEnable(); }


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

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

LLVM IR (-O0):
define void @SystickEnable() {
%1 = call i32 (...) @TimerTickEnable()
ret void
}

LLVM IR (-O2):
define void @SystickEnable() {
%1 = tail call i32 (...) @TimerTickEnable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ shutdown(int, int /*<<< orphan*/);
void inet_close(int sock) {
  shutdown(sock, SHUT_RDWR);
  close(sock);
}


x86 assembly (clang, -O0):
<inet_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_close>:
push   %rbx
mov    %edi,%ebx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@SHUT_RDWR = global i32 0
define void @inet_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SHUT_RDWR
%5 = call i32 @shutdown(i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
ret void
}

LLVM IR (-O2):
@SHUT_RDWR = global i32 0
define void @inet_close(i32 %0) {
%2 = load i32, i32* @SHUT_RDWR
%3 = tail call i32 @shutdown(i32 %0, i32 %2)
%4 = tail call i32 @close(i32 %0)
ret void
}
void foo_2_2_1_1_1_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_1_2_2_1_1() {
ret void
}
void TIME_Disable(void) { (*((volatile unsigned long *)0xE0004004)) = 0; }


x86 assembly (clang, -O0):
<TIME_Disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0004004,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TIME_Disable>:
mov    $0xe0004004,%eax
movq   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @TIME_Disable() {
store volatile i64 0, i64* inttoptr (i64 3758112772 to i64*)
ret void
}

LLVM IR (-O2):
define void @TIME_Disable() {
store volatile i64 0, i64* inttoptr (i64 3758112772 to i64*)
ret void
}
/* Variables and functions */
int lace_builtin_add_main(unsigned int, char **, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *);
int lace_main_add(unsigned argc, char **argv) {
  return lace_builtin_add_main(argc, argv, NULL, NULL);
}


x86 assembly (clang, -O0):
<lace_main_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <lace_builtin_add_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lace_main_add>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <lace_builtin_add_main@plt>

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

LLVM IR (-O2):
define i32 @lace_main_add(i32 %0, i8** %1) {
%3 = tail call i32 @lace_builtin_add_main(i32 %0, i8** %1, i32* null, i32* null)
ret i32 %3
}
/* Variables and functions */
double strtod(char const *, char **);
int parse_double(const char *arg, double *result) {
  char *end_arg;
  double val = strtod(arg, &end_arg);
  if (*arg && !*end_arg) {
    *result = val;
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<parse_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1168 <parse_double+0x58>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1168 <parse_double+0x58>
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    116f <parse_double+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_double>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1030 <strtod@plt>
xor    %eax,%eax
cmpb   $0x0,(%rbx)
je     113c <parse_double+0x2c>
mov    (%rsp),%rcx
cmpb   $0x0,(%rcx)
jne    113c <parse_double+0x2c>
movsd  %xmm0,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @parse_double(i8* %0, double* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call double @strtod(i8* %0, i8** %3)
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store double %5, double* %1
br label %13
13: ; preds = %2, %8, %12
%14 = phi i32 [ 1, %12 ], [ 0, %8 ], [ 0, %2 ]
ret i32 %14
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void tsaf_set_discontinuity(uint8_t *p_ts) { p_ts[5] |= 0x80; }


x86 assembly (clang, -O0):
<tsaf_set_discontinuity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
or     $0x80,%ecx
mov    %ecx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsaf_set_discontinuity>:
orb    $0x80,0x14(%rdi)
ret

LLVM IR (-O0):
define void @tsaf_set_discontinuity(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = or i32 %5, 128
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @tsaf_set_discontinuity(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = or i32 %3, 128
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int pos_process(char *, int /*<<< orphan*/, int const);
int /*<<< orphan*/ pre_process(char *, int /*<<< orphan*/, int const);
int /*<<< orphan*/ strlen(char *);
int convert(const int from, const int to, char *input, char *output) {
  int size = pos_process(output, pre_process(input, strlen(input), from), to);
  return size;
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
mov    -0x4(%rbp),%edx
call   1050 <pre_process@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
call   1030 <pos_process@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %edi,%ebp
mov    %rdx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
call   1050 <pre_process@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    %r15d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <pos_process@plt>

LLVM IR (-O0):
define i32 @convert(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %8
%11 = load i8*, i8** %7
%12 = load i8*, i8** %7
%13 = call i32 @strlen(i8* %12)
%14 = load i32, i32* %5
%15 = call i32 @pre_process(i8* %11, i32 %13, i32 %14)
%16 = load i32, i32* %6
%17 = call i32 @pos_process(i8* %10, i32 %15, i32 %16)
store i32 %17, i32* %9
%18 = load i32, i32* %9
ret i32 %18
}

LLVM IR (-O2):
define i32 @convert(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @strlen(i8* %2)
%6 = tail call i32 @pre_process(i8* %2, i32 %5, i32 %0)
%7 = tail call i32 @pos_process(i8* %3, i32 %6, i32 %1)
ret i32 %7
}