xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putstr(char *input) {
  int length;
  length = 0;
  while (input[length])
    length++;
  write(1, input, length);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1143 <ft_putstr+0x33>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
mov    %rdi,%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_putstr+0x10>
add    $0xffffffff,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = tail call i32 @write(i32 1, i8* %0, i32 %9)
ret void
}
/* Variables and functions */
char getchar();
char readChar() {
  char c = getchar();
  while (getchar() != '\n')
    ;
  return c;
}


x86 assembly (clang, -O0):
<readChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     113a <readChar+0x2a>
jmp    1122 <readChar+0x12>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readChar>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <readChar+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @readChar() {
%1 = alloca i8
%2 = call signext i8 (...) @getchar()
store i8 %2, i8* %1
br label %3
3: ; preds = %7, %0
%4 = call signext i8 (...) @getchar()
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @readChar() {
%1 = tail call signext i8 (...) @getchar()
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
ret i8 %1
}
/* Type definitions */
struct _mgmt_login_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _mgmt_login_rsp *);
void mgmt_login_rsp_free(struct _mgmt_login_rsp *ptr) { free(ptr); }


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

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

LLVM IR (-O0):
%struct._mgmt_login_rsp = type { i32 }
define void @mgmt_login_rsp_free(%struct._mgmt_login_rsp* %0) {
%2 = alloca %struct._mgmt_login_rsp*
store %struct._mgmt_login_rsp* %0, %struct._mgmt_login_rsp** %2
%3 = load %struct._mgmt_login_rsp*, %struct._mgmt_login_rsp** %2
%4 = call i32 @free(%struct._mgmt_login_rsp* %3)
ret void
}

