xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strchr(char const *, int);
void first_char_pos(int *index, const char *haystack, int needle) {
  char *match;
  match = strchr(haystack, needle);
  *index = (int)(match - haystack);
}


x86 assembly (clang, -O0):
<first_char_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_char_pos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <strchr@plt>
sub    %ebx,%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @first_char_pos(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i8* @strchr(i8* %8, i32 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %5
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i32
%17 = load i32*, i32** %4
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @first_char_pos(i32* nocapture writeonly %0, i8* %1, i32 %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %1, i32 %2)
%5 = ptrtoint i8* %4 to i64
%6 = ptrtoint i8* %1 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
store i32 %8, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Menus_OpenByName(char *);
void CG_ShowTeamMenu(void) { Menus_OpenByName("teamMenu"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"teamMenu\00"
define void @CG_ShowTeamMenu() {
%1 = tail call i32 @Menus_OpenByName(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
void cart_default_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @cart_default_cleanup() {
ret void
}
int test_imm_EDuint16_mem(unsigned short *val) {
  return ((*val) & (-0xED << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_EDuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -237
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ff_hevc_put_hevc_bi_w_qpel_hv8_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_hv8_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello from distroless!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Hello from distroless!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Hello from distroless!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_least16_t;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ endian_16hi8(int /*<<< orphan*/);
int /*<<< orphan*/ endian_16lo8(int /*<<< orphan*/);
void endian_16(uint8_t ptr[2], uint_least16_t word) {
  ptr[0] = endian_16lo8(word);
  ptr[1] = endian_16hi8(word);
}


x86 assembly (clang, -O0):
<endian_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <endian_16lo8@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edi
call   1040 <endian_16hi8@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_16>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1030 <endian_16lo8@plt>
mov    %eax,(%r14)
mov    %ebx,%edi
call   1040 <endian_16hi8@plt>
mov    %eax,0x4(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @endian_16(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 = call i32 @endian_16lo8(i32 %5)
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = call i32 @endian_16hi8(i32 %9)
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @endian_16(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @endian_16lo8(i32 %1)
store i32 %3, i32* %0
%4 = tail call i32 @endian_16hi8(i32 %1)
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ library_deregister_all_callbacks();
void library_deinit(void) { library_deregister_all_callbacks(); }


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

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

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

LLVM IR (-O2):
define void @library_deinit() {
%1 = tail call i32 (...) @library_deregister_all_callbacks()
ret void
}
/* Variables and functions */
int _is_dst_human(int /*<<< orphan*/);
int /*<<< orphan*/ unix_to_human(unsigned long);
int _is_dst_unix(unsigned long unix_time) {
  return _is_dst_human(unix_to_human(unix_time));
}


x86 assembly (clang, -O0):
<_is_dst_unix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unix_to_human@plt>
mov    %eax,%edi
call   1040 <_is_dst_human@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_dst_unix>:
push   %rax
call   1030 <unix_to_human@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <_is_dst_human@plt>

LLVM IR (-O0):
define i32 @_is_dst_unix(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @unix_to_human(i64 %3)
%5 = call i32 @_is_dst_human(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @_is_dst_unix(i64 %0) {
%2 = tail call i32 @unix_to_human(i64 %0)
%3 = tail call i32 @_is_dst_human(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int LZ4_freeHC(void *LZ4HC_Data) {
  free(LZ4HC_Data);
  return (0);
}


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

x86 assembly (clang, -O2):
<LZ4_freeHC>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @LZ4_freeHC(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
int same_array(int *pfirst, int *psecond) {
  int result = 0;
  if (pfirst && psecond)
    if (pfirst == psecond)
      result = 1;
  return result;
}


x86 assembly (clang, -O0):
<same_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1143 <same_array+0x43>
cmpq   $0x0,-0x10(%rbp)
je     1143 <same_array+0x43>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    113e <same_array+0x3e>
movl   $0x1,-0x14(%rbp)
jmp    1143 <same_array+0x43>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<same_array>:
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
cmp    %rsi,%rdi
sete   %al
and    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @same_array(i32* readnone %0, i32* readnone %1) {
%3 = icmp ne i32* %0, null
%4 = icmp ne i32* %1, null
%5 = and i1 %3, %4
%6 = icmp eq i32* %0, %1
%7 = and i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
void *lib_malloc(int);
int /*<<< orphan*/ liballoc_memset(void *, int /*<<< orphan*/, int);
void *lib_calloc(size_t nobj, size_t size) {
  int real_size;
  void *p;
  real_size = nobj * size;
  p = lib_malloc(real_size);
  liballoc_memset(p, 0, real_size);
  return p;
}


x86 assembly (clang, -O0):
<lib_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <lib_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1040 <liballoc_memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
imul   %edi,%ebx
mov    %ebx,%edi
call   1030 <lib_malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1040 <liballoc_memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @lib_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul i64 %7, %8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i8* @lib_malloc(i32 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i32, i32* %5
%15 = call i32 @liballoc_memset(i8* %13, i32 0, i32 %14)
%16 = load i8*, i8** %6
ret i8* %16
}

LLVM IR (-O2):
define i8* @lib_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = trunc i64 %3 to i32
%5 = tail call i8* @lib_malloc(i32 %4)
%6 = tail call i32 @liballoc_memset(i8* %5, i32 0, i32 %4)
ret i8* %5
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ load_timer2(unsigned int);
extern void waiton_timer2(unsigned int ticks) {
  load_timer2(ticks);
  while ((inb(0x61) & 0x20) == 0)
    ;
}


x86 assembly (clang, -O0):
<waiton_timer2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <load_timer2@plt>
mov    $0x61,%edi
call   1040 <inb@plt>
and    $0x20,%eax
cmp    $0x0,%eax
jne    114e <waiton_timer2+0x2e>
jmp    1133 <waiton_timer2+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waiton_timer2>:
push   %rax
call   1030 <load_timer2@plt>
cs nopw 0x0(%rax,%rax,1)
mov    $0x61,%edi
call   1040 <inb@plt>
test   $0x20,%al
je     1130 <waiton_timer2+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @waiton_timer2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @load_timer2(i32 %3)
br label %5
5: ; preds = %9, %1
%6 = call i32 @inb(i32 97)
%7 = and i32 %6, 32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @waiton_timer2(i32 %0) {
%2 = tail call i32 @load_timer2(i32 %0)
br label %3
3: ; preds = %3, %1
%4 = tail call i32 @inb(i32 97)
%5 = and i32 %4, 32
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
ret void
}
unsigned int mt_icache_dump(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mt_icache_dump() {
ret i32 0
}
unsigned xrop3_83_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_83_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_83_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
mov    %ecx,%eax
xor    $0xff,%eax
and    %edx,%eax
xor    %ecx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_83_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_83_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = and i32 %6, %7
%9 = xor i32 %4, %8
%10 = xor i32 %9, -1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Hola a todos\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hola a todos\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ lame_read_stat(double *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ usleep(double);
int main(int argc, char **argv) {
  double current = 0.0;
  while (1) {
    if (lame_read_stat(&current) == 0)
      printf("[P %f]\n", current);
    usleep(0.5 * 1000000);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <lame_read_stat@plt>
cmp    $0x0,%rax
jne    1172 <main+0x42>
movsd  -0x18(%rbp),%xmm0
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe86(%rip),%xmm0
call   1050 <usleep@plt>
jmp    114e <main+0x1e>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rbx
lea    0xec2(%rip),%r14
jmp    115d <main+0x2d>
nopl   0x0(%rax,%rax,1)
movsd  0xea8(%rip),%xmm0
call   1050 <usleep@plt>
mov    %rbx,%rdi
call   1040 <lame_read_stat@plt>
test   %rax,%rax
jne    1150 <main+0x20>
movsd  (%rsp),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [8 x i8] c"[P %f]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %6
br label %7
7: ; preds = %2, %13
%8 = call i64 @lame_read_stat(double* %6)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load double, double* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %11)
br label %13
13: ; preds = %10, %7
%14 = call i32 @usleep(double 5.000000e+05)
br label %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"[P %f]\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
br label %5
5: ; preds = %11, %2
%6 = call i64 @lame_read_stat(double* %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load double, double* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %9)
br label %11
11: ; preds = %8, %5
%12 = call i32 @usleep(double 5.000000e+05)
br label %5
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char *, struct stat *);
int main(void) {
  struct stat buf;
  int status;
  status = stat("/tmp/foo", &buf);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [9 x i8] c"/tmp/foo\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stat
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @stat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
store i32 %4, i32* %3
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [9 x i8] c"/tmp/foo\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @stat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
ret i32 0
}
/* Type definitions */
struct bt_gap {
  int dummy;
};

/* Variables and functions */
struct bt_gap *bt_gap_new_index(int);
struct bt_gap *bt_gap_new_default(void) {
  return bt_gap_new_index(0x0000);
}


x86 assembly (clang, -O0):
<bt_gap_new_default>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <bt_gap_new_index@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bt_gap_new_default>:
xor    %edi,%edi
jmp    1030 <bt_gap_new_index@plt>

LLVM IR (-O0):
%struct.bt_gap = type { i32 }
define %struct.bt_gap* @bt_gap_new_default() {
%1 = call %struct.bt_gap* @bt_gap_new_index(i32 0)
ret %struct.bt_gap* %1
}

LLVM IR (-O2):
%struct.bt_gap = type { i32 }
define %struct.bt_gap* @bt_gap_new_default() {
%1 = tail call %struct.bt_gap* @bt_gap_new_index(i32 0)
ret %struct.bt_gap* %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int UP3D_GetParameter(int);
uint32_t UP3D_GetNegativeLimitState(int motor) {
  if ((motor < 1) || (motor > 4))
    return -1;
  return UP3D_GetParameter(0x26 + motor - 1);
}


x86 assembly (clang, -O0):
<UP3D_GetNegativeLimitState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     112f <UP3D_GetNegativeLimitState+0x1f>
cmpl   $0x4,-0x8(%rbp)
jle    113b <UP3D_GetNegativeLimitState+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <UP3D_GetNegativeLimitState+0x3c>
mov    -0x8(%rbp),%edi
add    $0x26,%edi
sub    $0x1,%edi
call   1030 <UP3D_GetParameter@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UP3D_GetNegativeLimitState>:
lea    -0x5(%rdi),%eax
cmp    $0xfffffffc,%eax
jae    111e <UP3D_GetNegativeLimitState+0xe>
mov    $0xffffffff,%eax
ret
add    $0x25,%edi
jmp    1030 <UP3D_GetParameter@plt>

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

LLVM IR (-O2):
define i32 @UP3D_GetNegativeLimitState(i32 %0) {
%2 = add i32 %0, -5
%3 = icmp ult i32 %2, -4
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = add nuw nsw i32 %0, 37
%6 = tail call i32 @UP3D_GetParameter(i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int signbit(double);
int wrapc_signbit(double r) { return signbit(r); }


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

x86 assembly (clang, -O2):
<wrapc_signbit>:
jmp    1030 <signbit@plt>

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

LLVM IR (-O2):
define i32 @wrapc_signbit(double %0) {
%2 = tail call i32 @signbit(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ twoDsim_getEventBuffer(void **, int *, unsigned int *);
void get_ebuf(void **start, unsigned int *used) {
  int length;
  printf("calling getEventBuffer\n");
  twoDsim_getEventBuffer(start, &length, used);
}


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

x86 assembly (clang, -O2):
<get_ebuf>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1040 <twoDsim_getEventBuffer@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@str = [23 x i8] c"calling getEventBuffer\00"
define void @get_ebuf(i8** %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%6 = call i32 @twoDsim_getEventBuffer(i8** %0, i32* %3, i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
struct tm *get_time_of_day(void) {
  time_t now;
  struct tm *tm;
  now = time(0);
  if ((tm = localtime(&now)) == NULL) {
    printf("Error extracting time stuff\n");
    return NULL;
  }
  return tm;
}


x86 assembly (clang, -O0):
<get_time_of_day>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1172 <get_time_of_day+0x42>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
movq   $0x0,-0x8(%rbp)
jmp    117a <get_time_of_day+0x4a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_of_day>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115e <get_time_of_day+0x2e>
lea    0xea7(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [29 x i8] c"Error extracting time stuff\0A\00"
define %struct.tm* @get_time_of_day() {
%1 = alloca %struct.tm*
%2 = alloca i32
%3 = alloca %struct.tm*
%4 = call i32 @time(i32 0)
store i32 %4, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %5, %struct.tm** %3
%6 = icmp eq %struct.tm* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store %struct.tm* null, %struct.tm** %1
br label %11
9: ; preds = %0
%10 = load %struct.tm*, %struct.tm** %3
store %struct.tm* %10, %struct.tm** %1
br label %11
11: ; preds = %9, %7
%12 = load %struct.tm*, %struct.tm** %1
ret %struct.tm* %12
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@str = [28 x i8] c"Error extracting time stuff\00"
define %struct.tm* @get_time_of_day() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32 0)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = icmp eq %struct.tm* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %0, %6
ret %struct.tm* %4
}
void rop3_215_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_215_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_215_0_1>:
mov    %edx,%eax
xor    %sil,%al
mov    (%rdi),%r8b
and    %r8b,%al
not    %al
mov    %edx,%ecx
not    %cl
or     %sil,%cl
and    %al,%cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_215_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = or i32 %30, %36
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = and i32 %43, %46
%48 = or i32 %37, %47
%49 = trunc i32 %48 to i8
%50 = load i8*, i8** %4
store i8 %49, i8* %50
ret void
}

LLVM IR (-O2):
define void @rop3_215_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, -1
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %9, %7
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %5
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
/* Variables and functions */
char *cantidadcl_alloc(char *, int const);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *nombre = NULL;
  const int debug = 0;
  if (argc < 2)
    return 1;
  nombre = cantidadcl_alloc(argv[1], debug);
  printf("%s\n", nombre);
  free(nombre);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    116b <main+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    119e <main+0x6e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
call   1040 <cantidadcl_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe77(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
cmp    $0x2,%edi
jl     1165 <main+0x35>
mov    0x8(%rsi),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
call   1040 <cantidadcl_alloc@plt>
mov    %rax,%r14
lea    0xeab(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i8* @cantidadcl_alloc(i8* %6, i32 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 @free(i8* %7)
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ wprintf(char *);
void foo2() {
  wprintf(L"hello from foo2\n");
  bar();
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <wprintf@plt>
mov    $0x0,%al
call   1030 <bar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <wprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>

LLVM IR (-O0):
@.str = [17 x i32] [i32 104, i32 101, i32 108, i32 108, i32 111, i32 32, i32 102, i32 114, i32 111, i32 109, i32 32, i32 102, i32 111, i32 111, i32 50, i32 10, i32 0]
define void @foo2() {
%1 = call i32 @wprintf(i8* bitcast ([17 x i32]* @.str to i8*))
%2 = call i32 (...) @bar()
ret void
}

LLVM IR (-O2):
@.str = [17 x i32] [i32 104, i32 101, i32 108, i32 108, i32 111, i32 32, i32 102, i32 114, i32 111, i32 109, i32 32, i32 102, i32 111, i32 111, i32 50, i32 10, i32 0]
define void @foo2() {
%1 = tail call i32 @wprintf(i8* bitcast ([17 x i32]* @.str to i8*))
%2 = tail call i32 (...) @bar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage(void) {
  fputs("Usage: pad_backslash [-c column] [inputfile]\n", stderr);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Usage: pad_backslash [-c column] [inputfile]\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [46 x i8] c"Usage: pad_backslash [-c column] [inputfile]\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int ti_linregintercept_start(double const *options) {
  return (int)options[0] - 1;
}


x86 assembly (clang, -O0):
<ti_linregintercept_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_linregintercept_start>:
cvttsd2si (%rdi),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ti_linregintercept_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ti_linregintercept_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
ret i32 %4
}
void g_value_take_object() {}


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

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

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

LLVM IR (-O2):
define void @g_value_take_object() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_absx();
int /*<<< orphan*/ e_adc();
void e_adc_absx() {
  e_absx();
  e_adc();
}


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

x86 assembly (clang, -O2):
<e_adc_absx>:
push   %rax
xor    %eax,%eax
call   1030 <e_absx@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_adc@plt>

LLVM IR (-O0):
define void @e_adc_absx() {
%1 = call i32 (...) @e_absx()
%2 = call i32 (...) @e_adc()
ret void
}

LLVM IR (-O2):
define void @e_adc_absx() {
%1 = tail call i32 (...) @e_absx()
%2 = tail call i32 (...) @e_adc()
ret void
}
/* Variables and functions */
double atof(char *);
char *ext_arg(char *, char *);
double pow(double, double);
double cal_pow(char *S) {
  char *tmp = S;
  char arg[50];
  double arg1 = 0, arg2 = 0;
  tmp = ext_arg(tmp, arg);
  arg1 = (atof(arg));
  tmp = ext_arg(tmp, arg);
  arg2 = (atof(arg));
  return pow(arg1, arg2);
}


x86 assembly (clang, -O0):
<cal_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <ext_arg@plt>
mov    %rax,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <ext_arg@plt>
mov    %rax,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
call   1050 <pow@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cal_pow>:
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0x10(%rsp),%r14
mov    %r14,%rsi
call   1040 <ext_arg@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <ext_arg@plt>
mov    %r14,%rdi
call   1030 <atof@plt>
movaps %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
call   1050 <pow@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @cal_pow(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [50 x i8]
%5 = alloca double
%6 = alloca double
store i8* %0, i8** %2
%7 = load i8*, i8** %2
store i8* %7, i8** %3
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
%8 = load i8*, i8** %3
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%10 = call i8* @ext_arg(i8* %8, i8* %9)
store i8* %10, i8** %3
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%12 = call double @atof(i8* %11)
store double %12, double* %5
%13 = load i8*, i8** %3
%14 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%15 = call i8* @ext_arg(i8* %13, i8* %14)
store i8* %15, i8** %3
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%17 = call double @atof(i8* %16)
store double %17, double* %6
%18 = load double, double* %5
%19 = load double, double* %6
%20 = call double @pow(double %18, double %19)
ret double %20
}

LLVM IR (-O2):
define double @cal_pow(i8* %0) {
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = call i8* @ext_arg(i8* %0, i8* %3)
%5 = call double @atof(i8* %3)
%6 = call i8* @ext_arg(i8* %4, i8* %3)
%7 = call double @atof(i8* %3)
%8 = call double @pow(double %5, double %7)
ret double %8
}
int vde_chain_nm2_n_out(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @vde_chain_nm2_n_out() {
ret i32 3
}

LLVM IR (-O2):
define i32 @vde_chain_nm2_n_out() {
ret i32 3
}
void svm_swiotlb_init(void) {}


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

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

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

LLVM IR (-O2):
define void @svm_swiotlb_init() {
ret void
}
/* Variables and functions */
int random();
int yskiplist_gen_height(void) {
  int r = (random());
  int h = 1;
  for (; r & 1; r >>= 1)
    h++;
  return h;
}


x86 assembly (clang, -O0):
<yskiplist_gen_height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114f <yskiplist_gen_height+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1129 <yskiplist_gen_height+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yskiplist_gen_height>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
mov    $0x1,%ecx
test   $0x1,%al
je     113b <yskiplist_gen_height+0x2b>
mov    $0x1,%ecx
mov    %eax,%edx
nopl   0x0(%rax,%rax,1)
add    $0x1,%ecx
sar    %edx
test   $0x2,%al
mov    %edx,%eax
jne    1130 <yskiplist_gen_height+0x20>
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yskiplist_gen_height() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @random()
store i32 %3, i32* %1
store i32 1, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %1
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %11
11: ; preds = %8
%12 = load i32, i32* %1
%13 = ashr i32 %12, 1
store i32 %13, i32* %1
br label %4
14: ; preds = %4
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @yskiplist_gen_height() {
%1 = tail call i32 (...) @random()
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ 1, %0 ]
%6 = phi i32 [ %8, %4 ], [ %1, %0 ]
%7 = add nuw nsw i32 %5, 1
%8 = ashr i32 %6, 1
%9 = and i32 %6, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %0
%12 = phi i32 [ 1, %0 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
char *strdup(char const *const);
int adt_copysp(const char **a, const char *const *b) {
  return (*a = strdup(*b)) != 0;
}


x86 assembly (clang, -O0):
<adt_copysp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strdup@plt>
mov    -0x8(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adt_copysp>:
push   %rbx
mov    %rdi,%rbx
mov    (%rsi),%rdi
call   1030 <strdup@plt>
mov    %rax,(%rbx)
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @adt_copysp(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = load i8*, i8** %5
%7 = call i8* @strdup(i8* %6)
%8 = load i8**, i8*** %3
store i8* %7, i8** %8
%9 = icmp ne i8* %7, null
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @adt_copysp(i8** nocapture writeonly %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i8* @strdup(i8* %3)
store i8* %4, i8** %0
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_169() {
  Assert_real((isqrt(169) == 13),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              850, ("Integer square root of 169 should be 13"));
}


x86 assembly (clang, -O0):
<t_sqrt_169>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa9,%edi
call   1030 <isqrt@plt>
cmp    $0xd,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x352,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_169>:
push   %rax
mov    $0xa9,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x352,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 169 should be 13\00"
define void @t_sqrt_169() {
%1 = call i32 @isqrt(i32 169)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 850, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 169 should be 13\00"
define void @t_sqrt_169() {
%1 = tail call i32 @isqrt(i32 169)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 850, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ioctl_close(void) {}


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

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

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

LLVM IR (-O2):
define void @ioctl_close() {
ret void
}