xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ stderr;
void utfError(char *file, int line, char *message) {
  (void)fprintf(stderr, "UTF ERROR [\"%s\":%d]: %s\n", file, line, message);
  abort();
}


x86 assembly (clang, -O0):
<utfError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<utfError>:
push   %rax
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"UTF ERROR [\22%s\22:%d]: %s\0A\00"
define void @utfError(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"UTF ERROR [\22%s\22:%d]: %s\0A\00"
define void @utfError(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
union bpf_attr {
  int /*<<< orphan*/ prog_id;
};
typedef int /*<<< orphan*/ attr;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int /*<<< orphan*/ BPF_PROG_GET_FD_BY_ID;
int /*<<< orphan*/ bzero(union bpf_attr *, int);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_prog_get_fd_by_id(__u32 id) {
  union bpf_attr attr;
  bzero(&attr, sizeof(attr));
  attr.prog_id = id;
  return sys_bpf(BPF_PROG_GET_FD_BY_ID, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_prog_get_fd_by_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1040 <bzero@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_prog_get_fd_by_id>:
push   %rax
mov    %edi,(%rsp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_PROG_GET_FD_BY_ID = global i32 0
define i32 @bpf_prog_get_fd_by_id(i32 %0) {
%2 = alloca i32
%3 = alloca %union.bpf_attr
store i32 %0, i32* %2
%4 = call i32 @bzero(%union.bpf_attr* %3, i32 4)
%5 = load i32, i32* %2
%6 = bitcast %union.bpf_attr* %3 to i32*
store i32 %5, i32* %6
%7 = load i32, i32* @BPF_PROG_GET_FD_BY_ID
%8 = call i32 @sys_bpf(i32 %7, %union.bpf_attr* %3, i32 4)
ret i32 %8
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_PROG_GET_FD_BY_ID = global i32 0
define i32 @bpf_prog_get_fd_by_id(i32 %0) {
%2 = alloca %union.bpf_attr
%3 = bitcast %union.bpf_attr* %2 to i8*
%4 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %2, i64 0, i32 0
store i32 %0, i32* %4
%5 = load i32, i32* @BPF_PROG_GET_FD_BY_ID
%6 = call i32 @sys_bpf(i32 %5, %union.bpf_attr* %2, i32 4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void _speex_putc(int ch, void *file) {
  FILE *f = (FILE *)file;
  fputc(ch, f);
}


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

x86 assembly (clang, -O2):
<_speex_putc>:
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @_speex_putc(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i32 @fputc(i32 %0, i32* %3)
ret void
}
int test_imm_3Aint16_reg(short val) {
  return ((val) & (0x3A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Aint16_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, 58
%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_3Aint16_reg(i16 signext %0) {
%2 = and i16 %0, 58
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close_trace();
void debug_kill() { close_trace(); }


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

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

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

LLVM IR (-O2):
define void @debug_kill() {
%1 = tail call i32 (...) @close_trace()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgsynth(char *);
void cgsynand(void) { cgsynth("and"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"and\00"
define void @cgsynand() {
%1 = tail call i32 @cgsynth(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int bar(unsigned int x, unsigned int y, unsigned int z) {
  return x + y + z;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, %0
%5 = add i32 %4, %2
ret i32 %5
}
void set2l(char *p, unsigned int v) {
  int i;
  for (i = 0; i < 2; i++)
    p[i] = ((v >> 8 * i) & 255);
}


x86 assembly (clang, -O0):
<set2l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1147 <set2l+0x47>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
shr    %cl,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <set2l+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set2l>:
mov    %si,(%rdi)
ret

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

LLVM IR (-O2):
define void @set2l(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
int stringlength(char *scr) {
  int count = 0;
  while (*scr != '\0') {
    count++;
    scr++;
  }
  return count;
}


x86 assembly (clang, -O0):
<stringlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <stringlength+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <stringlength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringlength>:
cmpb   $0x0,(%rdi)
je     111c <stringlength+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <stringlength+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @stringlength(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 i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%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
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
unsigned char *chacha20poly1305_encrypt(unsigned char *, size_t *,
                                        unsigned char const *, size_t,
                                        unsigned char const *,
                                        unsigned char const *);
unsigned char *crypt_encrypt_chacha20poly1305(
    unsigned char *out, size_t *out_len, const unsigned char *in, size_t in_len,
    const unsigned char *nonce, const unsigned char *key) {
  return chacha20poly1305_encrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_encrypt_chacha20poly1305>:
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)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <chacha20poly1305_encrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_encrypt_chacha20poly1305>:
jmp    1030 <chacha20poly1305_encrypt@plt>

LLVM IR (-O0):
define i8* @crypt_encrypt_chacha20poly1305(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @chacha20poly1305_encrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_encrypt_chacha20poly1305(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @chacha20poly1305_encrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ matNd_setColumn(double *, double const *, int const, int);
void mat3d_setColumn(double matrix[9], const double v[3], const int col) {
  matNd_setColumn(matrix, v, col, 3);
}


x86 assembly (clang, -O0):
<mat3d_setColumn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x3,%ecx
call   1030 <matNd_setColumn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat3d_setColumn>:
mov    $0x3,%ecx
jmp    1030 <matNd_setColumn@plt>

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

LLVM IR (-O2):
define void @mat3d_setColumn(double* %0, double* %1, i32 %2) {
%4 = tail call i32 @matNd_setColumn(double* %0, double* %1, i32 %2, i32 3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *stdin;
FILE *file___new_NativeFile_native_stdin___impl() { return stdin; }


x86 assembly (clang, -O0):
<file___new_NativeFile_native_stdin___impl>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<file___new_NativeFile_native_stdin___impl>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@stdin = global i32* null
define i32* @file___new_NativeFile_native_stdin___impl() {
%1 = load i32*, i32** @stdin
ret i32* %1
}

LLVM IR (-O2):
@stdin = global i32* null
define i32* @file___new_NativeFile_native_stdin___impl() {
%1 = load i32*, i32** @stdin
ret i32* %1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xmapping;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xmapping_type(void *_p) {
  return (int)((XEvent *)_p)->xmapping.type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xmapping_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xmapping_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("\e[32m"
         "Hello World!"
         "\e[0m\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"\1B[32mHello World!\1B[0m\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"\1B[32mHello World!\1B[0m\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float clamp(float val, float min, float max) {
  if (val <= min)
    return min;
  else if (val >= max)
    return max;
  return val;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1135 <clamp+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1162 <clamp+0x62>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     1153 <clamp+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1162 <clamp+0x62>
jmp    1158 <clamp+0x58>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
movaps %xmm2,%xmm3
cmpless %xmm0,%xmm3
andps  %xmm3,%xmm2
andnps %xmm0,%xmm3
orps   %xmm2,%xmm3
cmpnless %xmm1,%xmm0
andps  %xmm0,%xmm3
andnps %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp ole float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %6
store float %12, float* %4
br label %22
13: ; preds = %3
%14 = load float, float* %5
%15 = load float, float* %7
%16 = fcmp oge float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %7
store float %18, float* %4
br label %22
19: ; preds = %13
br label %20
20: ; preds = %19
%21 = load float, float* %5
store float %21, float* %4
br label %22
22: ; preds = %20, %17, %11
%23 = load float, float* %4
ret float %23
}

LLVM IR (-O2):
define float @clamp(float %0, float %1, float %2) {
%4 = fcmp ugt float %0, %1
%5 = fcmp oge float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %6, float %1
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("\nusage: txt2font <root_name>\n");
  printf("\n\ninput file  <root_name>.txt");
  printf("\noutput file <root_name>.h");
  printf("\n");
  return;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xf01(%rip),%rdi
call   1040 <puts@plt>
lea    0xebc(%rip),%rdi
call   1050 <printf@plt>
lea    0xece(%rip),%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\0Ausage: txt2font <root_name>\0A\00"
@.str.1 = [30 x i8] c"\0A\0Ainput file <root_name>.txt\00"
@.str.2 = [27 x i8] c"\0Aoutput file <root_name>.h\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [30 x i8] c"\0A\0Ainput file <root_name>.txt\00"
@.str.2 = [27 x i8] c"\0Aoutput file <root_name>.h\00"
@str = [29 x i8] c"\0Ausage: txt2font <root_name>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
ret void
}
void replicationGetSlaveName(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               107, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<replicationGetSlaveName>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x6b,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<replicationGetSlaveName>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x6b,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.replicationGetSlaveName = [24 x i8] c"replicationGetSlaveName\00"
define void @replicationGetSlaveName() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 107, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.replicationGetSlaveName, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.replicationGetSlaveName = [24 x i8] c"replicationGetSlaveName\00"
define void @replicationGetSlaveName() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 107, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.replicationGetSlaveName, i64 0, i64 0))
ret void
}
__attribute__((__no__)) void
do_nothing_packed_runtime_partial(struct test_packed *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_packed_runtime_partial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_packed_runtime_partial+0x1b>
jmp    1120 <do_nothing_packed_runtime_partial+0x20>
jmp    1120 <do_nothing_packed_runtime_partial+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_packed = type opaque
define void @do_nothing_packed_runtime_partial(%struct.test_packed* %0) {
%2 = alloca %struct.test_packed*
store %struct.test_packed* %0, %struct.test_packed** %2
%3 = load %struct.test_packed*, %struct.test_packed** %2
%4 = ptrtoint %struct.test_packed* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_packed = type opaque
define void @do_nothing_packed_runtime_partial(%struct.test_packed* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SOCK_DGRAM;
int j_socket_connect(int /*<<< orphan*/, char *, char *);
int j_socket_udp_connect(char *server, char *port) {
  return j_socket_connect(SOCK_DGRAM, server, port);
}


x86 assembly (clang, -O0):
<j_socket_udp_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <j_socket_connect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_socket_udp_connect>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <j_socket_connect@plt>

LLVM IR (-O0):
@SOCK_DGRAM = global i32 0
define i32 @j_socket_udp_connect(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @SOCK_DGRAM
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @j_socket_connect(i32 %5, i8* %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@SOCK_DGRAM = global i32 0
define i32 @j_socket_udp_connect(i8* %0, i8* %1) {
%3 = load i32, i32* @SOCK_DGRAM
%4 = tail call i32 @j_socket_connect(i32 %3, i8* %0, i8* %1)
ret i32 %4
}
void test2(char *P) { struct A *a = (struct A *)P; }


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

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

LLVM IR (-O0):
%struct.A = type opaque
define void @test2(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.A*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.A*
store %struct.A* %5, %struct.A** %3
ret void
}

LLVM IR (-O2):
define void @test2(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, double);
scalar_t__ strlen(char *);
int cvtFloatToExpString(float f_value, char *pstr_value,
                        unsigned short f_precision) {
  sprintf(pstr_value, "%.*e", (int)f_precision, (double)f_value);
  return ((int)strlen(pstr_value));
}


x86 assembly (clang, -O0):
<cvtFloatToExpString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
movzwl -0x12(%rbp),%edx
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb0(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvtFloatToExpString>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
cvtss2sd %xmm0,%xmm0
lea    0xecf(%rip),%rsi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%.*e\00"
define i32 @cvtFloatToExpString(float %0, i8* %1, i16 zeroext %2) {
%4 = alloca float
%5 = alloca i8*
%6 = alloca i16
store float %0, float* %4
store i8* %1, i8** %5
store i16 %2, i16* %6
%7 = load i8*, i8** %5
%8 = load i16, i16* %6
%9 = zext i16 %8 to i32
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9, double %11)
%13 = load i8*, i8** %5
%14 = call i64 @strlen(i8* %13)
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.*e\00"
define i32 @cvtFloatToExpString(float %0, i8* nocapture %1, i16 zeroext %2) {
%4 = zext i16 %2 to i32
%5 = fpext float %0 to double
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4, double %5)
%7 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int mkdir(char const *, int /*<<< orphan*/);
__attribute__((__weak__, __always___)) int
softboundcets_mkdir(const char *pathname, mode_t mode) {
  return mkdir(pathname, mode);
}


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

x86 assembly (clang, -O2):
<softboundcets_mkdir>:
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_mkdir(i8* %0, i32 %1) {
%3 = tail call i32 @mkdir(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
size_t CHAR_BIT;
bool bit_test(const void *data, size_t pos) {
  size_t chunk = pos / CHAR_BIT;
  size_t offset = pos % CHAR_BIT;
  const unsigned char *cdata = (const unsigned char *)data;
  return (cdata[chunk] >> offset) & 0x1;
}


x86 assembly (clang, -O0):
<bit_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ec9(%rip),%rcx
xor    %edx,%edx
divq   (%rcx)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2eb5(%rip),%rcx
xor    %edx,%edx
divq   (%rcx)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x20(%rbp),%rcx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_test>:
mov    %rsi,%rax
mov    0x2ed6(%rip),%rcx
mov    (%rcx),%rcx
mov    %rsi,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1123 <bit_test+0x23>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rcx
jmp    1129 <bit_test+0x29>
xor    %edx,%edx
div    %ecx
mov    %edx,%ecx
movzbl (%rdi,%rax,1),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i64 0
define i32 @bit_test(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%8 = load i64, i64* %4
%9 = load i64, i64* @CHAR_BIT
%10 = udiv i64 %8, %9
store i64 %10, i64* %5
%11 = load i64, i64* %4
%12 = load i64, i64* @CHAR_BIT
%13 = urem i64 %11, %12
store i64 %13, i64* %6
%14 = load i8*, i8** %3
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = load i64, i64* %5
%17 = getelementptr inbounds i8, i8* %15, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i64, i64* %6
%21 = trunc i64 %20 to i32
%22 = ashr i32 %19, %21
%23 = and i32 %22, 1
ret i32 %23
}

LLVM IR (-O2):
@CHAR_BIT = global i64 0
define i32 @bit_test(i8* nocapture %0, i64 %1) {
%3 = load i64, i64* @CHAR_BIT
%4 = udiv i64 %1, %3
%5 = urem i64 %1, %3
%6 = getelementptr inbounds i8, i8* %0, i64 %4
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = trunc i64 %5 to i32
%10 = lshr i32 %8, %9
%11 = and i32 %10, 1
ret i32 %11
}
/* Type definitions */
struct dat {
  int dummy;
};

/* Variables and functions */
int __remove_pattern(struct dat *, unsigned char *, unsigned long, int,
                     void (*)(void *));
int remove_reverse_pattern(struct dat *d, unsigned char *key,
                           unsigned long key_len, void (*free_fn)(void *)) {
  return __remove_pattern(d, key, key_len, 1, free_fn);
}


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

x86 assembly (clang, -O2):
<remove_reverse_pattern>:
mov    %rcx,%r8
mov    $0x1,%ecx
jmp    1030 <__remove_pattern@plt>

LLVM IR (-O0):
%struct.dat = type { i32 }
define i32 @remove_reverse_pattern(%struct.dat* %0, i8* %1, i64 %2, void (i8*)* %3) {
%5 = alloca %struct.dat*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca void (i8*)*
store %struct.dat* %0, %struct.dat** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store void (i8*)* %3, void (i8*)** %8
%9 = load %struct.dat*, %struct.dat** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load void (i8*)*, void (i8*)** %8
%13 = call i32 @__remove_pattern(%struct.dat* %9, i8* %10, i64 %11, i32 1, void (i8*)* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.dat = type { i32 }
define i32 @remove_reverse_pattern(%struct.dat* %0, i8* %1, i64 %2, void (i8*)* %3) {
%5 = tail call i32 @__remove_pattern(%struct.dat* %0, i8* %1, i64 %2, i32 1, void (i8*)* %3)
ret i32 %5
}
int roadmap_nmea_null_decoder(int argc, char *argv[]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @roadmap_nmea_null_decoder(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct libalias {
  int dummy;
};

/* Variables and functions */
int LibAliasOutLocked(struct libalias *, char *, int, int);
int /*<<< orphan*/ NOREF(struct libalias *);
int LibAliasOutTry(struct libalias *la, char *ptr, int maxpacketsize,
                   int create) {
  int res;
  NOREF((la));
  ;
  res = LibAliasOutLocked(la, ptr, maxpacketsize, create);
  NOREF((la));
  return (res);
}


x86 assembly (clang, -O0):
<LibAliasOutTry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <NOREF@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <LibAliasOutLocked@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <NOREF@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LibAliasOutTry>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <NOREF@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1030 <LibAliasOutLocked@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1040 <NOREF@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.libalias = type { i32 }
define i32 @LibAliasOutTry(%struct.libalias* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.libalias*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.libalias* %0, %struct.libalias** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load %struct.libalias*, %struct.libalias** %5
%11 = call i32 @NOREF(%struct.libalias* %10)
%12 = load %struct.libalias*, %struct.libalias** %5
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @LibAliasOutLocked(%struct.libalias* %12, i8* %13, i32 %14, i32 %15)
store i32 %16, i32* %9
%17 = load %struct.libalias*, %struct.libalias** %5
%18 = call i32 @NOREF(%struct.libalias* %17)
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
%struct.libalias = type { i32 }
define i32 @LibAliasOutTry(%struct.libalias* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @NOREF(%struct.libalias* %0)
%6 = tail call i32 @LibAliasOutLocked(%struct.libalias* %0, i8* %1, i32 %2, i32 %3)
%7 = tail call i32 @NOREF(%struct.libalias* %0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void HVP(int riga, int colonna) { printf("\x1B[%d;%df", riga, colonna); }


x86 assembly (clang, -O0):
<HVP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HVP>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%df\00"
define void @HVP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%df\00"
define void @HVP(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
void Default_Handler(void) {
  for (;;)
    ;
}


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

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

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

LLVM IR (-O2):
define void @Default_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
scalar_t__ isnan(double);
int doubles_equal(double expected, double received) {
  if (isnan(expected) && isnan(received))
    return 1;
  return (expected == received);
}


x86 assembly (clang, -O0):
<doubles_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1156 <doubles_equal+0x46>
movsd  -0x18(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1156 <doubles_equal+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1170 <doubles_equal+0x60>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubles_equal>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <isnan@plt>
test   %rax,%rax
je     1147 <doubles_equal+0x37>
movsd  0x8(%rsp),%xmm0
call   1030 <isnan@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1147 <doubles_equal+0x37>
add    $0x18,%rsp
ret
movsd  0x10(%rsp),%xmm0
cmpeqsd 0x8(%rsp),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @doubles_equal(double %0, double %1) {
%3 = tail call i64 @isnan(double %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i64 @isnan(double %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5, %2
%9 = fcmp oeq double %0, %1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %5, %8
%12 = phi i32 [ %10, %8 ], [ 1, %5 ]
ret i32 %12
}
void GB_SoundEnd(void) {}


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

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

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

LLVM IR (-O2):
define void @GB_SoundEnd() {
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFDIR;
int stat(char *, struct stat *);
int dirExist(char *path) {
  int s;
  struct stat info;
  s = stat(path, &info);
  return (s == 0 && (info.st_mode & S_IFDIR));
}


x86 assembly (clang, -O0):
<dirExist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jne    1150 <dirExist+0x40>
mov    -0x10(%rbp),%eax
mov    0x2e93(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirExist>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
sete   %al
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%ecx
and    (%rsp),%ecx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @dirExist(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.stat
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_IFDIR
%13 = and i32 %11, %12
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %9, %1
%16 = phi i1 [ false, %1 ], [ %14, %9 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @dirExist(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @S_IFDIR
%9 = and i32 %8, %7
%10 = icmp ne i32 %9, 0
%11 = select i1 %5, i1 %10, i1 false
%12 = zext i1 %11 to i32
ret i32 %12
}
int main() {
  while (1)
    return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double x_cubed(double x) { return x * x * x; }


x86 assembly (clang, -O0):
<x_cubed>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_cubed>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @x_cubed(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @x_cubed(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__8__IO__clr();
void CC2420ReceiveP__CSN__clr(void) { HplAtm128GeneralIOPinP__8__IO__clr(); }


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

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

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

LLVM IR (-O2):
define void @CC2420ReceiveP__CSN__clr() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__8__IO__clr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EIO;
int /*<<< orphan*/ errno;
int getentropy_urandom(void *, size_t);
int getentropy(void *buf, size_t len) {
  int ret = -1;
  if (len > 256) {
    errno = EIO;
    return -1;
  }
  ret = getentropy_urandom(buf, len);
  if (ret != -1)
    return (ret);
  errno = EIO;
  return (ret);
}


x86 assembly (clang, -O0):
<getentropy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
cmpq   $0x100,-0x18(%rbp)
jbe    1153 <getentropy+0x43>
mov    0x2ea4(%rip),%rax
mov    (%rax),%ecx
mov    0x2e93(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1190 <getentropy+0x80>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <getentropy_urandom@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
je     1178 <getentropy+0x68>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <getentropy+0x80>
mov    0x2e61(%rip),%rax
mov    (%rax),%ecx
mov    0x2e50(%rip),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getentropy>:
push   %rax
cmp    $0x100,%rsi
ja     1126 <getentropy+0x16>
call   1030 <getentropy_urandom@plt>
cmp    $0xffffffff,%eax
je     1126 <getentropy+0x16>
pop    %rcx
ret
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    0x2ea2(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EIO = global i32 0
@errno = global i32 0
define i32 @getentropy(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 -1, i32* %6
%7 = load i64, i64* %5
%8 = icmp ugt i64 %7, 256
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* @EIO
store i32 %10, i32* @errno
store i32 -1, i32* %3
br label %22
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = call i32 @getentropy_urandom(i8* %12, i64 %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, -1
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = load i32, i32* %6
store i32 %18, i32* %3
br label %22
19: ; preds = %11
%20 = load i32, i32* @EIO
store i32 %20, i32* @errno
%21 = load i32, i32* %6
store i32 %21, i32* %3
br label %22
22: ; preds = %19, %17, %9
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@EIO = global i32 0
@errno = global i32 0
define i32 @getentropy(i8* %0, i64 %1) {
%3 = icmp ugt i64 %1, 256
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @getentropy_urandom(i8* %0, i64 %1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %4, %2
%8 = load i32, i32* @EIO
store i32 %8, i32* @errno
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %5, %4 ], [ -1, %7 ]
ret i32 %10
}