xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_clear_dobldobl_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(337, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<syscon_clear_dobldobl_system>:
mov    $0x151,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @syscon_clear_dobldobl_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 337, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("in main.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 = [10 x i8] c"in main.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"in main.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct sip_msg {
  int dummy;
};

/* Variables and functions */
int ds_select_dst(struct sip_msg *, char *, char *);
int w_ds_select_dst(struct sip_msg *msg, char *set, char *alg) {
  if (msg == NULL)
    return -1;
  return ds_select_dst(msg, set, alg);
}


x86 assembly (clang, -O0):
<w_ds_select_dst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113b <w_ds_select_dst+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <w_ds_select_dst+0x3f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <ds_select_dst@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_ds_select_dst>:
test   %rdi,%rdi
je     111a <w_ds_select_dst+0xa>
jmp    1030 <ds_select_dst@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.sip_msg = type { i32 }
define i32 @w_ds_select_dst(%struct.sip_msg* %0, i8* %1, i8* %2) {
%4 = icmp eq %struct.sip_msg* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @ds_select_dst(%struct.sip_msg* %0, i8* %1, i8* %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ -1, %3 ]
ret i32 %8
}
int codepageConvert(int cp, const char *p) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @codepageConvert(i32 %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ die();
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  ptr = realloc(ptr, size);
  if (!ptr && size != 0) {
    die();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115e <xrealloc+0x3e>
cmpq   $0x0,-0x10(%rbp)
je     115e <xrealloc+0x3e>
mov    $0x0,%al
call   1040 <die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1140 <xrealloc+0x20>
test   %r14,%r14
jne    1140 <xrealloc+0x20>
xor    %eax,%eax
call   1040 <die@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @die()
br label %9
9: ; preds = %7, %2
ret i8* %3
}
void log_init(const char *unused__varname __attribute__((__unused__))) {}


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

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

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

LLVM IR (-O2):
define void @log_init(i8* nocapture %0) {
ret void
}
short int fw_(short int *const w) { return (*w); }


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

x86 assembly (clang, -O2):
<fw_>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define signext i16 @fw_(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @fw_(i16* nocapture %0) {
%2 = load i16, i16* %0
ret i16 %2
}
/* Variables and functions */
int *return_self(int *);
int /*<<< orphan*/ test_assert(int);
int main() {
  int a = 1, *q;
  q = return_self(&a);
  *q = 2;
  test_assert(a == 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <return_self@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <return_self@plt>
movl   $0x2,(%rax)
xor    %edi,%edi
cmpl   $0x2,0x4(%rsp)
sete   %dil
call   1040 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 1, i32* %2
%4 = call i32* @return_self(i32* %2)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
store i32 2, i32* %5
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
%9 = call i32 @test_assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32* @return_self(i32* %1)
store i32 2, i32* %3
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
%7 = call i32 @test_assert(i32 %6)
ret i32 0
}
int lisp_test2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lisp_test2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ toh(int);
int main() {
  int n;
  printf("Enter the number of discs : ");
  scanf("%d", &n);
  toh(n);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <toh@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Enter the number of discs : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @toh(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Enter the number of discs : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @toh(i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ unknown_function();
void recover_integer_underflow_Good_FP() {
  for (unsigned int i = 0; i < 10; i++) {
    if (unknown_function()) {
      i--;
    }
  }
}


x86 assembly (clang, -O0):
<recover_integer_underflow_Good_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jae    1156 <recover_integer_underflow_Good_FP+0x46>
mov    $0x0,%al
call   1030 <unknown_function@plt>
cmp    $0x0,%rax
je     1143 <recover_integer_underflow_Good_FP+0x33>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <recover_integer_underflow_Good_FP+0x38>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <recover_integer_underflow_Good_FP+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recover_integer_underflow_Good_FP>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <unknown_function@plt>
cmp    $0x1,%rax
adc    $0xffffffff,%ebx
add    $0x1,%ebx
cmp    $0xa,%ebx
jb     1120 <recover_integer_underflow_Good_FP+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @recover_integer_underflow_Good_FP() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* %1
%4 = icmp ult i32 %3, 10
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = call i64 (...) @unknown_function()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add i32 %9, -1
store i32 %10, i32* %1
br label %11
11: ; preds = %8, %5
br label %12
12: ; preds = %11
%13 = load i32, i32* %1
%14 = add i32 %13, 1
store i32 %14, i32* %1
br label %2
15: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @recover_integer_underflow_Good_FP() {
br label %2
1: ; preds = %2
ret void
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %8, %2 ]
%4 = tail call i64 (...) @unknown_function()
%5 = icmp ne i64 %4, 0
%6 = sext i1 %5 to i32
%7 = add nuw nsw i32 %3, 1
%8 = add nsw i32 %7, %6
%9 = icmp ult i32 %8, 10
br i1 %9, label %2, label %1
}
char *langRomTypePhilipsFdc() { return "Philips Disk Controller"; }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Philips Disk Controller\00"
define i8* @langRomTypePhilipsFdc() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [24 x i8] c"Philips Disk Controller\00"
define i8* @langRomTypePhilipsFdc() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct rq_side_rates {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rq_side_rates *);
int /*<<< orphan*/ rq_side_rates_clear(struct rq_side_rates *);
void rq_side_rates_free(struct rq_side_rates *p) {
  rq_side_rates_clear(p);
  free(p);
}


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

x86 assembly (clang, -O2):
<rq_side_rates_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rq_side_rates_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.rq_side_rates = type { i32 }
define void @rq_side_rates_free(%struct.rq_side_rates* %0) {
%2 = alloca %struct.rq_side_rates*
store %struct.rq_side_rates* %0, %struct.rq_side_rates** %2
%3 = load %struct.rq_side_rates*, %struct.rq_side_rates** %2
%4 = call i32 @rq_side_rates_clear(%struct.rq_side_rates* %3)
%5 = load %struct.rq_side_rates*, %struct.rq_side_rates** %2
%6 = call i32 @free(%struct.rq_side_rates* %5)
ret void
}

LLVM IR (-O2):
%struct.rq_side_rates = type { i32 }
define void @rq_side_rates_free(%struct.rq_side_rates* %0) {
%2 = tail call i32 @rq_side_rates_clear(%struct.rq_side_rates* %0)
%3 = tail call i32 @free(%struct.rq_side_rates* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int acct(const char *name) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<acct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acct>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @acct(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
char *cdio_get_default_device_linux(void) { return ((void *)0); }


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

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

LLVM IR (-O0):
define i8* @cdio_get_default_device_linux() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @cdio_get_default_device_linux() {
ret i8* null
}
/* Variables and functions */
int _f(int, int /*<<< orphan*/, double const, double const *);
double _J_12(const double omega, const double vertices_omegas[4]) {
  return _f(2, 0, omega, vertices_omegas) / 4;
}


x86 assembly (clang, -O0):
<_J_12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdx
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <_f@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_J_12>:
push   %rax
mov    %rdi,%rdx
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <_f@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @_J_12(double %0, double* %1) {
%3 = tail call i32 @_f(i32 2, i32 0, double %0, double* %1)
%4 = sdiv i32 %3, 4
%5 = sitofp i32 %4 to double
ret double %5
}
/* Type definitions */
struct RawData {
  int dummy;
};
struct RadarParm {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int RawRead(int /*<<< orphan*/, struct RadarParm *, struct RawData *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int RawFread(FILE *fp, struct RadarParm *prm, struct RawData *raw) {
  return RawRead(fileno(fp), prm, raw);
}


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

x86 assembly (clang, -O2):
<RawFread>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <fileno@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <RawRead@plt>

LLVM IR (-O0):
%struct.RadarParm = type { i32 }
%struct.RawData = type { i32 }
define i32 @RawFread(i32* %0, %struct.RadarParm* %1, %struct.RawData* %2) {
%4 = alloca i32*
%5 = alloca %struct.RadarParm*
%6 = alloca %struct.RawData*
store i32* %0, i32** %4
store %struct.RadarParm* %1, %struct.RadarParm** %5
store %struct.RawData* %2, %struct.RawData** %6
%7 = load i32*, i32** %4
%8 = call i32 @fileno(i32* %7)
%9 = load %struct.RadarParm*, %struct.RadarParm** %5
%10 = load %struct.RawData*, %struct.RawData** %6
%11 = call i32 @RawRead(i32 %8, %struct.RadarParm* %9, %struct.RawData* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.RadarParm = type { i32 }
%struct.RawData = type { i32 }
define i32 @RawFread(i32* nocapture %0, %struct.RadarParm* %1, %struct.RawData* %2) {
%4 = tail call i32 @fileno(i32* %0)
%5 = tail call i32 @RawRead(i32 %4, %struct.RadarParm* %1, %struct.RawData* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *my_malloc(size_t size) {
  void *ret;
  if ((ret = malloc(size)) == NULL) {
    fprintf(stderr, "Error:  Unable to malloc memory.  Aborting.\n");
    exit(1);
  }
  return (ret);
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1172 <my_malloc+0x42>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <my_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Error: Unable to malloc memory. Aborting.\0A\00"
define i8* @my_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Error: Unable to malloc memory. Aborting.\0A\00"
define noalias i8* @my_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
int R_ColormapNumForName(const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @R_ColormapNumForName(i8* nocapture readnone %0) {
ret i32 0
}
int isin(const char c, const char *set) {
  int i = -1;
  while (set[++i] != '\0')
    if (c == set[i])
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isin>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115b <isin+0x5b>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1156 <isin+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1162 <isin+0x62>
jmp    1115 <isin+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isin>:
movzbl (%rsi),%eax
test   %al,%al
je     1116 <isin+0x16>
add    $0x1,%rsi
cmp    %dil,%al
jne    1100 <isin>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isin(i8 signext %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
store i8 %0, i8* %4
store i8* %1, i8** %5
store i32 -1, i32* %6
br label %7
7: ; preds = %27, %2
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 1
store i32 %10, i32* %6
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %28
16: ; preds = %7
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = load i8*, i8** %5
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %18, %24
br i1 %25, label %26, label %27
26: ; preds = %16
store i32 1, i32* %3
br label %29
27: ; preds = %16
br label %7
28: ; preds = %7
store i32 0, i32* %3
br label %29
29: ; preds = %28, %26
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @isin(i8 signext %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i64 [ %5, %9 ], [ -1, %2 ]
%5 = add nsw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = icmp eq i8 %7, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %9
%12 = phi i32 [ 1, %9 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  for (int i = 0; i < argc; i++) {
    printf("%s\n", argv[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
void RTSymlinkCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSymlinkCreate() {
ret void
}
/* Type definitions */
struct dirent64 {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
struct dirent64 *readdir64(int /*<<< orphan*/ *);
int __readdir64_r(DIR *dirp, struct dirent64 *entry, struct dirent64 **result) {
  entry = readdir64(dirp);
  *result = entry;
  if (entry == NULL || result == NULL)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<__readdir64_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <readdir64@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1152 <__readdir64_r+0x42>
cmpq   $0x0,-0x20(%rbp)
jne    115e <__readdir64_r+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <__readdir64_r+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__readdir64_r>:
push   %rbx
mov    %rdx,%rbx
call   1030 <readdir64@plt>
mov    %rax,(%rbx)
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.dirent64 = type { i32 }
define i32 @__readdir64_r(i32* %0, %struct.dirent64* %1, %struct.dirent64** %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.dirent64*
%7 = alloca %struct.dirent64**
store i32* %0, i32** %5
store %struct.dirent64* %1, %struct.dirent64** %6
store %struct.dirent64** %2, %struct.dirent64*** %7
%8 = load i32*, i32** %5
%9 = call %struct.dirent64* @readdir64(i32* %8)
store %struct.dirent64* %9, %struct.dirent64** %6
%10 = load %struct.dirent64*, %struct.dirent64** %6
%11 = load %struct.dirent64**, %struct.dirent64*** %7
store %struct.dirent64* %10, %struct.dirent64** %11
%12 = load %struct.dirent64*, %struct.dirent64** %6
%13 = icmp eq %struct.dirent64* %12, null
br i1 %13, label %17, label %14
14: ; preds = %3
%15 = load %struct.dirent64**, %struct.dirent64*** %7
%16 = icmp eq %struct.dirent64** %15, null
br i1 %16, label %17, label %18
17: ; preds = %14, %3
store i32 -1, i32* %4
br label %19
18: ; preds = %14
store i32 0, i32* %4
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.dirent64 = type { i32 }
define i32 @__readdir64_r(i32* %0, %struct.dirent64* nocapture readnone %1, %struct.dirent64** nocapture writeonly %2) {
%4 = tail call %struct.dirent64* @readdir64(i32* %0)
store %struct.dirent64* %4, %struct.dirent64** %2
%5 = icmp eq %struct.dirent64* %4, null
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int istrailingjunk(const char *arg, char *end) {
  if (*end != '\0') {
    fprintf(stderr, "%s: is followed by junk\n", arg);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<istrailingjunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <istrailingjunk+0x45>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <istrailingjunk+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<istrailingjunk>:
push   %rax
cmpb   $0x0,(%rsi)
je     1135 <istrailingjunk+0x25>
mov    %rdi,%rdx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"%s: is followed by junk\0A\00"
define i32 @istrailingjunk(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"%s: is followed by junk\0A\00"
define i32 @istrailingjunk(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %9
}
int f0() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f0() {
ret i32 0
}
int test_imm_C5uint16_mem(unsigned short *val) {
  return ((*val) & (0xC5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C5uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 197
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void addspace(int *finalresult) {
  int mod;
  mod = (*finalresult - 10) % 64;
  *finalresult = ((int)' ') + (mod);
}


x86 assembly (clang, -O0):
<addspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sub    $0xa,%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x20,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addspace>:
mov    (%rdi),%eax
lea    -0xa(%rax),%ecx
lea    0x35(%rax),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xffffffc0,%edx
neg    %edx
add    %edx,%eax
add    $0x16,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @addspace(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = sub nsw i32 %5, 10
%7 = srem i32 %6, 64
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 32, %8
%10 = load i32*, i32** %2
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @addspace(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, -10
%4 = srem i32 %3, 64
%5 = add nsw i32 %4, 32
store i32 %5, i32* %0
ret void
}
R0AX1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if (r0 <= (((unsigned char *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<R0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movzbl -0x5(%rbp),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jg     1143 <R0AX1+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <R0AX1+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<R0AX1>:
movzbl %dil,%edx
movslq %ecx,%rax
movzbl 0xa98ac7(%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%edx
setbe  %al
ret

LLVM IR (-O0):
define i32 @R0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = load i32, i32* %11
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* inttoptr (i64 11111111 to i8*), i64 %19
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = icmp sle i32 %17, %22
br i1 %23, label %24, label %25
24: ; preds = %6
store i32 1, i32* %7
br label %26
25: ; preds = %6
store i32 0, i32* %7
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @R0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = and i32 %0, 255
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* inttoptr (i64 11111111 to i8*), i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = icmp ule i32 %7, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
void ff_hevc_put_hevc_uni_w_qpel_v8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_v8_8_sse4() {
ret void
}
/* Variables and functions */
int read_int(char *, char const *);
int read_max_backlight(const char *driver) {
  return read_int("max_brightness", driver);
}


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

x86 assembly (clang, -O2):
<read_max_backlight>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <read_int@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"max_brightness\00"
define i32 @read_max_backlight(i8* %0) {
%2 = tail call i32 @read_int(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void bytes_w32net(uint8_t *data, uint32_t v) {
  data[3] = v;
  data[2] = v >> 8;
  data[1] = v >> 16;
  data[0] = v >> 24;
}


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

x86 assembly (clang, -O2):
<bytes_w32net>:
mov    %esi,0xc(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x8(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x4(%rdi)
sar    $0x18,%esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @bytes_w32net(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %1, i32* %3
%4 = ashr i32 %1, 8
%5 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %4, i32* %5
%6 = ashr i32 %1, 16
%7 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %6, i32* %7
%8 = ashr i32 %1, 24
store i32 %8, i32* %0
ret void
}
/* Variables and functions */
int write_char(int, char);
int write_char_c(int sock, char c) { return (write_char(sock, c)); }


x86 assembly (clang, -O0):
<write_char_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
movsbl -0x5(%rbp),%esi
call   1030 <write_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_char_c>:
jmp    1030 <write_char@plt>

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

LLVM IR (-O2):
define i32 @write_char_c(i32 %0, i8 signext %1) {
%3 = tail call i32 @write_char(i32 %0, i8 signext %1)
ret i32 %3
}
int do_948() { return 948; }


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

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

LLVM IR (-O0):
define i32 @do_948() {
ret i32 948
}

LLVM IR (-O2):
define i32 @do_948() {
ret i32 948
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, double);
void om_text_print_dblkey_info(FILE *fp, char *key, double val) {
  fprintf(fp, "* %s: %f\n", key, val);
}


x86 assembly (clang, -O0):
<om_text_print_dblkey_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
movsd  -0x18(%rbp),%xmm0
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_text_print_dblkey_info>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"* %s: %f\0A\00"
define void @om_text_print_dblkey_info(i32* nocapture %0, i8* %1, double %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, double %2)
ret void
}
/* Type definitions */
struct S_MATRIX {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destructor_matrix1_default(void *);
void destructor_matrix1_default_const(struct S_MATRIX const *const A) {
  destructor_matrix1_default((void *)A);
}


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

x86 assembly (clang, -O2):
<destructor_matrix1_default_const>:
jmp    1030 <destructor_matrix1_default@plt>

LLVM IR (-O0):
%struct.S_MATRIX = type { i32 }
define void @destructor_matrix1_default_const(%struct.S_MATRIX* %0) {
%2 = alloca %struct.S_MATRIX*
store %struct.S_MATRIX* %0, %struct.S_MATRIX** %2
%3 = load %struct.S_MATRIX*, %struct.S_MATRIX** %2
%4 = bitcast %struct.S_MATRIX* %3 to i8*
%5 = call i32 @destructor_matrix1_default(i8* %4)
ret void
}

LLVM IR (-O2):
%struct.S_MATRIX = type { i32 }
define void @destructor_matrix1_default_const(%struct.S_MATRIX* %0) {
%2 = bitcast %struct.S_MATRIX* %0 to i8*
%3 = tail call i32 @destructor_matrix1_default(i8* %2)
ret void
}
int read_data_bmp() {}


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

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

LLVM IR (-O0):
define i32 @read_data_bmp() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @read_data_bmp() {
ret i32 undef
}
int aim_imax(int a, int b) { return a > b ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @aim_imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
double pop();
int /*<<< orphan*/ push(double);
double peek() {
  double d;
  push(d = pop());
  return d;
}


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

x86 assembly (clang, -O2):
<peek>:
push   %rax
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,(%rsp)
call   1040 <push@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @peek() {
%1 = alloca double
%2 = call double (...) @pop()
store double %2, double* %1
%3 = call i32 @push(double %2)
%4 = load double, double* %1
ret double %4
}

LLVM IR (-O2):
define double @peek() {
%1 = tail call double (...) @pop()
%2 = tail call i32 @push(double %1)
ret double %1
}
/* Variables and functions */
unsigned long CANIntNumberGet(unsigned long, unsigned char);
int /*<<< orphan*/ IntEnable(unsigned long);
int /*<<< orphan*/ IntRegister(unsigned long, void (*)());
void CANIntRegister(unsigned long ulBase, unsigned char ucIntNumber,
                    void (*pfnHandler)(void)) {
  unsigned long ulIntNumber;
  ;
  ulIntNumber = CANIntNumberGet(ulBase, ucIntNumber);
  IntRegister(ulIntNumber, pfnHandler);
  IntEnable(ulIntNumber);
}


x86 assembly (clang, -O0):
<CANIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%esi
call   1050 <CANIntNumberGet@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0x20(%rbp),%rdi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANIntRegister>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
call   1050 <CANIntNumberGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <IntRegister@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @CANIntRegister(i64 %0, i8 zeroext %1, void ()* %2) {
%4 = alloca i64
%5 = alloca i8
%6 = alloca void ()*
%7 = alloca i64
store i64 %0, i64* %4
store i8 %1, i8* %5
store void ()* %2, void ()** %6
%8 = load i64, i64* %4
%9 = load i8, i8* %5
%10 = call i64 @CANIntNumberGet(i64 %8, i8 zeroext %9)
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = load void ()*, void ()** %6
%13 = bitcast void ()* %12 to void (...)*
%14 = call i32 @IntRegister(i64 %11, void (...)* %13)
%15 = load i64, i64* %7
%16 = call i32 @IntEnable(i64 %15)
ret void
}

LLVM IR (-O2):
define void @CANIntRegister(i64 %0, i8 zeroext %1, void ()* %2) {
%4 = tail call i64 @CANIntNumberGet(i64 %0, i8 zeroext %1)
%5 = bitcast void ()* %2 to void (...)*
%6 = tail call i32 @IntRegister(i64 %4, void (...)* %5)
%7 = tail call i32 @IntEnable(i64 %4)
ret void
}
unsigned int next_uid(void) {
  static unsigned int uid = 0;
  uid++;
  if (uid == 0)
    uid++;
  return uid;
}


x86 assembly (clang, -O0):
<next_uid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
cmpl   $0x0,0x2f0a(%rip)
jne    112f <next_uid+0x2f>
mov    0x2efe(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef5(%rip)
mov    0x2eef(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_uid>:
mov    0x2f1e(%rip),%ecx
inc    %ecx
mov    $0x1,%eax
cmovne %ecx,%eax
mov    %eax,0x2f0e(%rip)
ret

LLVM IR (-O0):
@next_uid.uid = internal global i32 0
define i32 @next_uid() {
%1 = load i32, i32* @next_uid.uid
%2 = add i32 %1, 1
store i32 %2, i32* @next_uid.uid
%3 = load i32, i32* @next_uid.uid
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* @next_uid.uid
%7 = add i32 %6, 1
store i32 %7, i32* @next_uid.uid
br label %8
8: ; preds = %5, %0
%9 = load i32, i32* @next_uid.uid
ret i32 %9
}

LLVM IR (-O2):
@next_uid.uid = internal unnamed_addr global i32 0
define i32 @next_uid() {
%1 = load i32, i32* @next_uid.uid
%2 = add i32 %1, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 1, i32 %2
store i32 %4, i32* @next_uid.uid
ret i32 %4
}