xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ int8_t;
typedef int int16_t;

/* Variables and functions */
int16_t ld_i16_le(const void *x) {
  return ((((int16_t)(((int8_t *)x)[1])) << 8) |
          ((int16_t)(((uint8_t *)x)[0])));
}


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

x86 assembly (clang, -O2):
<ld_i16_le>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ld_i16_le(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 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = bitcast i8* %9 to i64*
%11 = getelementptr inbounds i64, i64* %10, i64 0
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @ld_i16_le(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = getelementptr inbounds i8, i8* %0, i64 8
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = load i64, i64* %2
%9 = trunc i64 %8 to i32
%10 = or i32 %7, %9
ret i32 %10
}
void UARTDivisorLatchEnable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0xC)))) |= ((0x00000080u));
}


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

x86 assembly (clang, -O2):
<UARTDivisorLatchEnable>:
add    $0xc,%edi
orl    $0x80,(%rdi)
ret

LLVM IR (-O0):
define void @UARTDivisorLatchEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 12
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 128
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @UARTDivisorLatchEnable(i32 %0) {
%2 = add i32 %0, 12
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 128
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void _Tc_MarkerInfo_NullErrorMessage(const char *file, const char *funcname,
                                     unsigned long linenumber) {
  fprintf(stderr, "\n\nWARNING: Type-checked cast attempted on NULL pointer.");
  fprintf(stderr, "\n\nLocation: %s, function %s, line %lu. \n", file, funcname,
          linenumber);
}


x86 assembly (clang, -O0):
<_Tc_MarkerInfo_NullErrorMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Tc_MarkerInfo_NullErrorMessage>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    0x2eb8(%rip),%r12
mov    (%r12),%edi
lea    0xecd(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
lea    0xef3(%rip),%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r14,%r8
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"\0A\0AWARNING: Type-checked cast attempted on NULL pointer.\00"
@.str.1 = [41 x i8] c"\0A\0ALocation: %s, function %s, line %lu. \0A\00"
define void @_Tc_MarkerInfo_NullErrorMessage(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %10, i8* %11, i64 %12)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"\0A\0AWARNING: Type-checked cast attempted on NULL pointer.\00"
@.str.1 = [41 x i8] c"\0A\0ALocation: %s, function %s, line %lu. \0A\00"
define void @_Tc_MarkerInfo_NullErrorMessage(i8* %0, i8* %1, i64 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x42() {
  Assert_real((isalnum(66)),
              "/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/ctype/test_isalnum.c",
              335, ("isalnum should be 1 for B"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x42>:
push   %rbp
mov    %rsp,%rbp
mov    $0x42,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x14f,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x42>:
push   %rax
mov    $0x42,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x14f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for B\00"
define void @t_isalnum_0x42() {
%1 = call i32 @isalnum(i32 66)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for B\00"
define void @t_isalnum_0x42() {
%1 = tail call i32 @isalnum(i32 66)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void libconfig_strvec_delete(const char *const *vec) {
  const char *const *p;
  if (!vec)
    return;
  for (p = vec; *p; ++p)
    free((void *)(*p));
  free((void *)(vec));
}


x86 assembly (clang, -O0):
<libconfig_strvec_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <libconfig_strvec_delete+0x1c>
jmp    1168 <libconfig_strvec_delete+0x58>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115f <libconfig_strvec_delete+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <libconfig_strvec_delete+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libconfig_strvec_delete>:
test   %rdi,%rdi
je     1150 <libconfig_strvec_delete+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <libconfig_strvec_delete+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <libconfig_strvec_delete+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @libconfig_strvec_delete(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %11, %6 ], [ %4, %3 ]
%8 = phi i8** [ %10, %6 ], [ %0, %3 ]
%9 = tail call i32 @free(i8* %7)
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
%15 = tail call i32 @free(i8* %14)
br label %16
16: ; preds = %1, %13
ret void
}
/* Variables and functions */
int strtol(char const *, char **, int /*<<< orphan*/);
int x264_atoi(const char *str, int *b_error) {
  char *end;
  int v = strtol(str, &end, 0);
  if (end == str || *end != '\0')
    *b_error = 1;
  return v;
}


x86 assembly (clang, -O0):
<x264_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1150 <x264_atoi+0x40>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115a <x264_atoi+0x4a>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x264_atoi>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    (%rsp),%rcx
cmp    %rbx,%rcx
je     1132 <x264_atoi+0x22>
cmpb   $0x0,(%rcx)
je     1139 <x264_atoi+0x29>
movl   $0x1,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @x264_atoi(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @strtol(i8* %0, i8** %3, i32 0)
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8, i8* %6
%10 = icmp eq i8 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i32 1, i32* %1
br label %12
12: ; preds = %11, %8
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, float const);
void show_float(FILE *fp, const float f) { fprintf(fp, "%f", f); }


x86 assembly (clang, -O0):
<show_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_float>:
lea    0xee9(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @show_float(i32* nocapture %0, float %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_div();
int /*<<< orphan*/ gen_swap();
gen_mod() {
  gen_div();
  gen_swap();
}


x86 assembly (clang, -O0):
<gen_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gen_div@plt>
mov    $0x0,%al
call   1040 <gen_swap@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_mod() {
%1 = alloca i32
%2 = call i32 (...) @gen_div()
%3 = call i32 (...) @gen_swap()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @gen_mod() {
%1 = tail call i32 (...) @gen_div()
%2 = tail call i32 (...) @gen_swap()
ret i32 undef
}
int ai_select_cell_to_leave(struct s_cell **player_cells, int nb_cells) {
  return 1;
}


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

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

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

LLVM IR (-O2):
%struct.s_cell = type opaque
define i32 @ai_select_cell_to_leave(%struct.s_cell** nocapture readnone %0, i32 %1) {
ret i32 1
}
long UARTCharGetNonBlocking(unsigned long ulBase) {
  ;
  if (((*((volatile unsigned long *)(ulBase + 0x00000000))) & 0x00000020)) {
    return ((*((volatile unsigned long *)(ulBase + 0x00000004))));
  } else {
    return (-1);
  }
}


x86 assembly (clang, -O0):
<UARTCharGetNonBlocking>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
and    $0x20,%rax
cmp    $0x0,%rax
je     112e <UARTCharGetNonBlocking+0x2e>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1136 <UARTCharGetNonBlocking+0x36>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharGetNonBlocking>:
mov    $0xffffffffffffffff,%rax
testq  $0x20,(%rdi)
je     1114 <UARTCharGetNonBlocking+0x14>
mov    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @UARTCharGetNonBlocking(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = add i64 %4, 0
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, 32
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i64, i64* %3
%12 = add i64 %11, 4
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
store i64 %14, i64* %2
br label %16
15: ; preds = %1
store i64 -1, i64* %2
br label %16
16: ; preds = %15, %10
%17 = load i64, i64* %2
ret i64 %17
}

LLVM IR (-O2):
define i64 @UARTCharGetNonBlocking(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = and i64 %3, 32
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = add i64 %0, 4
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
br label %10
10: ; preds = %1, %6
%11 = phi i64 [ %9, %6 ], [ -1, %1 ]
ret i64 %11
}
/* Type definitions */
struct _Locale_collate {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
size_t _Locale_strxfrm(struct _Locale_collate *lcol, char *dest, size_t dest_n,
                       const char *src, size_t src_n) {
  if (dest != 0) {
    strncpy(dest, src, dest_n - 1);
    dest[dest_n - 1] = 0;
  }
  return src_n;
}


x86 assembly (clang, -O0):
<_Locale_strxfrm>:
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    %r8,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <_Locale_strxfrm+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_strxfrm>:
push   %r15
push   %r14
push   %rbx
mov    %r8,%r14
test   %rsi,%rsi
je     1138 <_Locale_strxfrm+0x28>
mov    %rdx,%r15
mov    %rsi,%rbx
add    $0xffffffffffffffff,%rdx
mov    %rsi,%rdi
mov    %rcx,%rsi
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%r15,1)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct._Locale_collate = type { i32 }
define i64 @_Locale_strxfrm(%struct._Locale_collate* nocapture readnone %0, i8* %1, i64 %2, i8* %3, i64 returned %4) {
%6 = icmp eq i8* %1, null
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = add i64 %2, -1
%9 = tail call i32 @strncpy(i8* %1, i8* %3, i64 %8)
%10 = getelementptr inbounds i8, i8* %1, i64 %8
store i8 0, i8* %10
br label %11
11: ; preds = %7, %5
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
long sys_epoll_create(va_list ap) {
  assert(!"sys_epoll_create not implemented");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"sys_epoll_create not implemented\00"
define i64 @sys_epoll_create(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @assert(i32 0)
ret i64 0
}

LLVM IR (-O2):
define i64 @sys_epoll_create(i32 %0) {
%2 = tail call i32 @assert(i32 0)
ret i64 0
}
int test_imm_32int16_mem(short *val) {
  return ((*val) & (0x32 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_32int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 50
%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_32int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 50
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
float const copysignfk(float, float);
__attribute__((visibility("default"))) const float xcopysignf(float x,
                                                              float y) {
  return copysignfk(x, y);
}


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

x86 assembly (clang, -O2):
<xcopysignf>:
jmp    1030 <copysignfk@plt>

LLVM IR (-O0):
define float @xcopysignf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @copysignfk(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @xcopysignf(float %0, float %1) {
%3 = tail call float @copysignfk(float %0, float %1)
ret float %3
}
/* Type definitions */
struct cl_rhash {
  int dummy;
};

/* Variables and functions */
void const *cl_rhash_insert(struct cl_rhash *, void **);
scalar_t__ cl_rhash_is_map(struct cl_rhash *);
const void *cl_rhash_add(struct cl_rhash *hash, const void *key) {
  if (cl_rhash_is_map(hash))
    return key;
  void *vkey = (void *)key;
  return cl_rhash_insert(hash, &vkey);
}


x86 assembly (clang, -O0):
<cl_rhash_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <cl_rhash_is_map@plt>
cmp    $0x0,%rax
je     1150 <cl_rhash_add+0x30>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <cl_rhash_add+0x49>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <cl_rhash_insert@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_rhash_add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <cl_rhash_is_map@plt>
test   %rax,%rax
jne    1146 <cl_rhash_add+0x26>
mov    %r14,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <cl_rhash_insert@plt>
mov    %rax,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.cl_rhash = type { i32 }
define i8* @cl_rhash_add(%struct.cl_rhash* %0, i8* %1) {
%3 = alloca i8*
%4 = tail call i64 @cl_rhash_is_map(%struct.cl_rhash* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = bitcast i8** %3 to i8*
store i8* %1, i8** %3
%8 = call i8* @cl_rhash_insert(%struct.cl_rhash* %0, i8** %3)
br label %9
9: ; preds = %2, %6
%10 = phi i8* [ %8, %6 ], [ %1, %2 ]
ret i8* %10
}
int test_imm_67uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x67 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_67uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 103
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ff_hevc_put_hevc_uni_w_pel_pixels4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_pel_pixels4_8_sse4() {
ret void
}
/* Variables and functions */
int EOF;
int fgetc2(char *buf, long *pos, long size) {
  if (*pos > size)
    return EOF;
  return buf[(*pos)++];
}


x86 assembly (clang, -O0):
<fgetc2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
jle    1132 <fgetc2+0x32>
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <fgetc2+0x4e>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc2>:
mov    (%rsi),%rax
cmp    %rdx,%rax
jle    1112 <fgetc2+0x12>
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret
lea    0x1(%rax),%rcx
mov    %rcx,(%rsi)
movsbl (%rdi,%rax,1),%eax
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fgetc2(i8* nocapture %0, i64* nocapture %1, i64 %2) {
%4 = load i64, i64* %1
%5 = icmp sgt i64 %4, %2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = load i32, i32* @EOF
br label %13
8: ; preds = %3
%9 = add nsw i64 %4, 1
store i64 %9, i64* %1
%10 = getelementptr inbounds i8, i8* %0, i64 %4
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
br label %13
13: ; preds = %8, %6
%14 = phi i32 [ %7, %6 ], [ %12, %8 ]
ret i32 %14
}
void gtk_text_view_set_cursor_visible() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_set_cursor_visible() {
ret void
}
int fun425() { return 425; }


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

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

LLVM IR (-O0):
define i32 @fun425() {
ret i32 425
}

LLVM IR (-O2):
define i32 @fun425() {
ret i32 425
}
void test_binn_version() {
  char *version = binn_version();
  assert(version);
  assert(strcmp(version, "3.0.0") == 0);
}


x86 assembly (clang, -O0):
<test_binn_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <binn_version@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_binn_version>:
push   %rbx
xor    %eax,%eax
call   1050 <binn_version@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <assert@plt>
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
xor    %eax,%eax
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"3.0.0\00"
define void @test_binn_version() {
%1 = alloca i8*
%2 = call i32 (...) @binn_version()
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %5)
%7 = load i8*, i8** %1
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"3.0.0\00"
define void @test_binn_version() {
%1 = tail call i32 (...) @binn_version()
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %3)
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %7)
ret void
}
/* Variables and functions */
char toupper(char);
void UpperCase(char *p) {
  while (*p) {
    *p = toupper(*p);
    ++p;
  }
}


x86 assembly (clang, -O0):
<UpperCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <UpperCase+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <UpperCase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpperCase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <UpperCase+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <UpperCase+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @UpperCase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("hello sample_package");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"hello sample_package\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [21 x i8] c"hello sample_package\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ M_Menu_JoinServer_f();
void JoinNetworkServerFunc(void *unused) { M_Menu_JoinServer_f(); }


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

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

LLVM IR (-O0):
define void @JoinNetworkServerFunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @M_Menu_JoinServer_f()
ret void
}

LLVM IR (-O2):
define void @JoinNetworkServerFunc(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @M_Menu_JoinServer_f()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("UDPTrunker usage: \n"); }


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"UDPTrunker usage: \00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t *incr_p(uint32_t *p) { return p + 1; }


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

x86 assembly (clang, -O2):
<incr_p>:
lea    0x4(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @incr_p(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
ret i32* %2
}
int main() {
  unsigned long t1 = ((unsigned long long)-2) / 2;
  return t1 == 9223372036854775807;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x10(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
cmp    %rax,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 9223372036854775807, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 9223372036854775807
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Type definitions */
struct varmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ varmap_adj_max_2(struct varmap **, size_t const, int);
void varmap_adj_max(struct varmap **b, const size_t requested_size) {
  varmap_adj_max_2(b, requested_size, 1);
}


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

x86 assembly (clang, -O2):
<varmap_adj_max>:
mov    $0x1,%edx
jmp    1030 <varmap_adj_max_2@plt>

LLVM IR (-O0):
%struct.varmap = type { i32 }
define void @varmap_adj_max(%struct.varmap** %0, i64 %1) {
%3 = alloca %struct.varmap**
%4 = alloca i64
store %struct.varmap** %0, %struct.varmap*** %3
store i64 %1, i64* %4
%5 = load %struct.varmap**, %struct.varmap*** %3
%6 = load i64, i64* %4
%7 = call i32 @varmap_adj_max_2(%struct.varmap** %5, i64 %6, i32 1)
ret void
}

LLVM IR (-O2):
%struct.varmap = type { i32 }
define void @varmap_adj_max(%struct.varmap** %0, i64 %1) {
%3 = tail call i32 @varmap_adj_max_2(%struct.varmap** %0, i64 %1, i32 1)
ret void
}
/* Type definitions */
struct Fd {
  int dummy;
};

/* Variables and functions */
int fd_close(struct Fd *, int);
int fd_lookup(int, struct Fd **);
int close(int fdnum) {
  struct Fd *fd;
  int r;
  if ((r = fd_lookup(fdnum, &fd)) < 0)
    return r;
  else
    return fd_close(fd, 1);
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <fd_lookup@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    114e <close+0x2e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <close+0x3f>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <fd_close@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rax
mov    %rsp,%rsi
call   1040 <fd_lookup@plt>
test   %eax,%eax
js     113b <close+0x1b>
mov    (%rsp),%rdi
mov    $0x1,%esi
call   1030 <fd_close@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.Fd = type { i32 }
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.Fd*
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @fd_lookup(i32 %6, %struct.Fd** %4)
store i32 %7, i32* %5
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %5
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load %struct.Fd*, %struct.Fd** %4
%13 = call i32 @fd_close(%struct.Fd* %12, i32 1)
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.Fd = type { i32 }
define i32 @close(i32 %0) {
%2 = alloca %struct.Fd*
%3 = bitcast %struct.Fd** %2 to i8*
%4 = call i32 @fd_lookup(i32 %0, %struct.Fd** %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load %struct.Fd*, %struct.Fd** %2
%8 = call i32 @fd_close(%struct.Fd* %7, i32 1)
br label %9
9: ; preds = %1, %6
%10 = phi i32 [ %8, %6 ], [ %4, %1 ]
ret i32 %10
}
/* Variables and functions */
size_t ft_strlen(const char *s) {
  char *save;
  save = (char *)s;
  while (*save != '\0')
    ++save;
  return (save - s);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <ft_strlen+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ft_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ft_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @ft_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ DumpWord(int, int /*<<< orphan*/ *);
void DumpLong(long i, FILE *D) {
  int hi = 0x00FFFF & (i >> 16);
  int lo = 0x00FFFF & i;
  DumpWord(hi, D);
  DumpWord(lo, D);
}


x86 assembly (clang, -O0):
<DumpLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x10,%rax
and    $0xffff,%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <DumpWord@plt>
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <DumpWord@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpLong>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
movzwl %di,%ebp
shr    $0x10,%edi
call   1030 <DumpWord@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <DumpWord@plt>

LLVM IR (-O0):
define void @DumpLong(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %3
store i32* %1, i32** %4
%7 = load i64, i64* %3
%8 = ashr i64 %7, 16
%9 = and i64 65535, %8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %5
%11 = load i64, i64* %3
%12 = and i64 65535, %11
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32*, i32** %4
%16 = call i32 @DumpWord(i32 %14, i32* %15)
%17 = load i32, i32* %6
%18 = load i32*, i32** %4
%19 = call i32 @DumpWord(i32 %17, i32* %18)
ret void
}

LLVM IR (-O2):
define void @DumpLong(i64 %0, i32* %1) {
%3 = trunc i64 %0 to i32
%4 = lshr i32 %3, 16
%5 = and i32 %3, 65535
%6 = tail call i32 @DumpWord(i32 %4, i32* %1)
%7 = tail call i32 @DumpWord(i32 %5, i32* %1)
ret void
}
void h_cnum(char *name, int argc, char **argv, void *user_data) {
  printf("Called: %s\n", __FUNCTION__);
}


x86 assembly (clang, -O0):
<h_cnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_cnum>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_cnum = [7 x i8] c"h_cnum\00"
define void @h_cnum(i8* %0, i32 %1, i8** %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.h_cnum, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_cnum = [7 x i8] c"h_cnum\00"
define void @h_cnum(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.h_cnum, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  write(1, "hello, world\n", 13);
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xec5(%rip),%rsi
mov    $0xd,%edx
call   1040 <write@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0xd,%edx
call   1040 <write@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%3 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello, world\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%2 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int shmdt(void const *);
int plat_shmdt(const void *shmaddr) { return (shmdt(shmaddr)); }


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

x86 assembly (clang, -O2):
<plat_shmdt>:
jmp    1030 <shmdt@plt>

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

LLVM IR (-O2):
define i32 @plat_shmdt(i8* %0) {
%2 = tail call i32 @shmdt(i8* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double generateRandom() {
  return (double)rand() / (double)((unsigned)RAND_MAX + 1);
}


x86 assembly (clang, -O0):
<generateRandom>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateRandom>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @generateRandom() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = trunc i64 %3 to i32
%5 = add i32 %4, 1
%6 = uitofp i32 %5 to double
%7 = fdiv double %2, %6
ret double %7
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @generateRandom() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = trunc i64 %3 to i32
%5 = add i32 %4, 1
%6 = uitofp i32 %5 to double
%7 = fdiv double %2, %6
ret double %7
}
void gtk_menu_item_deselect() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_item_deselect() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t hci_subevent_le_connection_complete_get_supervision_timeout(
    const uint8_t *event) {
  return little_endian_read_16(event, 18);
}


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

x86 assembly (clang, -O2):
<hci_subevent_le_connection_complete_get_supervision_timeout>:
mov    $0x12,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @hci_subevent_le_connection_complete_get_supervision_timeout(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 18)
ret i32 %2
}