xunge/DecIR huggingface dataset:
/* Type definitions */
struct gengetopt_args_info {
  int dummy;
};

/* Variables and functions */
int cmdline_parser_internal(int, char *const *, struct gengetopt_args_info *,
                            int, int, int, int /*<<< orphan*/ *);
int cmdline_parser2(int argc, char *const *argv,
                    struct gengetopt_args_info *args_info, int override,
                    int initialize) {
  return cmdline_parser_internal(argc, argv, args_info, override, initialize, 1,
                                 NULL);
}


x86 assembly (clang, -O0):
<cmdline_parser2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    $0x1,%r9d
xor    %eax,%eax
movq   $0x0,(%rsp)
call   1030 <cmdline_parser_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdline_parser2>:
push   %rax
movq   $0x0,(%rsp)
mov    $0x1,%r9d
call   1030 <cmdline_parser_internal@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.gengetopt_args_info = type { i32 }
define i32 @cmdline_parser2(i32 %0, i8** %1, %struct.gengetopt_args_info* %2, i32 %3, i32 %4) {
%6 = tail call i32 @cmdline_parser_internal(i32 %0, i8** %1, %struct.gengetopt_args_info* %2, i32 %3, i32 %4, i32 1, i32* null)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t minipack_unpack_bin16(void *ptr, size_t *sz) {
  *sz = 3;
  return ntohs(*((uint16_t *)(ptr + 1)));
}


x86 assembly (clang, -O0):
<minipack_unpack_bin16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x3,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%edi
call   1030 <ntohs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_bin16>:
movq   $0x3,(%rsi)
mov    0x1(%rdi),%edi
jmp    1030 <ntohs@plt>

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

LLVM IR (-O2):
define i32 @minipack_unpack_bin16(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 3, i64* %1
%3 = getelementptr i8, i8* %0, i64 1
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @ntohs(i32 %5)
ret i32 %6
}
unsigned short int f38(unsigned short int x, unsigned long int y) {
  return (x >> y) | (x << ((-y) & (8 * 2 - 1)));
}


x86 assembly (clang, -O0):
<f38>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x10(%rbp),%rcx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0xf,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f38>:
mov    %rsi,%rcx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
and    $0xf,%cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f38(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = ashr i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i64, i64* %4
%13 = sub i64 0, %12
%14 = and i64 %13, 15
%15 = trunc i64 %14 to i32
%16 = shl i32 %11, %15
%17 = or i32 %9, %16
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @f38(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = lshr i32 %3, %4
%6 = sub i32 0, %4
%7 = and i32 %6, 15
%8 = shl nuw nsw i32 %3, %7
%9 = or i32 %8, %5
%10 = trunc i32 %9 to i16
ret i16 %10
}
/* Type definitions */
struct sigaction {
  void (*sa_handler)(int);
  int /*<<< orphan*/ sa_mask;
};
typedef int /*<<< orphan*/ sa;

/* Variables and functions */
int /*<<< orphan*/ memset(struct sigaction *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sigaction(int, struct sigaction *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
void register_sig_handler(int signal, void (*handler)(int)) {
  struct sigaction sa;
  memset(&sa, 0, sizeof(sa));
  sa.sa_handler = handler;
  sigfillset(&sa.sa_mask);
  sigaction(signal, &sa, NULL);
}


x86 assembly (clang, -O0):
<register_sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
add    $0x8,%rdi
call   1050 <sigfillset@plt>
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_sig_handler>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
mov    %rbx,(%rsp)
lea    0x8(%rsp),%rdi
call   1050 <sigfillset@plt>
mov    %ebp,%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.sigaction = type { void (i32)*, i32 }
define void @register_sig_handler(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
%5 = alloca %struct.sigaction
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%6 = call i32 @memset(%struct.sigaction* %5, i32 0, i32 16)
%7 = load void (i32)*, void (i32)** %4
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 0
store void (i32)* %7, void (i32)** %8
%9 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 1
%10 = call i32 @sigfillset(i32* %9)
%11 = load i32, i32* %3
%12 = call i32 @sigaction(i32 %11, %struct.sigaction* %5, i32* null)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { void (i32)*, i32 }
define void @register_sig_handler(i32 %0, void (i32)* %1) {
%3 = alloca %struct.sigaction
%4 = bitcast %struct.sigaction* %3 to i8*
%5 = call i32 @memset(%struct.sigaction* %3, i32 0, i32 16)
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 0
store void (i32)* %1, void (i32)** %6
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 1
%8 = call i32 @sigfillset(i32* %7)
%9 = call i32 @sigaction(i32 %0, %struct.sigaction* %3, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ proutn(char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void crami(int i, int w) {
  char buf[16];
  sprintf(buf, "%*d", w, i);
  proutn(buf);
}


x86 assembly (clang, -O0):
<crami>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xec1(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <proutn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crami>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%edx
mov    %edi,%ecx
lea    0xed0(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <proutn@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%*d\00"
define void @crami(i32 %0, i32 %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%6 = call i32 @proutn(i8* %4)
ret void
}
void gtk_tree_model_rows_reordered() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_xrl_data(FILE *stream, uint8_t data) {
  fprintf(stream,
          "XRL   A, #"
          "0x%02X"
          "                  ",
          data);
}


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

x86 assembly (clang, -O2):
<fprint_xrl_data>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"XRL A,x%02X \00"
define void @fprint_xrl_data(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 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"XRL A,x%02X \00"
define void @fprint_xrl_data(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int write(int, char *, int);
int io_write_byte(int dest, char c) {
  if (write(dest, &c, 1) != 1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<io_write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
je     1147 <io_write_byte+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <io_write_byte+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_write_byte>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @io_write_byte(i32 %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
%5 = icmp ne i32 %4, 1
%6 = sext i1 %5 to i32
ret i32 %6
}
int no_op(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @no_op() {
ret i32 0
}
int misc_deregister(struct miscdevice *misc) {
  int i;
  { return (i); }
}


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

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

LLVM IR (-O0):
%struct.miscdevice = type opaque
define i32 @misc_deregister(%struct.miscdevice* %0) {
%2 = alloca %struct.miscdevice*
%3 = alloca i32
store %struct.miscdevice* %0, %struct.miscdevice** %2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.miscdevice = type opaque
define i32 @misc_deregister(%struct.miscdevice* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello World\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_CDint64_lowword_reg(long long val) {
  return ((val) & (0xCD << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CDint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 205
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned long long getenv_ull(const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @getenv_ull(i8* nocapture readnone %0) {
ret i64 0
}
float ct_fast_cos_impl(const float x) {
  const float x2 = x * x;
  return 0.99940307f + x2 * (-0.49558072f + 0.03679168f * x2);
}


x86 assembly (clang, -O0):
<ct_fast_cos_impl>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xeda(%rip),%xmm2
mulss  %xmm2,%xmm1
movss  0xed2(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xeba(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct_fast_cos_impl>:
mulss  %xmm0,%xmm0
movss  0xef4(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xeec(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ct_fast_cos_impl(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %3
%7 = load float, float* %3
%8 = load float, float* %3
%9 = call float @llvm.fmuladd.f32(float 0x3FA2D65BE0000000, float %8, float 0xBFDFB79840000000)
%10 = call float @llvm.fmuladd.f32(float %7, float %9, float 0x3FEFFB1C20000000)
ret float %10
}

LLVM IR (-O2):
define float @ct_fast_cos_impl(float %0) {
%2 = fmul float %0, %0
%3 = tail call float @llvm.fmuladd.f32(float %2, float 0x3FA2D65BE0000000, float 0xBFDFB79840000000)
%4 = tail call float @llvm.fmuladd.f32(float %2, float %3, float 0x3FEFFB1C20000000)
ret float %4
}
int adis16209_initialize_ring(struct iio_ring_buffer *ring) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define i32 @adis16209_initialize_ring(%struct.iio_ring_buffer* nocapture readnone %0) {
ret i32 0
}
int __doRiverBet(struct hand *thishand) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.hand = type opaque
define i32 @__doRiverBet(%struct.hand* nocapture readnone %0) {
ret i32 0
}
int test_imm_E8int16_reg(short val) {
  return ((val) & (0xE8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E8int16_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, 232
%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_E8int16_reg(i16 signext %0) {
%2 = and i16 %0, 232
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char uu_decode_char8(char in) {
  char out;
  out = (in - ' ') & 0x3F;
  return out;
}


x86 assembly (clang, -O0):
<uu_decode_char8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
and    $0x3f,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uu_decode_char8>:
lea    0x20(%rdi),%eax
and    $0x3f,%al
ret

LLVM IR (-O0):
define signext i8 @uu_decode_char8(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 32
%7 = and i32 %6, 63
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @uu_decode_char8(i8 signext %0) {
%2 = add i8 %0, 32
%3 = and i8 %2, 63
ret i8 %3
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
scalar_t__ malloc(int);
char *timenow() {
  char *the_time, *index;
  struct timeval *tp;
  tp = ((struct timeval *)malloc(sizeof(struct timeval)));
  gettimeofday(tp, 0);
  the_time = ctime(&(tp->tv_sec));
  index = the_time;
  index += 24;
  *index = '\0';
  return (the_time);
}


x86 assembly (clang, -O0):
<timenow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    -0x18(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timenow>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
movb   $0x0,0x18(%rax)
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i8* @timenow() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca %struct.timeval*
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to %struct.timeval*
store %struct.timeval* %5, %struct.timeval** %3
%6 = load %struct.timeval*, %struct.timeval** %3
%7 = call i32 @gettimeofday(%struct.timeval* %6, i32 0)
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = call i8* @ctime(i32* %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
store i8* %11, i8** %2
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 24
store i8* %13, i8** %2
%14 = load i8*, i8** %2
store i8 0, i8* %14
%15 = load i8*, i8** %1
ret i8* %15
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i8* @timenow() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to %struct.timeval*
%3 = tail call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%5 = tail call i8* @ctime(i32* %4)
%6 = getelementptr inbounds i8, i8* %5, i64 24
store i8 0, i8* %6
ret i8* %5
}
const char *File_Name(void) { return "File"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"File\00"
define i8* @File_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"File\00"
define i8* @File_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
void init_waitqueue(struct wait_queue **q) {
  *q = ((struct wait_queue *)((q)-1));
}


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

x86 assembly (clang, -O2):
<init_waitqueue>:
lea    -0x8(%rdi),%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
%struct.wait_queue = type opaque
define void @init_waitqueue(%struct.wait_queue** %0) {
%2 = alloca %struct.wait_queue**
store %struct.wait_queue** %0, %struct.wait_queue*** %2
%3 = load %struct.wait_queue**, %struct.wait_queue*** %2
%4 = getelementptr inbounds %struct.wait_queue*, %struct.wait_queue** %3, i64 -1
%5 = bitcast %struct.wait_queue** %4 to %struct.wait_queue*
%6 = load %struct.wait_queue**, %struct.wait_queue*** %2
store %struct.wait_queue* %5, %struct.wait_queue** %6
ret void
}

LLVM IR (-O2):
%struct.wait_queue = type opaque
define void @init_waitqueue(%struct.wait_queue** %0) {
%2 = getelementptr inbounds %struct.wait_queue*, %struct.wait_queue** %0, i64 -1
%3 = bitcast %struct.wait_queue** %0 to %struct.wait_queue***
store %struct.wait_queue** %2, %struct.wait_queue*** %3
ret void
}
void kol_wnd_caption(char *s) {
  asm volatile("int $0x40" ::"a"(71), "b"(1), "c"(s));
}


x86 assembly (clang, -O0):
<kol_wnd_caption>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x47,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_wnd_caption>:
push   %rbx
mov    %rdi,%rcx
mov    $0x47,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kol_wnd_caption(i8* %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 71, i32 1, i8* %0)
ret void
}
void hal_bsp_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @hal_bsp_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ redAuton();
void blueAuton() { redAuton(); }


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

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

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

LLVM IR (-O2):
define void @blueAuton() {
%1 = tail call i32 (...) @redAuton()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int SyncLST(double newTime) {
  newTime = newTime;
  fprintf(stderr,
          "NexStar does not support remote setting of sidereal time.\n");
  return -1;
}


x86 assembly (clang, -O0):
<SyncLST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SyncLST>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"NexStar does not support remote setting of sidereal time.\0A\00"
define i32 @SyncLST(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
store double %3, double* %2
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"NexStar does not support remote setting of sidereal time.\0A\00"
define i32 @SyncLST(double %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
char *strcpy(char *s1, const char *s2) {
  char *ret = s1;
  while ((*s1++ = *s2++) != 0)
    ;
  return ret;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int gethostid();
int main(void) { return gethostid(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <gethostid@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gethostid()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gethostid()
ret i32 %1
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int getsockname(int, struct sockaddr *, int /*<<< orphan*/ *);
__attribute__((weak)) int __real_getsockname(int fd, struct sockaddr *name,
                                             socklen_t *namelen) {
  return getsockname(fd, name, namelen);
}


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

x86 assembly (clang, -O2):
<__real_getsockname>:
jmp    1030 <getsockname@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define weak i32 @__real_getsockname(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32*, i32** %6
%10 = call i32 @getsockname(i32 %7, %struct.sockaddr* %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define weak i32 @__real_getsockname(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = tail call i32 @getsockname(i32 %0, %struct.sockaddr* %1, i32* %2)
ret i32 %4
}
BOOST_AUTO_TEST_CASE(divide) {
  TESTCASE2(divide, 1, 2, 0.5);
  TESTCASE2(divide, -1, 2, -0.5);
  TESTCASE2(divide, 1, -2, -0.5);
  TESTCASE2(divide, -1, -2, 0.5);
}


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
mov    $0x2,%edx
movsd  0xed0(%rip),%xmm0
mov    $0x1,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0xffffffff,%esi
mov    $0x2,%edx
movsd  0xebc(%rip),%xmm0
mov    $0x1,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
mov    $0xfffffffe,%edx
movsd  0xea0(%rip),%xmm0
mov    $0x1,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0xffffffff,%esi
mov    $0xfffffffe,%edx
movsd  0xe7c(%rip),%xmm0
mov    $0x1,%al
call   1030 <TESTCASE2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
push   %rbx
mov    %edi,%ebx
movsd  0xee5(%rip),%xmm0
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x1,%al
call   1030 <TESTCASE2@plt>
movsd  0xed4(%rip),%xmm0
mov    %ebx,%edi
mov    $0xffffffff,%esi
mov    $0x2,%edx
mov    $0x1,%al
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0xfffffffe,%edx
movsd  0xead(%rip),%xmm0
mov    $0x1,%al
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0xffffffff,%esi
mov    $0xfffffffe,%edx
movsd  0xe8a(%rip),%xmm0
mov    $0x1,%al
pop    %rbx
jmp    1030 <TESTCASE2@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, double, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, double, ...)*)(i32 %4, i32 1, i32 2, double 5.000000e-01)
%6 = load i32, i32* %3
%7 = call i32 (i32, i32, i32, double, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, double, ...)*)(i32 %6, i32 -1, i32 2, double -5.000000e-01)
%8 = load i32, i32* %3
%9 = call i32 (i32, i32, i32, double, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, double, ...)*)(i32 %8, i32 1, i32 -2, double -5.000000e-01)
%10 = load i32, i32* %3
%11 = call i32 (i32, i32, i32, double, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, double, ...)*)(i32 %10, i32 -1, i32 -2, double 5.000000e-01)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, double, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, double, ...)*)(i32 %0, i32 1, i32 2, double 5.000000e-01)
%3 = tail call i32 (i32, i32, i32, double, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, double, ...)*)(i32 %0, i32 -1, i32 2, double -5.000000e-01)
%4 = tail call i32 (i32, i32, i32, double, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, double, ...)*)(i32 %0, i32 1, i32 -2, double -5.000000e-01)
%5 = tail call i32 (i32, i32, i32, double, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, double, ...)*)(i32 %0, i32 -1, i32 -2, double 5.000000e-01)
ret i32 undef
}
int compare_doubles(const void *a, const void *b) {
  const double x = *(const double *)a, y = *(const double *)b;
  if (x < y)
    return -1;
  if (x > y)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compare_doubles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <compare_doubles+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <compare_doubles+0x69>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1162 <compare_doubles+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <compare_doubles+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_doubles>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_doubles(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp olt double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fcmp ogt double %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare_doubles(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void GBA_SoundEnd(void) {}


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

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

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

LLVM IR (-O2):
define void @GBA_SoundEnd() {
ret void
}
void f4(int *x) {
  int i;
#pragma omp parallel for ordered
  for (i = 0; i < 100; i++)
#pragma omp ordered threads
    x[i / 2] = i;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    114f <f4+0x4f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <f4+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    $0x4,%eax
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x4(%rax),%ecx
mov    %ecx,%edx
shr    %edx
mov    %ecx,(%rdi,%rdx,4)
lea    -0x3(%rax),%ecx
mov    %ecx,%edx
shr    %edx
mov    %ecx,(%rdi,%rdx,4)
lea    -0x2(%rax),%ecx
mov    %ecx,%edx
shr    %edx
mov    %ecx,(%rdi,%rdx,4)
lea    -0x1(%rax),%ecx
mov    %ecx,%edx
shr    %edx
mov    %ecx,(%rdi,%rdx,4)
mov    %eax,%ecx
shr    %ecx
mov    %eax,(%rdi,%rcx,4)
lea    0x5(%rax),%ecx
cmp    $0x63,%eax
mov    %ecx,%eax
jne    1110 <f4+0x10>
ret

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

LLVM IR (-O2):
define void @f4(i32* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %23, %2 ]
%4 = lshr i32 %3, 1
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %3, i32* %6
%7 = add nuw nsw i32 %3, 1
%8 = lshr i32 %7, 1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %7, i32* %10
%11 = add nuw nsw i32 %3, 2
%12 = lshr i32 %11, 1
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
store i32 %11, i32* %14
%15 = add nuw nsw i32 %3, 3
%16 = lshr i32 %15, 1
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %0, i64 %17
store i32 %15, i32* %18
%19 = add nuw nsw i32 %3, 4
%20 = lshr i32 %19, 1
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %0, i64 %21
store i32 %19, i32* %22
%23 = add nuw nsw i32 %3, 5
%24 = icmp eq i32 %23, 100
br i1 %24, label %25, label %2
25: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
char *strdup(char const *);
void ksstring_replace(const char **dest, const char *replacement) {
  if (*dest != NULL) {
    free((void *)*dest);
  }
  if (replacement == NULL) {
    *dest = NULL;
  } else {
    *dest = strdup(replacement);
  }
}


x86 assembly (clang, -O0):
<ksstring_replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114a <ksstring_replace+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1165 <ksstring_replace+0x45>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
jmp    1178 <ksstring_replace+0x58>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ksstring_replace>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1137 <ksstring_replace+0x17>
call   1030 <free@plt>
test   %rbx,%rbx
je     1146 <ksstring_replace+0x26>
mov    %rbx,%rdi
call   1040 <strdup@plt>
jmp    1148 <ksstring_replace+0x28>
xor    %eax,%eax
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ksstring_replace(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** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %8, %2
%13 = load i8*, i8** %4
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = load i8**, i8*** %3
store i8* null, i8** %16
br label %21
17: ; preds = %12
%18 = load i8*, i8** %4
%19 = call i8* @strdup(i8* %18)
%20 = load i8**, i8*** %3
store i8* %19, i8** %20
br label %21
21: ; preds = %17, %15
ret void
}

LLVM IR (-O2):
define void @ksstring_replace(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(i8* %3)
br label %7
7: ; preds = %5, %2
%8 = icmp eq i8* %1, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i8* @strdup(i8* %1)
br label %11
11: ; preds = %7, %9
%12 = phi i8* [ %10, %9 ], [ null, %7 ]
store i8* %12, i8** %0
ret void
}
char to_mayus(char a) { return (a - ('a' - 'A')); }


x86 assembly (clang, -O0):
<to_mayus>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_mayus>:
lea    -0x20(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @to_mayus(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 32
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @to_mayus(i8 signext %0) {
%2 = add i8 %0, -32
ret i8 %2
}
/* Variables and functions */
char *get_variable(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int is_variable_equal(char *var, char *val) {
  char *v = get_variable(var);
  return v != NULL && !strcmp(v, val);
}


x86 assembly (clang, -O0):
<is_variable_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_variable@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1165 <is_variable_equal+0x45>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_variable_equal>:
push   %rbx
mov    %rsi,%rbx
call   1040 <get_variable@plt>
test   %rax,%rax
je     1144 <is_variable_equal+0x24>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_variable_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @get_variable(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = call i32 @strcmp(i8* %11, i8* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br label %16
16: ; preds = %10, %2
%17 = phi i1 [ false, %2 ], [ %15, %10 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_variable_equal(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @get_variable(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* %3, i8* dereferenceable(1) %1)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void write16(FILE *out, uint16_t p) {
  unsigned char q[2];
  q[0] = p & 0xFF;
  q[1] = (p >> 8) & 0xFF;
  fwrite(q, 1, 2, out);
  return;
}


x86 assembly (clang, -O0):
<write16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,-0xe(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0xd(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @write16(i32* nocapture %0, i32 %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = lshr i32 %1, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @fwrite(i8* %4, i32 1, i32 2, i32* %0)
ret void
}
void parse_many(void *arg, struct Source *src, struct Result *res) {}


x86 assembly (clang, -O0):
<parse_many>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Source = type opaque
%struct.Result = type opaque
define void @parse_many(i8* %0, %struct.Source* %1, %struct.Result* %2) {
%4 = alloca i8*
%5 = alloca %struct.Source*
%6 = alloca %struct.Result*
store i8* %0, i8** %4
store %struct.Source* %1, %struct.Source** %5
store %struct.Result* %2, %struct.Result** %6
ret void
}

LLVM IR (-O2):
%struct.Source = type opaque
%struct.Result = type opaque
define void @parse_many(i8* nocapture %0, %struct.Source* nocapture %1, %struct.Result* nocapture %2) {
ret void
}
/* Type definitions */
struct aioinit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
void aio_init(const struct aioinit *INIT) { errno = ENOSYS; }


x86 assembly (clang, -O0):
<aio_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<aio_init>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
%struct.aioinit = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define void @aio_init(%struct.aioinit* %0) {
%2 = alloca %struct.aioinit*
store %struct.aioinit* %0, %struct.aioinit** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret void
}

LLVM IR (-O2):
%struct.aioinit = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define void @aio_init(%struct.aioinit* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret void
}