xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ u_char;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ inet_ntop(int, int /*<<< orphan*/ *, char *, int);
char *getipaddress(int af, u_char *adrspace) {
  static char buf[64];
  bzero(&buf[0], sizeof(buf));
  inet_ntop(af, adrspace, buf, sizeof(buf));
  return (&buf[0]);
}


x86 assembly (clang, -O0):
<getipaddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0x2f0a(%rip),%rdi
mov    $0x40,%esi
call   1040 <bzero@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0x2ef2(%rip),%rdx
mov    $0x40,%ecx
call   1030 <inet_ntop@plt>
lea    0x2ee1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getipaddress>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x2f10(%rip),%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1040 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x40,%ecx
call   1030 <inet_ntop@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@getipaddress.buf = internal global [64 x i8] zeroinitializer
define i8* @getipaddress(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @bzero(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @getipaddress.buf, i64 0, i64 0), i32 64)
%6 = load i32, i32* %3
%7 = load i32*, i32** %4
%8 = call i32 @inet_ntop(i32 %6, i32* %7, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @getipaddress.buf, i64 0, i64 0), i32 64)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @getipaddress.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@getipaddress.buf = internal global [64 x i8] zeroinitializer
define i8* @getipaddress(i32 %0, i32* %1) {
%3 = tail call i32 @bzero(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @getipaddress.buf, i64 0, i64 0), i32 64)
%4 = tail call i32 @inet_ntop(i32 %0, i32* %1, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @getipaddress.buf, i64 0, i64 0), i32 64)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @getipaddress.buf, i64 0, i64 0)
}
int backtrace(void **buffer, int size) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @backtrace(i8** nocapture readnone %0, i32 %1) {
ret i32 0
}
void Lut_1(double *out, double *in) { out[0] = in[0]; }


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

x86 assembly (clang, -O2):
<Lut_1>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @Lut_1(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
ret void
}

LLVM IR (-O2):
define void @Lut_1(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
ret void
}
/* Type definitions */
struct create_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ create_cmdline_parser_required2(struct create_args_info *,
                                           char const *, int /*<<< orphan*/);
int create_cmdline_parser_required(struct create_args_info *args_info,
                                   const char *prog_name) {
  int result = EXIT_SUCCESS;
  if (create_cmdline_parser_required2(args_info, prog_name, 0) > 0)
    result = EXIT_FAILURE;
  return result;
}


