xunge/DecIR huggingface dataset:
/* Variables and functions */
int tuner_i2c_read(void *, unsigned char, unsigned char, unsigned char *,
                   unsigned char);
int bbm_com_tuner_read(void *handle, unsigned char addr, unsigned char addr_len,
                       unsigned char *buffer, unsigned char len) {
  int res;
  res = tuner_i2c_read(handle, addr, addr_len, buffer, len);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_tuner_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %sil,-0x9(%rbp)
mov    %dl,-0xa(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%dl
mov    -0xa(%rbp),%al
mov    -0x18(%rbp),%rcx
movzbl %dl,%esi
movzbl %al,%edx
movzbl -0x19(%rbp),%r8d
call   1030 <tuner_i2c_read@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_tuner_read>:
jmp    1030 <tuner_i2c_read@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_tuner_read(i8* %0, i8 zeroext %1, i8 zeroext %2, i8* %3, i8 zeroext %4) {
%6 = tail call i32 @tuner_i2c_read(i8* %0, i8 zeroext %1, i8 zeroext %2, i8* %3, i8 zeroext %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ nbsum(unsigned int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main(void) {
  unsigned int n = 0;
  printf("n : ");
  scanf("%d", &n);
  nbsum(n);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"n : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 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 @nbsum(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"n : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 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 @nbsum(i32 %5)
ret i32 0
}
int skb_header_cloned(struct sk_buff *skb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.sk_buff = type opaque
define i32 @skb_header_cloned(%struct.sk_buff* nocapture readnone %0) {
ret i32 0
}
int __attribute__((no, noclone)) bar(int j, int i) {
  j = i;
  i = 2;
  if (j)
    j++;
  j += i + 1;
  return j;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112a <bar+0x2a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    0x4(%rsi),%ecx
test   %esi,%esi
mov    $0x3,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @bar(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
store i32 %5, i32* %3
store i32 2, i32* %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %11
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
%14 = load i32, i32* %3
%15 = add nsw i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = add i32 %1, 4
%5 = select i1 %3, i32 3, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __exit(int);
int __start(int, char **);
int _start(char *p) {
  int rc;
  rc = __start(*(int *)(&p - 1), &p);
  __exit(rc);
  return (rc);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x10(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <__start@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <__exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rsi
call   1040 <__start@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <__exit@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_start(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @__start(i32 undef, i8** %2)
%4 = call i32 @__exit(i32 %3)
ret i32 %3
}
/* Variables and functions */
int mbstrncasecmp(char const *, char const *, size_t);
int mbstrcasecmp(const char *s1, const char *s2) {
  return mbstrncasecmp(s1, s2, ((~(size_t)0) >> 1));
}


x86 assembly (clang, -O0):
<mbstrcasecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movabs $0x7fffffffffffffff,%rdx
ff ff 7f
call   1030 <mbstrncasecmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbstrcasecmp>:
movabs $0x7fffffffffffffff,%rdx
ff ff 7f
jmp    1030 <mbstrncasecmp@plt>

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

LLVM IR (-O2):
define i32 @mbstrcasecmp(i8* %0, i8* %1) {
%3 = tail call i32 @mbstrncasecmp(i8* %0, i8* %1, i64 9223372036854775807)
ret i32 %3
}
int test_imm_08int8_mem(signed char *val) {
  return ((*val) & (-0x08 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_08int8_mem>:
cmpb   $0x8,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_08int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -8
%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_08int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 8
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int dbar(double, double);
int sb(double, double);
int ubar(double, double);
int uv(double, double);
double F3_cc_nu_n(double xx, double Q2) {
  return 2 * (uv(xx, Q2) + sb(xx, Q2) + ubar(xx, Q2) - dbar(xx, Q2)) / xx;
}


x86 assembly (clang, -O0):
<F3_cc_nu_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <uv@plt>
mov    %eax,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <sb@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1050 <ubar@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1060 <dbar@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F3_cc_nu_n>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1040 <uv@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <sb@plt>
mov    %eax,%ebp
add    %ebx,%ebp
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1050 <ubar@plt>
mov    %eax,%ebx
add    %ebp,%ebx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1060 <dbar@plt>
sub    %eax,%ebx
add    %ebx,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
divsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @F3_cc_nu_n(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 @uv(double %5, double %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i32 @sb(double %8, double %9)
%11 = add nsw i32 %7, %10
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call i32 @ubar(double %12, double %13)
%15 = add nsw i32 %11, %14
%16 = load double, double* %3
%17 = load double, double* %4
%18 = call i32 @dbar(double %16, double %17)
%19 = sub nsw i32 %15, %18
%20 = mul nsw i32 2, %19
%21 = sitofp i32 %20 to double
%22 = load double, double* %3
%23 = fdiv double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @F3_cc_nu_n(double %0, double %1) {
%3 = tail call i32 @uv(double %0, double %1)
%4 = tail call i32 @sb(double %0, double %1)
%5 = add nsw i32 %4, %3
%6 = tail call i32 @ubar(double %0, double %1)
%7 = add nsw i32 %5, %6
%8 = tail call i32 @dbar(double %0, double %1)
%9 = sub i32 %7, %8
%10 = shl nsw i32 %9, 1
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, %0
ret double %12
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ read(int, int *, int);
uint8_t next(int fd) {
  uint8_t byte;
  read(fd, &byte, 1);
  printf("read 0x%x\n", byte);
  return byte;
}


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

x86 assembly (clang, -O2):
<next>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
mov    0xc(%rsp),%ebx
lea    0xec1(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"read 0x%x\0A\00"
define i32 @next(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @read(i32 %0, i32* %2, i32 1)
%5 = load i32, i32* %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 %5
}
/* Type definitions */
struct s_map {
  int dummy;
};

/* Variables and functions */
int mapGetPrefixID(struct s_map *, void const *, int const);
void *mapGetValueByID(struct s_map *, int);
void *mapGetN(struct s_map *map, const void *prefix, const int prefixlen) {
  int id;
  id = mapGetPrefixID(map, prefix, prefixlen);
  if (id < 0)
    return NULL;
  return mapGetValueByID(map, id);
}


x86 assembly (clang, -O0):
<mapGetN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <mapGetPrefixID@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    115d <mapGetN+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    116d <mapGetN+0x4d>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1040 <mapGetValueByID@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapGetN>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mapGetPrefixID@plt>
test   %eax,%eax
js     1138 <mapGetN+0x18>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <mapGetValueByID@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.s_map = type { i32 }
define i8* @mapGetN(%struct.s_map* %0, i8* %1, i32 %2) {
%4 = tail call i32 @mapGetPrefixID(%struct.s_map* %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i8* @mapGetValueByID(%struct.s_map* %0, i32 %4)
br label %8
8: ; preds = %3, %6
%9 = phi i8* [ %7, %6 ], [ null, %3 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int get_rssi(void *data) {
  uint32_t *rssi = (uint32_t *)data;
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @get_rssi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
ret i32 1
}

LLVM IR (-O2):
define i32 @get_rssi(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int calc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", calc(99));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x63,%edi
call   1040 <calc@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @calc(i32 99)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @calc(i32 99)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
float pos_fmax(float x, float y) {
  if (x > y)
    return x;
  else
    return y;
}


x86 assembly (clang, -O0):
<pos_fmax>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <pos_fmax+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <pos_fmax+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos_fmax>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @pos_fmax(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @pos_fmax(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
int execute_rt_sigsuspend() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_rt_sigsuspend() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ssd_dialog_hide(char *, int);
int /*<<< orphan*/ ssd_generic_list_dialog_hide();
int /*<<< orphan*/ ssd_menu_hide(char *);
void hide_our_dialogs(int exit_code) {
  ssd_generic_list_dialog_hide();
  ssd_menu_hide("Drive to");
  ssd_dialog_hide("Main Menu", exit_code);
}


x86 assembly (clang, -O0):
<hide_our_dialogs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ssd_generic_list_dialog_hide@plt>
lea    0xeb7(%rip),%rdi
call   1050 <ssd_menu_hide@plt>
mov    -0x4(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1040 <ssd_dialog_hide@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hide_our_dialogs>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <ssd_generic_list_dialog_hide@plt>
lea    0xebf(%rip),%rdi
call   1050 <ssd_menu_hide@plt>
lea    0xebc(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <ssd_dialog_hide@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Drive to\00"
@.str.1 = [10 x i8] c"Main Menu\00"
define void @hide_our_dialogs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @ssd_generic_list_dialog_hide()
%4 = call i32 @ssd_menu_hide(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @ssd_dialog_hide(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Drive to\00"
@.str.1 = [10 x i8] c"Main Menu\00"
define void @hide_our_dialogs(i32 %0) {
%2 = tail call i32 (...) @ssd_generic_list_dialog_hide()
%3 = tail call i32 @ssd_menu_hide(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @ssd_dialog_hide(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
char *strcpy(char *, char const *);
int strlen(char *);
char *strcat(char *dest, const char *src) {
  return strcpy(dest + strlen(dest), src);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @strcat(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** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i8* @strcpy(i8* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i8* @strcpy(i8* dereferenceable(1) %5, i8* dereferenceable(1) %1)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ sortSubArray(int *, int /*<<< orphan*/, int);
void mergeSort(int array[], int length) { sortSubArray(array, 0, length - 1); }


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

x86 assembly (clang, -O2):
<mergeSort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <sortSubArray@plt>

LLVM IR (-O0):
define void @mergeSort(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 = sub nsw i32 %6, 1
%8 = call i32 @sortSubArray(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @sortSubArray(i32* %0, i32 0, i32 %3)
ret void
}
float sign(float n) {
  if (n < 0)
    return -1;
  else if (n > 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1128 <sign+0x28>
movss  0xee6(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <sign+0x53>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    114b <sign+0x4b>
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <sign+0x53>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm0,%xmm2
movss  0xeed(%rip),%xmm3
andps  %xmm2,%xmm3
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm1
andnps %xmm3,%xmm1
movss  0xedb(%rip),%xmm2
andps  %xmm2,%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sign(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float -1.000000e+00, float* %2
br label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp ogt float %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store float 1.000000e+00, float* %2
br label %12
11: ; preds = %7
store float 0.000000e+00, float* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @sign(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp ogt float %0, 0.000000e+00
%4 = select i1 %3, float 1.000000e+00, float 0.000000e+00
%5 = select i1 %2, float -1.000000e+00, float %4
ret float %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int options;
};

/* Variables and functions */
TYPE_1__ _res;
bool res_use_inet6(void) { return _res.options & 0x00002000; }


x86 assembly (clang, -O0):
<res_use_inet6>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
and    $0x2000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<res_use_inet6>:
mov    0x2ee1(%rip),%rcx
mov    $0x2000,%eax
and    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
@_res = global %struct.TYPE_2__ zeroinitializer
define i32 @res_use_inet6() {
%1 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i32 0, i32 0)
%2 = and i32 %1, 8192
ret i32 %2
}

LLVM IR (-O2):
%struct.TYPE_2__ = type { i32 }
@_res = global %struct.TYPE_2__ zeroinitializer
define i32 @res_use_inet6() {
%1 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i64 0, i32 0)
%2 = and i32 %1, 8192
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
int main() {
  int i;
  for (i = 0; i < 2; ++i) {
    fork();
    printf("-");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1161 <main+0x41>
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <fork@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i32 (...) @fork()
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @putchar(i32 45)
%3 = tail call i32 (...) @fork()
%4 = tail call i32 @putchar(i32 45)
ret i32 0
}
void test78_HostCallThruProtoBug_pollen__run__E() {}


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

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

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

LLVM IR (-O2):
define void @test78_HostCallThruProtoBug_pollen__run__E() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_barrier_all(void) { printf("\nOpenSHMEM Analyzer\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_barrier_all() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
void free_cmatrix(char **m) {
  free(m[0]);
  free(m);
}


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

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

LLVM IR (-O0):
define void @free_cmatrix(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %2
%7 = bitcast i8** %6 to i8*
ret void
}

LLVM IR (-O2):
define void @free_cmatrix(i8** nocapture %0) {
%2 = load i8*, i8** %0
tail call void @free(i8* %2)
%3 = bitcast i8** %0 to i8*
tail call void @free(i8* %3)
ret void
}
long last_function_called_by_main(long var) { return var / 5; }


x86 assembly (clang, -O0):
<last_function_called_by_main>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x5,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_function_called_by_main>:
mov    %rdi,%rax
movabs $0x6666666666666667,%rcx
66 66 66
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    %rdx
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @last_function_called_by_main(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sdiv i64 %3, 5
ret i64 %4
}

LLVM IR (-O2):
define i64 @last_function_called_by_main(i64 %0) {
%2 = sdiv i64 %0, 5
ret i64 %2
}
int test_imm_F8uint16_mem(unsigned short *val) {
  return ((*val) & (-0xF8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F8uint16_mem>:
movzwl (%rdi),%eax
test   $0xff08,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F8uint16_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, -248
%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_F8uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -248
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ clearLCDLine(int);
void clearLCD() {
  clearLCDLine(0);
  clearLCDLine(1);
}


x86 assembly (clang, -O0):
<clearLCD>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <clearLCDLine@plt>
mov    $0x1,%edi
call   1030 <clearLCDLine@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearLCD>:
push   %rax
xor    %edi,%edi
call   1030 <clearLCDLine@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <clearLCDLine@plt>

LLVM IR (-O0):
define void @clearLCD() {
%1 = call i32 @clearLCDLine(i32 0)
%2 = call i32 @clearLCDLine(i32 1)
ret void
}

LLVM IR (-O2):
define void @clearLCD() {
%1 = tail call i32 @clearLCDLine(i32 0)
%2 = tail call i32 @clearLCDLine(i32 1)
ret void
}
void SPI_LEDS_DisableTxInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI_LEDS_DisableTxInt() {
ret void
}
int decode_e(unsigned e, unsigned s, unsigned n) {
  unsigned char E = ((e * n * 2 + 1) / s - 3) / 2;
  return ((E >= n - 3) ? -1 : E);
}


x86 assembly (clang, -O0):
<decode_e>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
xor    %edx,%edx
divl   -0x8(%rbp)
sub    $0x3,%eax
shr    $0x1,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jb     1147 <decode_e+0x47>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <decode_e+0x4e>
movzbl -0xd(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_e>:
mov    %edx,%ecx
imul   %edx,%edi
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
xor    %edx,%edx
div    %esi
add    $0x1fd,%eax
shr    %eax
movzbl %al,%edx
add    $0xfffffffd,%ecx
cmp    %ecx,%edx
mov    $0xffffffff,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @decode_e(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = mul i32 %8, %9
%11 = mul i32 %10, 2
%12 = add i32 %11, 1
%13 = load i32, i32* %5
%14 = udiv i32 %12, %13
%15 = sub i32 %14, 3
%16 = udiv i32 %15, 2
%17 = trunc i32 %16 to i8
store i8 %17, i8* %7
%18 = load i8, i8* %7
%19 = zext i8 %18 to i32
%20 = load i32, i32* %6
%21 = sub i32 %20, 3
%22 = icmp uge i32 %19, %21
br i1 %22, label %23, label %24
23: ; preds = %3
br label %27
24: ; preds = %3
%25 = load i8, i8* %7
%26 = zext i8 %25 to i32
br label %27
27: ; preds = %24, %23
%28 = phi i32 [ -1, %23 ], [ %26, %24 ]
ret i32 %28
}

LLVM IR (-O2):
define i32 @decode_e(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 1
%5 = mul i32 %4, %2
%6 = or i32 %5, 1
%7 = udiv i32 %6, %1
%8 = add i32 %7, 509
%9 = lshr i32 %8, 1
%10 = and i32 %9, 255
%11 = add i32 %2, -3
%12 = icmp ult i32 %10, %11
%13 = select i1 %12, i32 %10, i32 -1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void sense_init(void) { puts("No sensors on this platform"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"No sensors on this platform\00"
define void @sense_init() {
%1 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"No sensors on this platform\00"
define void @sense_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __getline(char **, size_t *, int /*<<< orphan*/ *);
ssize_t getline(char **lineptr, size_t *n, FILE *stream) {
  return __getline(lineptr, n, stream);
}


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

x86 assembly (clang, -O2):
<getline>:
jmp    1030 <__getline@plt>

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

LLVM IR (-O2):
define i32 @getline(i8** %0, i64* %1, i32* %2) {
%4 = tail call i32 @__getline(i8** %0, i64* %1, i32* %2)
ret i32 %4
}
int getMinimumBetweenInt(const int a, const int b) { return a > b ? b : a; }


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

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

LLVM IR (-O0):
define i32 @getMinimumBetweenInt(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* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @getMinimumBetweenInt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
scalar_t__ strverscmp(char const *, char *);
const char *asn1_check_version(const char *req_version) {
  if (!req_version || strverscmp(req_version, "2.9") <= 0)
    return "2.9";
  return NULL;
}


x86 assembly (clang, -O0):
<asn1_check_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1141 <asn1_check_version+0x31>
mov    -0x10(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <strverscmp@plt>
cmp    $0x0,%rax
jg     1151 <asn1_check_version+0x41>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <asn1_check_version+0x49>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_check_version>:
test   %rdi,%rdi
je     1133 <asn1_check_version+0x23>
push   %rbx
lea    0xee3(%rip),%rbx
mov    %rbx,%rsi
call   1030 <strverscmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
cmovle %rbx,%rax
pop    %rbx
ret
lea    0xec6(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"2.9\00"
define i8* @asn1_check_version(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i64 @strverscmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = icmp sle i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6, %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %6
store i8* null, i8** %2
br label %12
12: ; preds = %11, %10
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"2.9\00"
define i8* @asn1_check_version(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strverscmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp slt i64 %4, 1
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* null
br label %7
7: ; preds = %3, %1
%8 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %1 ], [ %6, %3 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char const *, int);
void Sys_Mkdir(const char *path) { mkdir(path, 0777); }


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

x86 assembly (clang, -O2):
<Sys_Mkdir>:
mov    $0x1ff,%esi
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define void @Sys_Mkdir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 511)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *dll_fopen(char const *, char const *);
FILE *__wrap_fopen(const char *path, const char *mode) {
  return dll_fopen(path, mode);
}


x86 assembly (clang, -O0):
<__wrap_fopen>:
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 <dll_fopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_fopen>:
jmp    1030 <dll_fopen@plt>

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

LLVM IR (-O2):
define i32* @__wrap_fopen(i8* %0, i8* %1) {
%3 = tail call i32* @dll_fopen(i8* %0, i8* %1)
ret i32* %3
}
int grim_reaper(int waitall) {
  int available = 0;
  return available;
}


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

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

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

LLVM IR (-O2):
define i32 @grim_reaper(i32 %0) {
ret i32 0
}
long min(long a, long b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1127 <min+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <min+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %4
store i64 %10, i64* %3
br label %13
11: ; preds = %2
%12 = load i64, i64* %5
store i64 %12, i64* %3
br label %13
13: ; preds = %11, %9
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Title(void) {
  printf("\n"
         "BLZ - (c) CUE 2011\n"
         "Bottom LZ coding for Nintendo GBA/DS\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"\0ABLZ - (c) CUE 2011\0ABottom LZ coding for Nintendo GBA/DS\0A\0A\00"
define void @Title() {
%1 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [58 x i8] c"\0ABLZ - (c) CUE 2011\0ABottom LZ coding for Nintendo GBA/DS\0A\00"
define void @Title() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
ret void
}
int _mknod() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @_mknod() {
ret i32 0
}
/* Type definitions */
struct timespec {
  unsigned long long tv_sec;
  unsigned long long tv_nsec;
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long long oscillator(unsigned long long freq) {
  struct timespec ts = {0, 0};
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ts.tv_sec * freq + ts.tv_nsec * freq / 1000000000;
}


x86 assembly (clang, -O0):
<oscillator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x20(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oscillator>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%rcx
imul   %rbx,%rcx
imul   0x8(%rsp),%rbx
shr    $0x9,%rbx
movabs $0x44b82fa09b5a53,%rdx
mov    %rbx,%rax
mul    %rdx
shr    $0xb,%rdx
add    %rdx,%rcx
mov    %rcx,%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64, i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i64 @oscillator(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
store i64 %0, i64* %2
%4 = bitcast %struct.timespec* %3 to i8*
%5 = load i32, i32* @CLOCK_MONOTONIC
%6 = call i32 @clock_gettime(i32 %5, %struct.timespec* %3)
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64, i64* %2
%10 = mul i64 %8, %9
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%12 = load i64, i64* %11
%13 = load i64, i64* %2
%14 = mul i64 %12, %13
%15 = udiv i64 %14, 1000000000
%16 = add i64 %10, %15
ret i64 %16
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64, i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i64 @oscillator(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %2)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = mul i64 %7, %0
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%10 = load i64, i64* %9
%11 = mul i64 %10, %0
%12 = udiv i64 %11, 1000000000
%13 = add i64 %12, %8
ret i64 %13
}
int TimeWarpInterface_GetDspVersion() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @TimeWarpInterface_GetDspVersion() {
ret i32 0
}
void dispatcherDefaultUnlock(struct Dispatcher *dispatcher, void *userData) {}


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

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

LLVM IR (-O0):
%struct.Dispatcher = type opaque
define void @dispatcherDefaultUnlock(%struct.Dispatcher* %0, i8* %1) {
%3 = alloca %struct.Dispatcher*
%4 = alloca i8*
store %struct.Dispatcher* %0, %struct.Dispatcher** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.Dispatcher = type opaque
define void @dispatcherDefaultUnlock(%struct.Dispatcher* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
#define SIGALRM 128
void signal_handler(int signum) {
  switch (signum) {
  case SIGALRM:;
    break;
  }
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
jne    111f <signal_handler+0x1f>
jmp    111a <signal_handler+0x1a>
jmp    111f <signal_handler+0x1f>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 128, label %4
]
4: ; preds = %1
br label %5
5: ; preds = %1, %4
ret void
}

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
ret void
}