xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
unsigned int sysconf(int /*<<< orphan*/);
unsigned perf_mmap_size(int buf_size_shift) {
  return ((1U << buf_size_shift) + 1) * sysconf(_SC_PAGESIZE);
}


x86 assembly (clang, -O0):
<perf_mmap_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_mmap_size>:
push   %rbx
mov    %edi,%ecx
mov    $0x1,%ebx
shl    %cl,%ebx
add    $0x1,%ebx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define i32 @perf_mmap_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = add i32 %4, 1
%6 = load i32, i32* @_SC_PAGESIZE
%7 = call i32 @sysconf(i32 %6)
%8 = mul i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define i32 @perf_mmap_size(i32 %0) {
%2 = shl nuw i32 1, %0
%3 = add nuw i32 %2, 1
%4 = load i32, i32* @_SC_PAGESIZE
%5 = tail call i32 @sysconf(i32 %4)
%6 = mul i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_put2_8(int, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ const *, int, int, int);
void MC_put_x_8_3dnow(uint8_t *dest, const uint8_t *ref, int stride,
                      int height) {
  MC_put2_8(height, dest, ref, stride, 1, 1);
}


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

x86 assembly (clang, -O2):
<MC_put_x_8_3dnow>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %eax,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <MC_put2_8@plt>

LLVM IR (-O0):
define void @MC_put_x_8_3dnow(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @MC_put2_8(i32 %9, i32* %10, i32* %11, i32 %12, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @MC_put_x_8_3dnow(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_put2_8(i32 %3, i32* %0, i32* %1, i32 %2, i32 1, i32 1)
ret void
}
/* Type definitions */
struct huron_object {
  int dummy;
};

/* Variables and functions */
struct huron_object *huron_number_new(unsigned long);
unsigned long strtoll(char const *, int /*<<< orphan*/ *, int);
struct huron_object *huron_parse(const char *s) {
  unsigned long value;
  value = strtoll(s, NULL, 10);
  return huron_number_new(value);
}


x86 assembly (clang, -O0):
<huron_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <huron_number_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<huron_parse>:
push   %rax
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <huron_number_new@plt>

LLVM IR (-O0):
%struct.huron_object = type { i32 }
define %struct.huron_object* @huron_parse(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strtoll(i8* %4, i32* null, i32 10)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call %struct.huron_object* @huron_number_new(i64 %6)
ret %struct.huron_object* %7
}

LLVM IR (-O2):
%struct.huron_object = type { i32 }
define %struct.huron_object* @huron_parse(i8* nocapture %0) {
%2 = tail call i64 @strtoll(i8* nocapture %0, i32* null, i32 10)
%3 = tail call %struct.huron_object* @huron_number_new(i64 %2)
ret %struct.huron_object* %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t UInt32GetLE(const void *b4) {
  return (((uint32_t)((const uint8_t *)b4)[3] << 24) |
          ((uint32_t)((const uint8_t *)b4)[2] << 16) |
          ((uint32_t)((const uint8_t *)b4)[1] << 8) |
          ((uint32_t)((const uint8_t *)b4)[0]));
}


x86 assembly (clang, -O0):
<UInt32GetLE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UInt32GetLE>:
mov    0x18(%rdi),%ecx
shl    $0x18,%ecx
mov    0x8(%rdi),%eax
mov    0x10(%rdi),%edx
shl    $0x10,%edx
or     %ecx,%edx
shl    $0x8,%eax
or     %edx,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @UInt32GetLE(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = getelementptr inbounds i64, i64* %4, i64 3
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 24
%9 = load i8*, i8** %2
%10 = bitcast i8* %9 to i64*
%11 = getelementptr inbounds i64, i64* %10, i64 2
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %8, %14
%16 = load i8*, i8** %2
%17 = bitcast i8* %16 to i64*
%18 = getelementptr inbounds i64, i64* %17, i64 1
%19 = load i64, i64* %18
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 8
%22 = or i32 %15, %21
%23 = load i8*, i8** %2
%24 = bitcast i8* %23 to i64*
%25 = getelementptr inbounds i64, i64* %24, i64 0
%26 = load i64, i64* %25
%27 = trunc i64 %26 to i32
%28 = or i32 %22, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @UInt32GetLE(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = getelementptr inbounds i8, i8* %0, i64 24
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 24
%8 = getelementptr inbounds i8, i8* %0, i64 16
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %12, %7
%14 = getelementptr inbounds i8, i8* %0, i64 8
%15 = bitcast i8* %14 to i64*
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i64, i64* %2
%21 = trunc i64 %20 to i32
%22 = or i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int PAPI_add_event(int, int);
void papif_add_event__(int *EventSet, int *Event, int *check) {
  *check = PAPI_add_event(*EventSet, *Event);
}


x86 assembly (clang, -O0):
<papif_add_event__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <PAPI_add_event@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_add_event__>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1030 <PAPI_add_event@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_add_event__(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @PAPI_add_event(i32 %4, i32 %5)
store i32 %6, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void printflaat(float x) { printf("%f\n", x); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @printflaat(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
void free_slice(char **array, int length) {
  for (int i = 0; i < length; i++) {
    free(array[i]);
  }
  free(array);
}


x86 assembly (clang, -O0):
<free_slice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_slice+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_slice+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_slice>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_slice+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_slice+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_slice(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = bitcast i8** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %12, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %8
}
int MIN(int a, int b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<MIN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <MIN+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <MIN+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIN>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @MIN(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
char *libirc_colorparser_irc2code(char const *, int);
char *irc_color_strip_from_mirc(const char *message) {
  return libirc_colorparser_irc2code(message, 1);
}


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

x86 assembly (clang, -O2):
<irc_color_strip_from_mirc>:
mov    $0x1,%esi
jmp    1030 <libirc_colorparser_irc2code@plt>

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

LLVM IR (-O2):
define i8* @irc_color_strip_from_mirc(i8* %0) {
%2 = tail call i8* @libirc_colorparser_irc2code(i8* %0, i32 1)
ret i8* %2
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/printf.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/printf.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/printf.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int write_be_short(unsigned short val, FILE *fp) {
  unsigned char c[2];
  c[0] = (val >> 8) & 0xFF;
  c[1] = val & 0xFF;
  return fwrite(c, 1, 2, fp);
}


x86 assembly (clang, -O0):
<write_be_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x12(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x11(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_be_short>:
push   %rax
mov    %rsi,%rcx
rol    $0x8,%di
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @write_be_short(i16 zeroext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
%5 = alloca [2 x i8]
store i16 %0, i16* %3
store i32* %1, i32** %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %10, i8* %11
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 %15, i8* %16
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%18 = load i32*, i32** %4
%19 = call i32 @fwrite(i8* %17, i32 1, i32 2, i32* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @write_be_short(i16 zeroext %0, i32* nocapture %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = lshr i16 %0, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %4
%7 = trunc i16 %0 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @fwrite(i8* %4, i32 1, i32 2, i32* %1)
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void encode_u16le(uint8_t **cursor, uint16_t val) {
  uint8_t *p = *cursor;
  *cursor += 2;
  p[0] = val & 0xff;
  p[1] = (val >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<encode_u16le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_u16le>:
mov    %esi,%eax
mov    (%rdi),%rcx
lea    0x8(%rcx),%rdx
mov    %rdx,(%rdi)
movzbl %al,%edx
mov    %edx,(%rcx)
movzbl %ah,%eax
mov    %eax,0x4(%rcx)
ret

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

LLVM IR (-O2):
define void @encode_u16le(i32** nocapture %0, i32 %1) {
%3 = load i32*, i32** %0
%4 = getelementptr inbounds i32, i32* %3, i64 2
store i32* %4, i32** %0
%5 = and i32 %1, 255
store i32 %5, i32* %3
%6 = lshr i32 %1, 8
%7 = and i32 %6, 255
%8 = getelementptr inbounds i32, i32* %3, i64 1
store i32 %7, i32* %8
ret void
}
void foo(void) {
  int j = 0;
  for (int i = 1; i <= 10; i++)
    j += i;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1133 <foo+0x33>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <foo+0x12>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
unsigned int REG_SPI_BASE(unsigned int);
__attribute__((always_)) __attribute__((flatten)) unsigned int
SPI_EXT2(unsigned int i) {
  return (REG_SPI_BASE(i) + 0xf8);
}


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

x86 assembly (clang, -O2):
<SPI_EXT2>:
push   %rax
call   1030 <REG_SPI_BASE@plt>
add    $0xf8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SPI_EXT2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @REG_SPI_BASE(i32 %3)
%5 = add i32 %4, 248
ret i32 %5
}

LLVM IR (-O2):
define i32 @SPI_EXT2(i32 %0) {
%2 = tail call i32 @REG_SPI_BASE(i32 %0)
%3 = add i32 %2, 248
ret i32 %3
}
char *test(int c) {
  static char buf[10];
  static char *bufptr = buf;
  return c ? buf : bufptr;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1121 <test+0x21>
lea    0x2f11(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    112c <test+0x2c>
mov    0x2ef8(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
lea    0x2f1a(%rip),%rax
ret

LLVM IR (-O0):
@test.buf = internal global [10 x i8] zeroinitializer
@test.bufptr = internal global i8* getelementptr inbounds ([10 x i8], [10 x i8]* @test.buf, i32 0, i32 0)
define i8* @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i8*, i8** @test.bufptr
br label %8
8: ; preds = %6, %5
%9 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @test.buf, i64 0, i64 0), %5 ], [ %7, %6 ]
ret i8* %9
}

LLVM IR (-O2):
@test.buf = internal global [10 x i8] zeroinitializer
define i8* @test(i32 %0) {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @test.buf, i64 0, i64 0)
}
/* Variables and functions */
int string_list_is_empty(char **list) {
  if (list == NULL)
    return 1;
  return list[0] == NULL;
}


x86 assembly (clang, -O0):
<string_list_is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <string_list_is_empty+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1132 <string_list_is_empty+0x32>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_list_is_empty>:
test   %rdi,%rdi
je     110f <string_list_is_empty+0xf>
xor    %eax,%eax
cmpq   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @string_list_is_empty(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ brc(int, char);
void sd(int pn) { brc(pn, 'T'); }


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

x86 assembly (clang, -O2):
<sd>:
mov    $0x54,%esi
jmp    1030 <brc@plt>

LLVM IR (-O0):
define void @sd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @brc(i32 %3, i8 signext 84)
ret void
}

LLVM IR (-O2):
define void @sd(i32 %0) {
%2 = tail call i32 @brc(i32 %0, i8 signext 84)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ println(int *, int);
int /*<<< orphan*/ quick_sort(int *, int);
int main() {
  int arr[] = {123, 343, 23, 43, 1323, 42, 1, 34, 13};
  int len = sizeof(arr) / sizeof(*arr);
  println(arr, len);
  quick_sort(arr, len);
  println(arr, len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
movl   $0x9,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <println@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1050 <quick_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <println@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef5(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <println@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <quick_sort@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <println@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [9 x i32] [i32 123, i32 343, i32 23, i32 43, i32 1323, i32 42, i32 1, i32 34, i32 13]
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [9 x i32]* %2 to i8*
store i32 9, i32* %3
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @println(i32* %5, i32 %6)
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @quick_sort(i32* %8, i32 %9)
%11 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @println(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [9 x i32] [i32 123, i32 343, i32 23, i32 43, i32 1323, i32 42, i32 1, i32 34, i32 13]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @println(i32* %3, i32 9)
%5 = call i32 @quick_sort(i32* %3, i32 9)
%6 = call i32 @println(i32* %3, i32 9)
ret i32 0
}
/* Variables and functions */
unsigned long xatoull_range(char const *, unsigned long, unsigned long);
unsigned long xatoul_range(const char *str, unsigned long l, unsigned long u) {
  return xatoull_range(str, l, u);
}


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

x86 assembly (clang, -O2):
<xatoul_range>:
jmp    1030 <xatoull_range@plt>

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

LLVM IR (-O2):
define i64 @xatoul_range(i8* %0, i64 %1, i64 %2) {
%4 = tail call i64 @xatoull_range(i8* %0, i64 %1, i64 %2)
ret i64 %4
}
int d_blt_rm2(double a1, double *a2) { return !(__builtin_isless(a1, *a2)); }


x86 assembly (clang, -O0):
<d_blt_rm2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blt_rm2>:
movsd  (%rdi),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
ret

LLVM IR (-O0):
define i32 @d_blt_rm2(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 = load double, double* %6
%8 = fcmp olt double %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_blt_rm2(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp ule double %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ atca_delay_us(int);
void atca_delay_ms(uint32_t delay) { atca_delay_us(delay * 1000); }


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

x86 assembly (clang, -O2):
<atca_delay_ms>:
imul   $0x3e8,%edi,%edi
jmp    1030 <atca_delay_us@plt>

LLVM IR (-O0):
define void @atca_delay_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @atca_delay_us(i32 %4)
ret void
}

LLVM IR (-O2):
define void @atca_delay_ms(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @atca_delay_us(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *, char const *);
int /*<<< orphan*/ stderr;
void fn_warn(const char *m, const char *f, const char *fn, int l) {
  fprintf(stderr, "libagl warning in %s:%d:(%s): %s\n", f, l, fn, m);
}


x86 assembly (clang, -O0):
<fn_warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x8(%rbp),%r9
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_warn>:
mov    %rdx,%r8
mov    %rsi,%rdx
mov    %rdi,%r9
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"libagl warning in %s:%d:(%s): %s\0A\00"
define void @fn_warn(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %6
%11 = load i32, i32* %8
%12 = load i8*, i8** %7
%13 = load i8*, i8** %5
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"libagl warning in %s:%d:(%s): %s\0A\00"
define void @fn_warn(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %3, i8* %2, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_input(int *, int **);
int get_max(int **, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 0;
  int j = 0;
  int goods_num = 0;
  int comb_goods[11][11];
  int max = 0;
  get_input(&goods_num, comb_goods);
  max = get_max(comb_goods, goods_num);
  printf("%d\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x204(%rbp)
lea    -0x200(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   1050 <get_input@plt>
lea    -0x200(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <get_max@plt>
mov    %eax,-0x204(%rbp)
mov    -0x204(%rbp),%esi
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x200,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <get_input@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <get_max@plt>
lea    0xe9b(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [11 x [11 x i32]]
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %6
%7 = getelementptr inbounds [11 x [11 x i32]], [11 x [11 x i32]]* %5, i64 0, i64 0
%8 = bitcast [11 x i32]* %7 to i32**
%9 = call i32 @get_input(i32* %4, i32** %8)
%10 = getelementptr inbounds [11 x [11 x i32]], [11 x [11 x i32]]* %5, i64 0, i64 0
%11 = bitcast [11 x i32]* %10 to i32**
%12 = load i32, i32* %4
%13 = call i32 @get_max(i32** %11, i32 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x [11 x i32]]
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast [11 x [11 x i32]]* %2 to i8*
%5 = bitcast [11 x [11 x i32]]* %2 to i32**
%6 = call i32 @get_input(i32* %1, i32** %5)
%7 = load i32, i32* %1
%8 = call i32 @get_max(i32** %5, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fucomp() {
  db(0xDD);
  db(0xE9);
}


x86 assembly (clang, -O0):
<fucomp>:
push   %rbp
mov    %rsp,%rbp
mov    $0xdd,%edi
call   1030 <db@plt>
mov    $0xe9,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fucomp>:
push   %rax
mov    $0xdd,%edi
call   1030 <db@plt>
mov    $0xe9,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fucomp() {
%1 = call i32 @db(i32 221)
%2 = call i32 @db(i32 233)
ret void
}

LLVM IR (-O2):
define void @fucomp() {
%1 = tail call i32 @db(i32 221)
%2 = tail call i32 @db(i32 233)
ret void
}
int cmp(const void *a, const void *b) {
  return *(long long *)a - *(long long *)b;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ mtx_t;

/* Variables and functions */
void mtx_destroy(mtx_t *mutex) { (void)mutex; }


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

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

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

LLVM IR (-O2):
define void @mtx_destroy(i32* nocapture %0) {
ret void
}
int foo(int *p, int *q) {
  int i;
  int accum = 0;
  for (i = 0; i < 1024; i++) {
    accum += ((*p--) * (*q++));
    accum += 4096;
    accum >>= 13;
  }
  return accum;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1172 <foo+0x72>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
imul   (%rcx),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1000,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sar    $0xd,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <foo+0x1a>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %ecx,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rsi,%rcx,4),%edx
mov    0x4(%rsi,%rcx,4),%r8d
imul   (%rdi),%edx
add    %edx,%eax
add    $0x1000,%eax
sar    $0xd,%eax
imul   -0x4(%rdi),%r8d
add    %r8d,%eax
add    $0x1000,%eax
sar    $0xd,%eax
add    $0x2,%rcx
add    $0xfffffffffffffff8,%rdi
cmp    $0x400,%ecx
jne    1110 <foo+0x10>
ret

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %23, %3 ]
%5 = phi i32 [ 0, %2 ], [ %24, %3 ]
%6 = phi i32* [ %1, %2 ], [ %18, %3 ]
%7 = phi i32* [ %0, %2 ], [ %16, %3 ]
%8 = getelementptr inbounds i32, i32* %7, i64 -1
%9 = load i32, i32* %7
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = load i32, i32* %6
%12 = mul nsw i32 %11, %9
%13 = add nsw i32 %4, 4096
%14 = add i32 %13, %12
%15 = ashr i32 %14, 13
%16 = getelementptr inbounds i32, i32* %7, i64 -2
%17 = load i32, i32* %8
%18 = getelementptr inbounds i32, i32* %6, i64 2
%19 = load i32, i32* %10
%20 = mul nsw i32 %19, %17
%21 = add nsw i32 %15, 4096
%22 = add i32 %21, %20
%23 = ashr i32 %22, 13
%24 = add nuw nsw i32 %5, 2
%25 = icmp eq i32 %24, 1024
br i1 %25, label %26, label %3
26: ; preds = %3
ret i32 %23
}
/* Variables and functions */
int /*<<< orphan*/ MergeSortR(void *, char *, int /*<<< orphan*/, size_t,
                              size_t, int (*)(void const *, void const *));
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(size_t);
void MergeSort(void *arr, size_t n_data, size_t data_size,
               int (*cmp)(const void *a, const void *b)) {
  char *out = (char *)malloc(n_data * data_size * sizeof(*out));
  MergeSortR(arr, out, 0, n_data - 1, data_size, cmp);
  free(out);
}


x86 assembly (clang, -O0):
<MergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
shl    $0x0,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
xor    %edx,%edx
call   1040 <MergeSortR@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MergeSort>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
mov    %rdx,%rdi
imul   %rsi,%rdi
call   1050 <malloc@plt>
mov    %rax,%r13
add    $0xffffffffffffffff,%rbx
mov    %r12,%rdi
mov    %rax,%rsi
xor    %edx,%edx
mov    %rbx,%rcx
mov    %r15,%r8
mov    %r14,%r9
call   1040 <MergeSortR@plt>
mov    %r13,%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @MergeSort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32 (i8*, i8*)*
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = mul i64 %10, %11
%13 = mul i64 %12, 1
%14 = call i64 @malloc(i64 %13)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %9
%16 = load i8*, i8** %5
%17 = load i8*, i8** %9
%18 = load i64, i64* %6
%19 = sub i64 %18, 1
%20 = load i64, i64* %7
%21 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%22 = call i32 @MergeSortR(i8* %16, i8* %17, i32 0, i64 %19, i64 %20, i32 (i8*, i8*)* %21)
%23 = load i8*, i8** %9
%24 = call i32 @free(i8* %23)
ret void
}

LLVM IR (-O2):
define void @MergeSort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = mul i64 %2, %1
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = add i64 %1, -1
%9 = tail call i32 @MergeSortR(i8* %0, i8* %7, i32 0, i64 %8, i64 %2, i32 (i8*, i8*)* %3)
%10 = tail call i32 @free(i8* %7)
ret void
}
void foo539(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo539(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t __infer_nondet_int();
size_t wcrtomb(char *s, wchar_t wc, mbstate_t *ps) {
  return __infer_nondet_int();
}


x86 assembly (clang, -O0):
<wcrtomb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @wcrtomb(i8* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
%4 = tail call i64 (...) @__infer_nondet_int()
ret i64 %4
}
/* Variables and functions */
int INT_MIN;
f1() {
  int b = INT_MIN;
  return b >= INT_MIN;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ece(%rip),%rcx
cmp    (%rcx),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @f1() {
%1 = alloca i32
%2 = load i32, i32* @INT_MIN
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @INT_MIN
%5 = icmp sge i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @f1() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ end_dd();
int /*<<< orphan*/ line_break();
void start_dt() {
  end_dd();
  line_break();
}


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

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

LLVM IR (-O0):
define void @start_dt() {
%1 = call i32 (...) @end_dd()
%2 = call i32 (...) @line_break()
ret void
}

LLVM IR (-O2):
define void @start_dt() {
%1 = tail call i32 (...) @end_dd()
%2 = tail call i32 (...) @line_break()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int __setxid(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int setreuid(uid_t ruid, uid_t euid) { return __setxid(70, ruid, euid, 0); }


x86 assembly (clang, -O0):
<setreuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x46,%edi
xor    %ecx,%ecx
call   1030 <__setxid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setreuid>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x46,%edi
xor    %ecx,%ecx
jmp    1030 <__setxid@plt>

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

LLVM IR (-O2):
define i32 @setreuid(i32 %0, i32 %1) {
%3 = tail call i32 @__setxid(i32 70, i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int ENOTSUP;
int fesetround(int round) { return -ENOTSUP; }


x86 assembly (clang, -O0):
<fesetround>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ed8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetround>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@ENOTSUP = global i32 0
define i32 @fesetround(i32 %0) {
%2 = load i32, i32* @ENOTSUP
%3 = sub nsw i32 0, %2
ret i32 %3
}