x86 assembly (clang, -O0):
<create_cmdline_parser_required>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <create_cmdline_parser_required2@plt>
cmp    $0x0,%rax
jle    1151 <create_cmdline_parser_required+0x41>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_cmdline_parser_required>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%ebx
xor    %edx,%edx
call   1030 <create_cmdline_parser_required2@plt>
test   %rax,%rax
jle    112f <create_cmdline_parser_required+0x1f>
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.create_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @create_cmdline_parser_required(%struct.create_args_info* %0, i8* %1) {
%3 = alloca %struct.create_args_info*
%4 = alloca i8*
%5 = alloca i32
store %struct.create_args_info* %0, %struct.create_args_info** %3
store i8* %1, i8** %4
%6 = load i32, i32* @EXIT_SUCCESS
store i32 %6, i32* %5
%7 = load %struct.create_args_info*, %struct.create_args_info** %3
%8 = load i8*, i8** %4
%9 = call i64 @create_cmdline_parser_required2(%struct.create_args_info* %7, i8* %8, i32 0)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
store i32 %12, i32* %5
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.create_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @create_cmdline_parser_required(%struct.create_args_info* %0, i8* %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i64 @create_cmdline_parser_required2(%struct.create_args_info* %0, i8* %1, i32 0)
%5 = icmp sgt i64 %4, 0
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %5, i32 %6, i32 %3
ret i32 %7
}
/* Variables and functions */
int recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
void receive_key(int *nbytes, int local_fd, char *buf) {
  char buffer[128];
  char first_buf[512];
  *nbytes = recv(local_fd, first_buf, sizeof first_buf, 0);
  strcpy(buf, first_buf);
  strcpy(buffer, first_buf);
}


x86 assembly (clang, -O0):
<receive_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2a0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x2a0(%rbp),%rsi
mov    $0x200,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rdi
lea    -0x2a0(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0xa0(%rbp),%rdi
lea    -0x2a0(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0x2a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receive_key>:
push   %r15
push   %r14
push   %rbx
sub    $0x280,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0x80(%rsp),%r15
mov    %esi,%edi
mov    %r15,%rsi
mov    $0x200,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,(%rbx)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %rsp,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
add    $0x280,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @receive_key(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [128 x i8]
%8 = alloca [512 x i8]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = load i32, i32* %5
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%11 = call i32 @recv(i32 %9, i8* %10, i32 512, i32 0)
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i8*, i8** %6
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%17 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%18 = call i32 @strcpy(i8* %16, i8* %17)
ret void
}

LLVM IR (-O2):
define void @receive_key(i32* nocapture writeonly %0, i32 %1, i8* %2) {
%4 = alloca [128 x i8]
%5 = alloca [512 x i8]
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%8 = call i32 @recv(i32 %1, i8* %7, i32 512, i32 0)
store i32 %8, i32* %0
%9 = call i32 @strcpy(i8* %2, i8* %7)
%10 = call i32 @strcpy(i8* %6, i8* %7)
ret void
}
int sum2to3(int (*pfunc)(int, int)) { return (*pfunc)(2, 3); }


x86 assembly (clang, -O0):
<sum2to3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum2to3>:
mov    %rdi,%rax
mov    $0x2,%edi
mov    $0x3,%esi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @sum2to3(i32 (i32, i32)* nocapture %0) {
%2 = tail call i32 %0(i32 2, i32 3)
ret i32 %2
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct clause_list {
  int dummy;
};
struct Clause {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_back(struct genlist const *);
struct Clause *clause_list_back(const struct clause_list *tthis) {
  return (struct Clause *)genlist_back((const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<clause_list_back>:
jmp    1030 <genlist_back@plt>

LLVM IR (-O0):
%struct.Clause = type { i32 }
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.Clause* @clause_list_back(%struct.clause_list* %0) {
%2 = alloca %struct.clause_list*
store %struct.clause_list* %0, %struct.clause_list** %2
%3 = load %struct.clause_list*, %struct.clause_list** %2
%4 = bitcast %struct.clause_list* %3 to %struct.genlist*
%5 = call i64 @genlist_back(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.Clause*
ret %struct.Clause* %6
}

LLVM IR (-O2):
%struct.Clause = type { i32 }
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.Clause* @clause_list_back(%struct.clause_list* %0) {
%2 = bitcast %struct.clause_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_back(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.Clause*
ret %struct.Clause* %4
}
unsigned int pair_first(unsigned int x) { return (x >> 16) & 0xffff; }


x86 assembly (clang, -O0):
<pair_first>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_first>:
mov    %edi,%eax
shr    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @pair_first(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = and i32 %4, 65535
ret i32 %5
}

LLVM IR (-O2):
define i32 @pair_first(i32 %0) {
%2 = lshr i32 %0, 16
ret i32 %2
}
/* Variables and functions */
int read(int, void *, unsigned int);
int serialPortRead(int fd, void *buf, unsigned int numBytes) {
  return read(fd, buf, numBytes);
}


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

x86 assembly (clang, -O2):
<serialPortRead>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @serialPortRead(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
int strcmp(char const *, char const *);
int strcoll(const char *s1, const char *s2) {
  printf(">>> strcoll(%s,%s)\n", s1, s2);
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<strcoll>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcmp@plt>

LLVM IR (-O0):
@.str = [20 x i8] c">>> strcoll(%s,%s)\0A\00"
define i32 @strcoll(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 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @strcmp(i8* %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [20 x i8] c">>> strcoll(%s,%s)\0A\00"
define i32 @strcoll(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %4
}
/* Variables and functions */
unsigned int sad_mx_n_simd(unsigned char const *, int, unsigned char const *,
                           int, unsigned int, int, int);
unsigned int vp8_sad4x4_simd(const unsigned char *src_ptr, int src_stride,
                             const unsigned char *ref_ptr, int ref_stride,
                             unsigned int max_sad) {
  return sad_mx_n_simd(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 4, 4);
}


x86 assembly (clang, -O0):
<vp8_sad4x4_simd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    $0x4,%r9d
movl   $0x4,(%rsp)
call   1030 <sad_mx_n_simd@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_sad4x4_simd>:
push   %rax
movl   $0x4,(%rsp)
mov    $0x4,%r9d
call   1030 <sad_mx_n_simd@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @vp8_sad4x4_simd(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @sad_mx_n_simd(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 4, i32 4)
ret i32 %6
}
void bn_div_words(void) {}


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

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

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

LLVM IR (-O2):
define void @bn_div_words() {
ret void
}
void I2CIntDisable(unsigned long ulBase, unsigned long ulIntType) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) &= ~ulIntType;
}


x86 assembly (clang, -O0):
<I2CIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CIntDisable>:
not    %rsi
and    %rsi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @I2CIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 4
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @I2CIntDisable(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %0, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
/* Variables and functions */
double fabs(double);
int log(double);
double pow(double, double);
double psih(double y) {
  y = fabs(y);
  double c = 0.33;
  double d = 0.057;
  double n = 0.78;
  return (((1 - d) / n) * log((c + pow(y, n)) / c));
}


x86 assembly (clang, -O0):
<psih>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xee7(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xea4(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe8f(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
addsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movsd  -0x28(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psih>:
push   %rax
andpd  0xed7(%rip),%xmm0
movsd  0xedf(%rip),%xmm1
call   1040 <pow@plt>
movsd  0xeda(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
call   1030 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xec6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @psih(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = call double @llvm.fabs.f64(double %6)
store double %7, double* %2
store double 3.300000e-01, double* %3
store double 5.700000e-02, double* %4
store double 7.800000e-01, double* %5
%8 = load double, double* %4
%9 = fsub double 1.000000e+00, %8
%10 = load double, double* %5
%11 = fdiv double %9, %10
%12 = load double, double* %3
%13 = load double, double* %2
%14 = load double, double* %5
%15 = call double @pow(double %13, double %14)
%16 = fadd double %12, %15
%17 = load double, double* %3
%18 = fdiv double %16, %17
%19 = call i32 @log(double %18)
%20 = sitofp i32 %19 to double
%21 = fmul double %11, %20
ret double %21
}

LLVM IR (-O2):
define double @psih(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = tail call double @pow(double %2, double 7.800000e-01)
%4 = fadd double %3, 3.300000e-01
%5 = fdiv double %4, 3.300000e-01
%6 = tail call i32 @log(double %5)
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 0x3FF357F57F57F57F
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void printFooter_() { puts("..."); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"...\00"
define void @printFooter_() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_to_address(int, int);
void timer_init() {
  write_to_address(0x3F00B408, 0x00F90000);
  write_to_address(0x3F00B408, 0x00F90200);
}


x86 assembly (clang, -O0):
<timer_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f00b408,%edi
mov    $0xf90000,%esi
call   1030 <write_to_address@plt>
mov    $0x3f00b408,%edi
mov    $0xf90200,%esi
call   1030 <write_to_address@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_init>:
push   %rax
mov    $0x3f00b408,%edi
mov    $0xf90000,%esi
call   1030 <write_to_address@plt>
mov    $0x3f00b408,%edi
mov    $0xf90200,%esi
pop    %rax
jmp    1030 <write_to_address@plt>

LLVM IR (-O0):
define void @timer_init() {
%1 = call i32 @write_to_address(i32 1057010696, i32 16318464)
%2 = call i32 @write_to_address(i32 1057010696, i32 16318976)
ret void
}

LLVM IR (-O2):
define void @timer_init() {
%1 = tail call i32 @write_to_address(i32 1057010696, i32 16318464)
%2 = tail call i32 @write_to_address(i32 1057010696, i32 16318976)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _mm_free(double *);
void xvm_free(double x[]) { _mm_free(x); }


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

x86 assembly (clang, -O2):
<xvm_free>:
jmp    1030 <_mm_free@plt>

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

LLVM IR (-O2):
define void @xvm_free(double* %0) {
%2 = tail call i32 @_mm_free(double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sigHandler(int sig) { exit(128 + sig); }


x86 assembly (clang, -O0):
<sigHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x80,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigHandler>:
push   %rax
sub    $0xffffff80,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 128, %3
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @sigHandler(i32 %0) {
%2 = add nsw i32 %0, 128
%3 = tail call i32 @exit(i32 %2)
unreachable
}
void event_instruction(s) char *s;
{}


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

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

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

LLVM IR (-O2):
define void @event_instruction(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ test();
int main(int argc, char **argv) {
  printf("%s", argv[1]);
  test();
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 (...) @test()
ret i32 0
}
int prod_compose_numbers(int a, int b) { return a + b - 1; }


x86 assembly (clang, -O0):
<prod_compose_numbers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prod_compose_numbers>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @prod_compose_numbers(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 = add nsw i32 %5, %6
%8 = sub nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @prod_compose_numbers(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
ret i32 %4
}
int eap_peer_method_unload(struct eap_method *method) { return 0; }


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

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

LLVM IR (-O0):
%struct.eap_method = type opaque
define i32 @eap_peer_method_unload(%struct.eap_method* %0) {
%2 = alloca %struct.eap_method*
store %struct.eap_method* %0, %struct.eap_method** %2
ret i32 0
}

LLVM IR (-O2):
%struct.eap_method = type opaque
define i32 @eap_peer_method_unload(%struct.eap_method* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AccelsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void AccelsUpdated() { UAVObjUpdated(AccelsHandle()); }


x86 assembly (clang, -O0):
<AccelsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AccelsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AccelsUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <AccelsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @AccelsUpdated() {
%1 = call i32 (...) @AccelsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AccelsUpdated() {
%1 = tail call i32 (...) @AccelsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int write_quaddobl_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(242, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_quaddobl_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xf2,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_quaddobl_target_system>:
mov    $0xf2,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @write_quaddobl_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 242, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_quaddobl_target_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 242, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long long getMicroTime() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (((unsigned long long)tv.tv_sec * (unsigned long long)1000000) +
          (unsigned long long)tv.tv_usec);
}


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

x86 assembly (clang, -O2):
<getMicroTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @getMicroTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = add i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @getMicroTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *run_lmntal_system(int /*<<< orphan*/, char *, char *,
                                      int /*<<< orphan*/);
FILE *lmntal_compile_file(char *filename) {
  return run_lmntal_system(0, "--slimcode", filename, 0);
}


x86 assembly (clang, -O0):
<lmntal_compile_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %ecx,%ecx
lea    0xed7(%rip),%rsi
mov    %ecx,%edi
call   1030 <run_lmntal_system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmntal_compile_file>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
xor    %edi,%edi
xor    %ecx,%ecx
jmp    1030 <run_lmntal_system@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"--slimcode\00"
define i32* @lmntal_compile_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @run_lmntal_system(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3, i32 0)
ret i32* %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"--slimcode\00"
define i32* @lmntal_compile_file(i8* %0) {
%2 = tail call i32* @run_lmntal_system(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(void) {
  fputs("\n[Adv10] 0.0.0 ORIGINAL COLLOSAL CAVE TEXT ADVENTURE\n\n", stdout);
  fputs("\n        MUCH DARKNESS\n\n", stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
lea    0xee3(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [55 x i8] c"\0A[Adv10] 0.0.0 ORIGINAL COLLOSAL CAVE TEXT ADVENTURE\0A\0A\00"
@stdout = global i32 0
@.str.1 = [25 x i8] c"\0A MUCH DARKNESS\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fputs(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [55 x i8] c"\0A[Adv10] 0.0.0 ORIGINAL COLLOSAL CAVE TEXT ADVENTURE\0A\0A\00"
@stdout = global i32 0
@.str.1 = [25 x i8] c"\0A MUCH DARKNESS\0A\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct bst {
  int dummy;
};

/* Variables and functions */
int bst_check_height(struct bst *);
bool bst_check_balanced_optimized(struct bst *tree) {
  if (bst_check_height(tree) == -1)
    return false;
  else
    return true;
}


x86 assembly (clang, -O0):
<bst_check_balanced_optimized>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <bst_check_height@plt>
cmp    $0xffffffff,%eax
jne    113a <bst_check_balanced_optimized+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1141 <bst_check_balanced_optimized+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bst_check_balanced_optimized>:
push   %rax
call   1030 <bst_check_height@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.bst = type { i32 }
define i32 @bst_check_balanced_optimized(%struct.bst* %0) {
%2 = alloca i32
%3 = alloca %struct.bst*
store %struct.bst* %0, %struct.bst** %3
%4 = load %struct.bst*, %struct.bst** %3
%5 = call i32 @bst_check_height(%struct.bst* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
%struct.bst = type { i32 }
define i32 @bst_check_balanced_optimized(%struct.bst* %0) {
%2 = tail call i32 @bst_check_height(%struct.bst* %0)
%3 = icmp ne i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ explicit_bzero(void *, size_t);
void OPENSSL_cleanse(void *ptr, size_t len) { explicit_bzero(ptr, len); }


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

x86 assembly (clang, -O2):
<OPENSSL_cleanse>:
jmp    1030 <explicit_bzero@plt>

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

LLVM IR (-O2):
define void @OPENSSL_cleanse(i8* %0, i64 %1) {
%3 = tail call i32 @explicit_bzero(i8* %0, i64 %1)
ret void
}
/* Type definitions */
struct sk_buff {
  int dummy;
};

/* Variables and functions */
void *bpf_internal_load_pointer_neg_helper(struct sk_buff const *, int,
                                           unsigned int);
void *skb_header_pointer(struct sk_buff const *, int, unsigned int, void *);
void *bpf_load_pointer(const struct sk_buff *skb, int k, unsigned int size,
                       void *buffer) {
  if (k >= 0)
    return skb_header_pointer(skb, k, size, buffer);
  return bpf_internal_load_pointer_neg_helper(skb, k, size);
}


x86 assembly (clang, -O0):
<bpf_load_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     115c <bpf_load_pointer+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <skb_header_pointer@plt>
mov    %rax,-0x8(%rbp)
jmp    116f <bpf_load_pointer+0x4f>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <bpf_internal_load_pointer_neg_helper@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_load_pointer>:
test   %esi,%esi
js     1129 <bpf_load_pointer+0x9>
jmp    1030 <skb_header_pointer@plt>
jmp    1040 <bpf_internal_load_pointer_neg_helper@plt>

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

LLVM IR (-O2):
%struct.sk_buff = type { i32 }
define i8* @bpf_load_pointer(%struct.sk_buff* %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp sgt i32 %1, -1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i8* @skb_header_pointer(%struct.sk_buff* %0, i32 %1, i32 %2, i8* %3)
br label %10
8: ; preds = %4
%9 = tail call i8* @bpf_internal_load_pointer_neg_helper(%struct.sk_buff* %0, i32 %1, i32 %2)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int write(int, int *, int);
void write_int(int fd, int n) {
  int next = write(fd, &n, sizeof(int));
  if (next <= 0)
    error("read failed");
}


x86 assembly (clang, -O0):
<write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1158 <write_int+0x38>
lea    0xead(%rip),%rdi
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
test   %eax,%eax
jle    113a <write_int+0x1a>
pop    %rax
ret
lea    0xebf(%rip),%rdi
pop    %rax
jmp    1040 <error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"read failed\00"
define void @write_int(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 = call i32 @write(i32 %6, i32* %4, i32 4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"read failed\00"
define void @write_int(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 4)
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_UNBLOCK;
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void sig_unblockall(void) {
  sigset_t set;
  sigfillset(&set);
  sigprocmask(SIG_UNBLOCK, &set, NULL);
}


x86 assembly (clang, -O0):
<sig_unblockall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigfillset@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_unblockall>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigfillset@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_UNBLOCK = global i32 0
define void @sig_unblockall() {
%1 = alloca i32
%2 = call i32 @sigfillset(i32* %1)
%3 = load i32, i32* @SIG_UNBLOCK
%4 = call i32 @sigprocmask(i32 %3, i32* %1, i32* null)
ret void
}

LLVM IR (-O2):
@SIG_UNBLOCK = global i32 0
define void @sig_unblockall() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = load i32, i32* @SIG_UNBLOCK
%5 = call i32 @sigprocmask(i32 %4, i32* %1, i32* null)
ret void
}
void ff_hevc_put_hevc_qpel_h12_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h12_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xe7() {
  Assert_real((isprint(231) == 0),
              "/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_isprint.c",
              1160, ("isprint should be 0 for 0xe7"));
}


x86 assembly (clang, -O0):
<t_isprint_0xe7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe7,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x488,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0xe7>:
push   %rax
mov    $0xe7,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x488,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xe7\00"
define void @t_isprint_0xe7() {
%1 = call i64 @isprint(i32 231)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1160, i8* getelementptr inbounds ([29 x i8], [29 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xe7\00"
define void @t_isprint_0xe7() {
%1 = tail call i64 @isprint(i32 231)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_80int16_reg(short val) {
  return ((val) & (-0x80 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_80int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff80,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_80int16_reg>:
movzwl %di,%eax
cmp    $0x80,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_80int16_reg(i16 signext %0) {
%2 = icmp ult i16 %0, 128
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Variables and functions */
double custom_fp(float);
int main(int argc, char *argv[]) { return custom_fp((float)argc) > 1.0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
call   1030 <custom_fp@plt>
movsd  0xec8(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cvtsi2ss %edi,%xmm0
call   1030 <custom_fp@plt>
xor    %eax,%eax
ucomisd 0xedc(%rip),%xmm0
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to float
%8 = call double @custom_fp(float %7)
%9 = fcmp ogt double %8, 1.000000e+00
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = sitofp i32 %0 to float
%4 = tail call double @custom_fp(float %3)
%5 = fcmp ogt double %4, 1.000000e+00
%6 = zext i1 %5 to i32
ret i32 %6
}
int test_imm_1Fuint8_reg(unsigned char val) {
  return ((val) & (0x1F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Fuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 31
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}