LLVM IR (-O2):
%struct._mgmt_login_rsp = type { i32 }
define void @mgmt_login_rsp_free(%struct._mgmt_login_rsp* nocapture %0) {
%2 = tail call i32 @free(%struct._mgmt_login_rsp* %0)
ret void
}
void __div0(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<__div0>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <__div0+0x9>
jmp    1109 <__div0+0x9>

x86 assembly (clang, -O2):
<__div0>:
jmp    1100 <__div0>

LLVM IR (-O0):
define void @__div0() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @__div0() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ wfunc();
void f1a() { wfunc(); }


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

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

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

LLVM IR (-O2):
define void @f1a() {
%1 = tail call i32 (...) @wfunc()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
char *makename(char *, char const *, int /*<<< orphan*/);
char *xcb_atom_name_by_resource(const char *base, uint32_t resource) {
  return makename("%s_R%08X", base, resource);
}


x86 assembly (clang, -O0):
<xcb_atom_name_by_resource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <makename@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_atom_name_by_resource>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <makename@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s_R%08X\00"
define i8* @xcb_atom_name_by_resource(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i8* @makename(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s_R%08X\00"
define i8* @xcb_atom_name_by_resource(i8* %0, i32 %1) {
%3 = tail call i8* @makename(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ dod_exit(char *, size_t);
void *malloc(size_t);
void *dod_malloc(size_t nbytes) {
  void *p = malloc(nbytes);
  if (p != NULL)
    return p;
  if (nbytes == 0)
    return p;
  dod_exit("dod:malloc(%zu) failed", nbytes);
  abort();
}


x86 assembly (clang, -O0):
<dod_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <dod_malloc+0x31>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1190 <dod_malloc+0x60>
cmpq   $0x0,-0x10(%rbp)
jne    1179 <dod_malloc+0x49>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1190 <dod_malloc+0x60>
mov    -0x10(%rbp),%rsi
lea    0xe7c(%rip),%rdi
call   1040 <dod_exit@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dod_malloc>:
push   %rbx
mov    %rdi,%rbx
call   1050 <malloc@plt>
test   %rbx,%rbx
je     1143 <dod_malloc+0x13>
test   %rax,%rax
je     1145 <dod_malloc+0x15>
pop    %rbx
ret
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <dod_exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"dod:malloc(%zu) failed\00"
define i8* @dod_malloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8* %10, i8** %2
br label %20
11: ; preds = %1
%12 = load i64, i64* %3
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i8*, i8** %4
store i8* %15, i8** %2
br label %20
16: ; preds = %11
%17 = load i64, i64* %3
%18 = call i32 @dod_exit(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %17)
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %14, %9
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
@.str = [23 x i8] c"dod:malloc(%zu) failed\00"
define noalias i8* @dod_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp ne i8* %2, null
%4 = icmp eq i64 %0, 0
%5 = or i1 %4, %3
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i32 @dod_exit(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %0)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_svector(short *v, long nl) { free((char *)(v + nl - 1)); }


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

x86 assembly (clang, -O2):
<free_svector>:
lea    (%rdi,%rsi,2),%rdi
add    $0xfffffffffffffffe,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_svector(i16* %0, i64 %1) {
%3 = alloca i16*
%4 = alloca i64
store i16* %0, i16** %3
store i64 %1, i64* %4
%5 = load i16*, i16** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i16, i16* %5, i64 %6
%8 = getelementptr inbounds i16, i16* %7, i64 -1
%9 = bitcast i16* %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @free_svector(i16* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 %1
%4 = getelementptr inbounds i16, i16* %3, i64 -1
%5 = bitcast i16* %4 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void u32t8le(uint32_t v, uint8_t p[4]) {
  p[0] = v & 0xff;
  p[1] = (v >> 8) & 0xff;
  p[2] = (v >> 16) & 0xff;
  p[3] = (v >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<u32t8le>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<u32t8le>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %ecx,(%rsi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rsi)
mov    %edi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rsi)
shr    $0x18,%eax
mov    %eax,0xc(%rsi)
ret

LLVM IR (-O0):
define void @u32t8le(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 255
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %3
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
%14 = load i32, i32* %3
%15 = ashr i32 %14, 16
%16 = and i32 %15, 255
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 2
store i32 %16, i32* %18
%19 = load i32, i32* %3
%20 = ashr i32 %19, 24
%21 = and i32 %20, 255
%22 = load i32*, i32** %4
%23 = getelementptr inbounds i32, i32* %22, i64 3
store i32 %21, i32* %23
ret void
}

LLVM IR (-O2):
define void @u32t8le(i32 %0, i32* nocapture writeonly %1) {
%3 = and i32 %0, 255
store i32 %3, i32* %1
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %0, 16
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %8, i32* %9
%10 = lshr i32 %0, 24
%11 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %10, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_report(char *, int, int);
int /*<<< orphan*/ erl_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ erl_mk_long_ref(char *, int, int, int, int);
int /*<<< orphan*/ send_term(int /*<<< orphan*/);
void t_erl_mk_long_ref(void) {
  erl_init(NULL, 0);
  send_term(
      erl_mk_long_ref("kalle@localhost", 4294967295, 4294967295, 262143, 1));
  do_report("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/"
            "erl_interface/test/erl_eterm_SUITE_data/eterm_test.c",
            575, 1);
}


x86 assembly (clang, -O0):
<t_erl_mk_long_ref>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1060 <erl_init@plt>
lea    0xeaa(%rip),%rdi
mov    $0xffffffff,%edx
mov    $0x3ffff,%ecx
mov    $0x1,%r8d
mov    %edx,%esi
call   1040 <erl_mk_long_ref@plt>
mov    %eax,%edi
call   1050 <send_term@plt>
lea    0xe95(%rip),%rdi
mov    $0x23f,%esi
mov    $0x1,%edx
call   1030 <do_report@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_erl_mk_long_ref>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1060 <erl_init@plt>
lea    0xeaf(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
mov    $0x3ffff,%ecx
mov    $0x1,%r8d
call   1040 <erl_mk_long_ref@plt>
mov    %eax,%edi
call   1050 <send_term@plt>
lea    0xe97(%rip),%rdi
mov    $0x23f,%esi
mov    $0x1,%edx
pop    %rax
jmp    1030 <do_report@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"kalle@localhost\00"
@.str.1 = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c\00"
define void @t_erl_mk_long_ref() {
%1 = call i32 @erl_init(i32* null, i32 0)
%2 = call i32 @erl_mk_long_ref(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 -1, i32 -1, i32 262143, i32 1)
%3 = call i32 @send_term(i32 %2)
%4 = call i32 @do_report(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 575, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"kalle@localhost\00"
@.str.1 = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c\00"
define void @t_erl_mk_long_ref() {
%1 = tail call i32 @erl_init(i32* null, i32 0)
%2 = tail call i32 @erl_mk_long_ref(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 -1, i32 -1, i32 262143, i32 1)
%3 = tail call i32 @send_term(i32 %2)
%4 = tail call i32 @do_report(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 575, i32 1)
ret void
}
int dlinfo(void *ptr1, int x, void *ptr2) {}


x86 assembly (clang, -O0):
<dlinfo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @dlinfo(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
double __nv_dmul_rn(double, double);
double __dmul_rn(double __a, double __b) { return __nv_dmul_rn(__a, __b); }


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

x86 assembly (clang, -O2):
<__dmul_rn>:
jmp    1030 <__nv_dmul_rn@plt>

LLVM IR (-O0):
define double @__dmul_rn(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 double @__nv_dmul_rn(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__dmul_rn(double %0, double %1) {
%3 = tail call double @__nv_dmul_rn(double %0, double %1)
ret double %3
}
float test_inff(void) { return __builtin_inff(); }


x86 assembly (clang, -O0):
<test_inff>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_inff>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @test_inff() {
ret float 0x7FF0000000000000
}

LLVM IR (-O2):
define float @test_inff() {
ret float 0x7FF0000000000000
}
/* Variables and functions */
int /*<<< orphan*/ one_three();
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("starting now:\n");
  one_three();
  printf("done!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"starting now:\0A\00"
@.str.1 = [7 x i8] c"done!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @one_three()
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"starting now:\00"
@str.2 = [6 x i8] c"done!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @one_three()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int mkdir_error(const char *dir) {
  printf("error on making %s\n", dir);
  return -1;
}


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

x86 assembly (clang, -O2):
<mkdir_error>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"error on making %s\0A\00"
define i32 @mkdir_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 -1
}

LLVM IR (-O2):
@.str = [20 x i8] c"error on making %s\0A\00"
define i32 @mkdir_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int);
int /*<<< orphan*/ output_byte(int);
int /*<<< orphan*/ output_w32(int);
void emit_pushimm(int imm) {
  assem_debug("push $%x", imm);
  output_byte(0x68);
  output_w32(imm);
}


x86 assembly (clang, -O0):
<emit_pushimm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0x68,%edi
call   1050 <output_byte@plt>
mov    -0x4(%rbp),%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_pushimm>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
call   1030 <assem_debug@plt>
mov    $0x68,%edi
call   1050 <output_byte@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"push $%x\00"
define void @emit_pushimm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @assem_debug(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @output_byte(i32 104)
%6 = load i32, i32* %2
%7 = call i32 @output_w32(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"push $%x\00"
define void @emit_pushimm(i32 %0) {
%2 = tail call i32 @assem_debug(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @output_byte(i32 104)
%4 = tail call i32 @output_w32(i32 %0)
ret void
}
void f47(void) {
  ({
    ({ 0; });
    goto a;
    ({ 0; });
  a:
    0;
  });
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f47>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f47() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* %1
br label %7
7: ; preds = %0
store i32 0, i32* %2
%8 = load i32, i32* %2
store i32 0, i32* %3
%9 = load i32, i32* %3
store i32 0, i32* %4
%10 = load i32, i32* %4
store i32 0, i32* %5
%11 = load i32, i32* %5
ret void
}

LLVM IR (-O2):
define void @f47() {
ret void
}
int test_imm_44uint8_reg(unsigned char val) {
  return ((val) & (0x44 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_44uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x44,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_44uint8_reg>:
test   $0x44,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_44uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 68
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int __attribute__((weak)) _write(int file, const char *ptr, int len) {
  file = file;
  ptr = ptr;
  len = len;
  return 0;
}


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

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

LLVM IR (-O0):
define weak i32 @_write(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
store i32 %7, i32* %4
%8 = load i8*, i8** %5
store i8* %8, i8** %5
%9 = load i32, i32* %6
store i32 %9, i32* %6
ret i32 0
}

LLVM IR (-O2):
define weak i32 @_write(i32 %0, i8* %1, i32 %2) {
ret i32 0
}
__attribute__((always_)) int api4(int api_no, int arg1, int arg2, int arg3,
                                  int arg4) {
  int ret = 0;
  __asm__ __volatile__("int $0x44"
                       : "=a"(ret)
                       : "0"(api_no), "b"(arg1), "c"(arg2), "d"(arg3),
                         "S"(arg4));
  return ret;
}


x86 assembly (clang, -O0):
<api4>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ebx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%esi
int    $0x44
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<api4>:
push   %rbx
mov    %ecx,%eax
mov    %edx,%ecx
mov    %esi,%ebx
mov    %eax,%edx
mov    %r8d,%esi
mov    %edi,%eax
int    $0x44
pop    %rbx
ret

LLVM IR (-O0):
define i32 @api4(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
store i32 0, i32* %11
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 asm sideeffect "int $$0x44", "={ax},0,{bx},{cx},{dx},{si},~{dirflag},~{fpsr},~{flags}"(i32 %12, i32 %13, i32 %14, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
ret i32 %18
}

LLVM IR (-O2):
define i32 @api4(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 asm sideeffect "int $$0x44", "={ax},0,{bx},{cx},{dx},{si},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret i32 %6
}
void func() { static int sl_self_ref = sizeof(sl_self_ref); }


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

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

LLVM IR (-O0):
@func.sl_self_ref = internal global i32 4
define void @func() {
ret void
}

LLVM IR (-O2):
define void @func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("hello world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strnlen(char const *, size_t);
char *strndup(register const char *s1, size_t n) {
  register char *s;
  n = strnlen(s1, n);
  if ((s = malloc(n + 1)) != NULL) {
    memcpy(s, s1, n);
    s[n] = 0;
  }
  return s;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strnlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1189 <strndup+0x59>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <strndup+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = tail call i64 @strnlen(i8* %0, i64 %1)
%4 = add i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %3)
%9 = getelementptr inbounds i8, i8* %5, i64 %3
store i8 0, i8* %9
br label %10
10: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
long sysconf(int /*<<< orphan*/);
int /*<<< orphan*/ warning(char *);
unsigned get_default_num_threads() {
  long nthreads = sysconf(_SC_NPROCESSORS_ONLN);
  if (nthreads == -1) {
    warning("Could not deteremine number of processors! Assuming 1");
    return 1;
  } else {
    return (unsigned)nthreads;
  }
}


x86 assembly (clang, -O0):
<get_default_num_threads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    115d <get_default_num_threads+0x3d>
lea    0xeb4(%rip),%rdi
call   1030 <warning@plt>
movl   $0x1,-0x4(%rbp)
jmp    1164 <get_default_num_threads+0x44>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_default_num_threads>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
cmp    $0xffffffffffffffff,%rax
je     1137 <get_default_num_threads+0x17>
pop    %rcx
ret
lea    0xec2(%rip),%rdi
call   1030 <warning@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
@.str = [54 x i8] c"Could not deteremine number of processors! Assuming 1\00"
define i32 @get_default_num_threads() {
%1 = alloca i32
%2 = alloca i64
%3 = load i32, i32* @_SC_NPROCESSORS_ONLN
%4 = call i64 @sysconf(i32 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = icmp eq i64 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @warning(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %12
9: ; preds = %0
%10 = load i64, i64* %2
%11 = trunc i64 %10 to i32
store i32 %11, i32* %1
br label %12
12: ; preds = %9, %7
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
@.str = [54 x i8] c"Could not deteremine number of processors! Assuming 1\00"
define i32 @get_default_num_threads() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i64 @sysconf(i32 %1)
%3 = icmp eq i64 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @warning(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = trunc i64 %2 to i32
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 1, %4 ], [ %7, %6 ]
ret i32 %9
}
int myopt_IsSeparator(int c) { return (c == ' ' || c == '\t' || c == '\n'); }


x86 assembly (clang, -O0):
<myopt_IsSeparator>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <myopt_IsSeparator+0x2f>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <myopt_IsSeparator+0x2f>
cmpl   $0xa,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myopt_IsSeparator>:
mov    $0x1,%eax
cmp    $0x9,%edi
je     110f <myopt_IsSeparator+0xf>
cmp    $0x20,%edi
jne    1110 <myopt_IsSeparator+0x10>
ret
xor    %eax,%eax
cmp    $0xa,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @myopt_IsSeparator(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
int getNextIndex(int n, int current) {
  return current == n - 1 ? 0 : current + 1;
}


x86 assembly (clang, -O0):
<getNextIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1125 <getNextIndex+0x25>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <getNextIndex+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNextIndex>:
add    $0xffffffff,%edi
lea    0x1(%rsi),%ecx
xor    %eax,%eax
cmp    %esi,%edi
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getNextIndex(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = icmp eq i32 %3, %1
%5 = add nsw i32 %1, 1
%6 = select i1 %4, i32 0, i32 %5
ret i32 %6
}
int hostapd_hw_get_freq(struct hostapd_data *hapd, int chan) { return -1; }


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

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

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

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

/* Variables and functions */
uint64_t FromLE64(uint64_t value) { return value; }


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

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

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

LLVM IR (-O2):
define i32 @FromLE64(i32 returned %0) {
ret i32 %0
}
int test_imm_70uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x70 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_70uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x70,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_70uint64_midword_mem>:
testb  $0x70,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_70uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7340032
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void startExtCart() {
  unsigned char *cp = (unsigned char *)0x7100;
  *cp++ = 0x3e;
  *cp++ = 0x04;
  *cp++ = 0xd3;
  *cp++ = 0x52;
  *cp++ = 0xc3;
  *cp++ = 0x00;
  *cp++ = 0x00;
  __asm__("jp 0x7100");
}


x86 assembly (clang, -O0):
<startExtCart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7100,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x3e,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x4,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0xd3,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x52,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0xc3,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jp     7100 <completed.0+0x30e0>
pop    %rbp
ret

x86 assembly (clang, -O2):
<startExtCart>:
movb   $0x3e,0x7100
3e
movb   $0x4,0x7101
04
movb   $0xd3,0x7102
d3
movb   $0x52,0x7103
52
movb   $0xc3,0x7104
c3
movb   $0x0,0x7105
movb   $0x0,0x7106
jp     7100 <completed.0+0x30e0>
ret

LLVM IR (-O0):
define void @startExtCart() {
%1 = alloca i8*
store i8* inttoptr (i64 28928 to i8*), i8** %1
%2 = load i8*, i8** %1
%3 = getelementptr inbounds i8, i8* %2, i32 1
store i8* %3, i8** %1
store i8 62, i8* %2
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %1
store i8 4, i8* %4
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %1
store i8 -45, i8* %6
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %1
store i8 82, i8* %8
%10 = load i8*, i8** %1
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %1
store i8 -61, i8* %10
%12 = load i8*, i8** %1
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %1
store i8 0, i8* %12
%14 = load i8*, i8** %1
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %1
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
define void @startExtCart() {
store i8 62, i8* inttoptr (i64 28928 to i8*)
store i8 4, i8* inttoptr (i64 28929 to i8*)
store i8 -45, i8* inttoptr (i64 28930 to i8*)
store i8 82, i8* inttoptr (i64 28931 to i8*)
store i8 -61, i8* inttoptr (i64 28932 to i8*)
store i8 0, i8* inttoptr (i64 28933 to i8*)
store i8 0, i8* inttoptr (i64 28934 to i8*)
tail call void asm sideeffect "jp 0x7100", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int HelpItem83(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem83() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void gpx_rd_init(const char *fname) {
  fatal("GPX"
        ": This build excluded GPX support because expat was not installed.\n");
}


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

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

LLVM IR (-O0):
@.str = [71 x i8] c"GPX: This build excluded GPX support because expat was not installed.\0A\00"
define void @gpx_rd_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fatal(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"GPX: This build excluded GPX support because expat was not installed.\0A\00"
define void @gpx_rd_init(i8* nocapture readnone %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ float_lookup();
int /*<<< orphan*/ invalid_operations();
int /*<<< orphan*/ summation(int, int);
int main(int argc, char *argv[]) {
  float_lookup();
  invalid_operations();
  summation(1, 100000000);
  summation(1, 200000000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <float_lookup@plt>
mov    $0x0,%al
call   1030 <invalid_operations@plt>
mov    $0x1,%edi
mov    $0x5f5e100,%esi
call   1040 <summation@plt>
mov    $0x1,%edi
mov    $0xbebc200,%esi
call   1040 <summation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <float_lookup@plt>
xor    %eax,%eax
call   1030 <invalid_operations@plt>
mov    $0x1,%edi
mov    $0x5f5e100,%esi
call   1040 <summation@plt>
mov    $0x1,%edi
mov    $0xbebc200,%esi
call   1040 <summation@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @float_lookup()
%6 = call i32 (...) @invalid_operations()
%7 = call i32 @summation(i32 1, i32 100000000)
%8 = call i32 @summation(i32 1, i32 200000000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @float_lookup()
%4 = tail call i32 (...) @invalid_operations()
%5 = tail call i32 @summation(i32 1, i32 100000000)
%6 = tail call i32 @summation(i32 1, i32 200000000)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadl_pd(int /*<<< orphan*/, void *);
__m128d test_loadl_pd(__m128d x, void *y) { return _mm_loadl_pd(x, y); }


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

x86 assembly (clang, -O2):
<test_loadl_pd>:
jmp    1030 <_mm_loadl_pd@plt>

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

LLVM IR (-O2):
define i32 @test_loadl_pd(i32 %0, i8* %1) {
%3 = tail call i32 @_mm_loadl_pd(i32 %0, i8* %1)
ret i32 %3
}
void tsv_pointer_read(struct encode_context *ectxt,
                      struct decode_context *dctxt, const char *format) {}


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

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

LLVM IR (-O0):
%struct.encode_context = type opaque
%struct.decode_context = type opaque
define void @tsv_pointer_read(%struct.encode_context* %0, %struct.decode_context* %1, i8* %2) {
%4 = alloca %struct.encode_context*
%5 = alloca %struct.decode_context*
%6 = alloca i8*
store %struct.encode_context* %0, %struct.encode_context** %4
store %struct.decode_context* %1, %struct.decode_context** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
%struct.encode_context = type opaque
%struct.decode_context = type opaque
define void @tsv_pointer_read(%struct.encode_context* nocapture %0, %struct.decode_context* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ plotPixel(int, int, unsigned int);
void VdrawHLine(int x, int y, int length, unsigned int color) {
  int i, endx;
  endx = x + length;
  for (i = x; i < endx; i++)
    plotPixel(i, y, color);
}


x86 assembly (clang, -O0):
<VdrawHLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    115b <VdrawHLine+0x4b>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <plotPixel@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <VdrawHLine+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VdrawHLine>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1144 <VdrawHLine+0x34>
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%r15d
mov    %edi,%ebx
add    %edi,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r15d,%esi
mov    %r14d,%edx
call   1030 <plotPixel@plt>
add    $0x1,%ebx
cmp    %ebp,%ebx
jl     1130 <VdrawHLine+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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