xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ f();
int main(int ac, char **av) {
  f();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @f()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @f()
ret i32 0
}
__attribute__((always_)) int clamp1023_signed(int x) {
  if (x < -1023)
    return -1023;
  if (x > 1023)
    return 1023;
  return x;
}


x86 assembly (clang, -O0):
<clamp1023_signed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xfffffc01,-0x8(%rbp)
jge    1120 <clamp1023_signed+0x20>
movl   $0xfffffc01,-0x4(%rbp)
jmp    113f <clamp1023_signed+0x3f>
cmpl   $0x3ff,-0x8(%rbp)
jle    1139 <clamp1023_signed+0x39>
movl   $0x3ff,-0x4(%rbp)
jmp    113f <clamp1023_signed+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp1023_signed>:
cmp    $0x3ff,%edi
mov    $0x3ff,%ecx
cmovl  %edi,%ecx
cmp    $0xfffffc02,%ecx
mov    $0xfffffc01,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp1023_signed(i32 %0) {
%2 = icmp slt i32 %0, 1023
%3 = select i1 %2, i32 %0, i32 1023
%4 = icmp sgt i32 %3, -1023
%5 = select i1 %4, i32 %3, i32 -1023
ret i32 %5
}
int fun776() { return 776; }


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

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

LLVM IR (-O0):
define i32 @fun776() {
ret i32 776
}

LLVM IR (-O2):
define i32 @fun776() {
ret i32 776
}
int f(double aaa, double bbb) {
  int xa = __builtin_isunordered(aaa, aaa);
  int xb = __builtin_isunordered(bbb, bbb);
  return xa | xb;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fcmp uno double %7, %8
%10 = zext i1 %9 to i32
store i32 %10, i32* %5
%11 = load double, double* %4
%12 = load double, double* %4
%13 = fcmp uno double %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = or i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @f(double %0, double %1) {
%3 = fcmp uno double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
size_t base64_decode_len(char const *, size_t);
int /*<<< orphan*/ *calloc(size_t, int);
size_t base64_decode_allocate(const char *data, size_t len, uint8_t **buff) {
  size_t decode_len = base64_decode_len(data, len);
  *buff = calloc(decode_len + 1, 1);
  return decode_len;
}


x86 assembly (clang, -O0):
<base64_decode_allocate>:
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
call   1030 <base64_decode_len@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decode_allocate>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
call   1030 <base64_decode_len@plt>
mov    %rax,%rbx
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @base64_decode_allocate(i8* %0, i64 %1, i32** %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32**
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32** %2, i32*** %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = call i64 @base64_decode_len(i8* %8, i64 %9)
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = add i64 %11, 1
%13 = call i32* @calloc(i64 %12, i32 1)
%14 = load i32**, i32*** %6
store i32* %13, i32** %14
%15 = load i64, i64* %7
ret i64 %15
}

LLVM IR (-O2):
define i64 @base64_decode_allocate(i8* %0, i64 %1, i32** nocapture writeonly %2) {
%4 = tail call i64 @base64_decode_len(i8* %0, i64 %1)
%5 = add i64 %4, 1
%6 = tail call i32* @calloc(i64 %5, i32 1)
store i32* %6, i32** %2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(char *);
int main() {
  char a[2] = {2, 3};
  a[1] *= a[0];
  print("a  ");
  printid(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%ax
mov    %ax,-0x6(%rbp)
movsbl -0x6(%rbp),%ecx
movsbl -0x5(%rbp),%eax
imul   %ecx,%eax
mov    %al,-0x5(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <print@plt>
lea    -0x6(%rbp),%rdi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x602,0x6(%rsp)
lea    0xed1(%rip),%rdi
call   1030 <print@plt>
lea    0x6(%rsp),%rdi
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [2 x i8] c"\02\03"
@.str = [6 x i8] c"a \02\06 \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8]
store i32 0, i32* %1
%3 = bitcast [2 x i8]* %2 to i8*
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = mul nsw i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
%12 = call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%14 = call i32 @printid(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"a \02\06 \00"
define i32 @main() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
store i16 1538, i16* %1
%3 = tail call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printid(i8* %2)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XCirculateEvent;

/* Variables and functions */
void set_XCirculateEvent_send_event(void *_p, int _v) {
  ((XCirculateEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XCirculateEvent_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XCirculateEvent_send_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XCirculateEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int usage(char *n) {
  printf("%s [1,2]\n", n);
  return 1;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s [1,2]\0A\00"
define i32 @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
void _stm_mcbdiag_init() {}


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

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

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

LLVM IR (-O2):
define void @_stm_mcbdiag_init() {
ret void
}
/* Variables and functions */
char *utilStrLTrimChar(char *, char *);
char *utilStrLTrim(char *sStr) { return utilStrLTrimChar(sStr, " \t\r\n"); }


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

x86 assembly (clang, -O2):
<utilStrLTrim>:
lea    0xee9(%rip),%rsi
jmp    1030 <utilStrLTrimChar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" \09\0D\0A\00"
define i8* @utilStrLTrim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @utilStrLTrimChar(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0D\0A\00"
define i8* @utilStrLTrim(i8* %0) {
%2 = tail call i8* @utilStrLTrimChar(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpgt_pi8(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cvtpi16_ps(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_setzero_si64();
int /*<<< orphan*/ _mm_unpacklo_pi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 __attribute__((__always___, __nodebug__)) _mm_cvtpi8_ps(__m64 a) {
  __m64 b;
  b = _mm_setzero_si64();
  b = _mm_cmpgt_pi8(b, a);
  b = _mm_unpacklo_pi8(a, b);
  return _mm_cvtpi16_ps(b);
}


x86 assembly (clang, -O0):
<_mm_cvtpi8_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <_mm_setzero_si64@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <_mm_cmpgt_pi8@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_unpacklo_pi8@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <_mm_cvtpi16_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_cvtpi8_ps>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <_mm_setzero_si64@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <_mm_cmpgt_pi8@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <_mm_unpacklo_pi8@plt>
mov    %eax,%edi
pop    %rbx
jmp    1060 <_mm_cvtpi16_ps@plt>

LLVM IR (-O0):
define i32 @_mm_cvtpi8_ps(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @_mm_setzero_si64()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @_mm_cmpgt_pi8(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @_mm_unpacklo_pi8(i32 %8, i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @_mm_cvtpi16_ps(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @_mm_cvtpi8_ps(i32 %0) {
%2 = tail call i32 (...) @_mm_setzero_si64()
%3 = tail call i32 @_mm_cmpgt_pi8(i32 %2, i32 %0)
%4 = tail call i32 @_mm_unpacklo_pi8(i32 %0, i32 %3)
%5 = tail call i32 @_mm_cvtpi16_ps(i32 %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
char *next_char(char const *);
int /*<<< orphan*/ push_char(int /*<<< orphan*/, char const);
uint64_t pack_key(const char *key, int len) {
  uint64_t code = 0;
  for (int i = 0; i < len; i++) {
    code = push_char(code, *key);
    key = next_char(key);
  }
  return code;
}


x86 assembly (clang, -O0):
<pack_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1176 <pack_key+0x56>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rax
movsbl (%rax),%esi
call   1040 <push_char@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <next_char@plt>
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <pack_key+0x1d>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_key>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1151 <pack_key+0x31>
mov    %esi,%ebx
mov    %rdi,%rbp
xor    %r14d,%r14d
movsbl 0x0(%rbp),%esi
mov    %r14d,%edi
call   1040 <push_char@plt>
mov    %eax,%r14d
mov    %rbp,%rdi
call   1030 <next_char@plt>
mov    %rax,%rbp
add    $0xffffffff,%ebx
jne    1130 <pack_key+0x10>
jmp    1154 <pack_key+0x34>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pack_key(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %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 i32, i32* %5
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = call i32 @push_char(i32 %12, i8 signext %14)
store i32 %15, i32* %5
%16 = load i8*, i8** %3
%17 = call i8* @next_char(i8* %16)
store i8* %17, i8** %3
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* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @pack_key(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %6, %2
%5 = phi i32 [ 0, %2 ], [ %11, %6 ]
ret i32 %5
6: ; preds = %2, %6
%7 = phi i32 [ %13, %6 ], [ 0, %2 ]
%8 = phi i32 [ %11, %6 ], [ 0, %2 ]
%9 = phi i8* [ %12, %6 ], [ %0, %2 ]
%10 = load i8, i8* %9
%11 = tail call i32 @push_char(i32 %8, i8 signext %10)
%12 = tail call i8* @next_char(i8* %9)
%13 = add nuw nsw i32 %7, 1
%14 = icmp eq i32 %13, %1
br i1 %14, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void next_print(int *p) {
  int len = p[0];
  int i;
  for (i = 1; i <= len; i++) {
    printf("%d--->%4d\n", i, p[i]);
  }
}


x86 assembly (clang, -O0):
<next_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1160 <next_print+0x50>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112c <next_print+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%r12d
test   %r12d,%r12d
jle    1157 <next_print+0x47>
mov    %rdi,%r14
add    $0x1,%r12
mov    $0x1,%ebx
lea    0xecd(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <next_print+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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


x86 assembly (clang, -O0):
<str_iter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1137 <str_iter+0x37>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
jmp    1110 <str_iter+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_iter>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     112f <str_iter+0x2f>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <str_iter+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @str_iter(i8* %0, void (i8*)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %7, %5 ], [ %0, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
tail call void %1(i8* %7)
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void stop(char *mes) {
  fprintf(stderr, "%s\n", mes);
  exit(-1);
}


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<stop>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @stop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @stop(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
char serd_to_upper(const char c) {
  return (char)((c >= 'a' && c <= 'z') ? c - 32 : c);
}


x86 assembly (clang, -O0):
<serd_to_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1133 <serd_to_upper+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     1133 <serd_to_upper+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <serd_to_upper+0x3a>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serd_to_upper>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @serd_to_upper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 32
br label %17
14: ; preds = %6, %1
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
br label %17
17: ; preds = %14, %10
%18 = phi i32 [ %13, %10 ], [ %16, %14 ]
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @serd_to_upper(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int hsp_subevent_ag_indication_get_value_length(const uint8_t *event) {
  return event[3];
}


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

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

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

LLVM IR (-O2):
define i32 @hsp_subevent_ag_indication_get_value_length(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
ret i32 %3
}
int arith_div(int x, int y) {
  if ((-13 / 5 == -2) && ((x < 0) != (y < 0)) && (x % y != 0))
    return x / y - 1;
  return x / y;
}


x86 assembly (clang, -O0):
<arith_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0xc(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     114d <arith_div+0x4d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     114d <arith_div+0x4d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <arith_div+0x57>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arith_div>:
mov    %esi,%eax
xor    %edi,%eax
js     110c <arith_div+0xc>
mov    %edi,%eax
cltd
idiv   %esi
ret
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1106 <arith_div+0x6>
mov    %edi,%eax
cltd
idiv   %esi
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @arith_div(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
%8 = zext i1 %7 to i32
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
%11 = zext i1 %10 to i32
%12 = icmp ne i32 %8, %11
br i1 %12, label %13, label %23
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = srem i32 %14, %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = sdiv i32 %19, %20
%22 = sub nsw i32 %21, 1
store i32 %22, i32* %3
br label %27
23: ; preds = %13, %2
%24 = load i32, i32* %4
%25 = load i32, i32* %5
%26 = sdiv i32 %24, %25
store i32 %26, i32* %3
br label %27
27: ; preds = %23, %18
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @arith_div(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = icmp sgt i32 %3, -1
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = srem i32 %0, %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = sdiv i32 %0, %1
%10 = add nsw i32 %9, -1
br label %13
11: ; preds = %5, %2
%12 = sdiv i32 %0, %1
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t determ_float_from(float a) { return *(uint32_t *)&a; }


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

x86 assembly (clang, -O2):
<determ_float_from>:
movd   %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @determ_float_from(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
void RemoveSpaces(char *source) {
  char *i = source;
  char *j = source;
  while (*j != 0) {
    *i = *j++;
    if (*i != ' ')
      i++;
  }
  *i = 0;
}


x86 assembly (clang, -O0):
<RemoveSpaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1160 <RemoveSpaces+0x60>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     115b <RemoveSpaces+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <RemoveSpaces+0x18>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RemoveSpaces>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <RemoveSpaces+0x28>
lea    0x1(%rdi),%rax
nopw   0x0(%rax,%rax,1)
mov    %cl,(%rdi)
xor    %edx,%edx
cmp    $0x20,%cl
setne  %dl
add    %rdx,%rdi
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <RemoveSpaces+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @RemoveSpaces(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %5, i8* %7
%9 = icmp ne i8 %5, 32
%10 = zext i1 %9 to i64
%11 = getelementptr i8, i8* %7, i64 %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i8* [ %0, %1 ], [ %11, %4 ]
store i8 0, i8* %15
ret void
}
/* Variables and functions */
char *_add(char *, char *, char const *);
int /*<<< orphan*/ sprintf(char *, char const *, int const);
char *_conv(const int n, const char *format, char *pt, const char *ptlim) {
  char buf[32];
  sprintf(buf, format, n);
  return _add(buf, pt, ptlim);
}


x86 assembly (clang, -O0):
<_conv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <_add@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_conv>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %edi,%edx
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <_add@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @_conv(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [32 x i8]
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %6
%12 = load i32, i32* %5
%13 = call i32 @sprintf(i8* %10, i8* %11, i32 %12)
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = call i8* @_add(i8* %14, i8* %15, i8* %16)
ret i8* %17
}

LLVM IR (-O2):
define i8* @_conv(i32 %0, i8* nocapture %1, i8* %2, i8* %3) {
%5 = alloca [32 x i8]
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) %1, i32 %0)
%8 = call i8* @_add(i8* %6, i8* %2, i8* %3)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void dump(unsigned char *x, const size_t n) {
  size_t i;
  for (i = 0; i < n; i++) {
    printf("%02x", x[i]);
  }
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1161 <dump+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <dump+0x18>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1158 <dump+0x38>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <dump+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @dump(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void pri_logChar(char *str, int len) {
  char *bp;
  for (bp = str; len; len--)
    printf(" %02x", *bp++);
  printf("\n");
}


x86 assembly (clang, -O0):
<pri_logChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115f <pri_logChar+0x4f>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <pri_logChar+0x17>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pri_logChar>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1158 <pri_logChar+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1140 <pri_logChar+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c" %02x\00"
define void @pri_logChar(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %11, %4 ], [ %1, %2 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nsw i32 %6, -1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int fcntl(int, int, char const *);
int fcntl_int_string(int fd, int cmd, const char *arg) {
  return fcntl(fd, cmd, arg);
}


x86 assembly (clang, -O0):
<fcntl_int_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcntl_int_string>:
jmp    1030 <fcntl@plt>

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

LLVM IR (-O2):
define i32 @fcntl_int_string(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @fcntl(i32 %0, i32 %1, i8* %2)
ret i32 %4
}
void ScaleFilterRows_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleFilterRows_NEON() {
ret void
}
void BACKEND_CNFGInternalResize(short x, short y) {}


x86 assembly (clang, -O0):
<BACKEND_CNFGInternalResize>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @BACKEND_CNFGInternalResize(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
ret void
}

LLVM IR (-O2):
define void @BACKEND_CNFGInternalResize(i16 signext %0, i16 signext %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430Usart0P__Usart__clrRxIntr();
void Msp430SpiNoDmaP__0__Usart__clrRxIntr(void) {
  HplMsp430Usart0P__Usart__clrRxIntr();
}


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

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

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

LLVM IR (-O2):
define void @Msp430SpiNoDmaP__0__Usart__clrRxIntr() {
%1 = tail call i32 (...) @HplMsp430Usart0P__Usart__clrRxIntr()
ret void
}
void PerformanceAPI_EndEvent() {}


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

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

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

LLVM IR (-O2):
define void @PerformanceAPI_EndEvent() {
ret void
}
void vscale(double v1[3], double a) {
  v1[0] *= a;
  v1[1] *= a;
  v1[2] *= a;
}


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

x86 assembly (clang, -O2):
<vscale>:
movupd (%rdi),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,(%rdi)
mulsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @vscale(double* nocapture %0, double %1) {
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %1, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fmul <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fmul double %10, %1
store double %11, double* %9
ret void
}
int putchar_serial0(int ch) {
  if (ch == '\n') {
    while (!((*(volatile unsigned long *)(0xE000C000 + 0x14)) & 0x20))
      ;
    (*(volatile unsigned long *)(0xE000C000 + 0x00)) = 0x0D;
  }
  while (!((*(volatile unsigned long *)(0xE000C000 + 0x14)) & 0x20))
    ;
  return ((*(volatile unsigned long *)(0xE000C000 + 0x00)) = ch);
}


x86 assembly (clang, -O0):
<putchar_serial0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    1149 <putchar_serial0+0x49>
jmp    1116 <putchar_serial0+0x16>
mov    $0xe000c014,%eax
mov    (%rax),%rax
and    $0x20,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <putchar_serial0+0x38>
jmp    113d <putchar_serial0+0x3d>
jmp    1116 <putchar_serial0+0x16>
mov    $0xe000c000,%eax
movq   $0xd,(%rax)
jmp    114e <putchar_serial0+0x4e>
mov    $0xe000c014,%eax
mov    (%rax),%rax
and    $0x20,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1170 <putchar_serial0+0x70>
jmp    1175 <putchar_serial0+0x75>
jmp    114e <putchar_serial0+0x4e>
movslq -0x4(%rbp),%rax
mov    $0xe000c000,%ecx
mov    %rax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar_serial0>:
mov    %edi,%eax
mov    $0xe000c000,%ecx
cmp    $0xa,%edi
jne    1130 <putchar_serial0+0x30>
nopl   0x0(%rax)
testq  $0x20,0x14(%rcx)
je     1110 <putchar_serial0+0x10>
movq   $0xd,(%rcx)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
testq  $0x20,0x14(%rcx)
je     1130 <putchar_serial0+0x30>
movslq %eax,%rdx
mov    %rdx,(%rcx)
ret

LLVM IR (-O0):
define i32 @putchar_serial0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %13
5: ; preds = %1
br label %6
6: ; preds = %11, %5
%7 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%8 = and i64 %7, 32
%9 = icmp ne i64 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %12
11: ; preds = %6
br label %6
12: ; preds = %6
store volatile i64 13, i64* inttoptr (i64 3758145536 to i64*)
br label %13
13: ; preds = %12, %1
br label %14
14: ; preds = %19, %13
%15 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%16 = and i64 %15, 32
%17 = icmp ne i64 %16, 0
%18 = xor i1 %17, true
br i1 %18, label %19, label %20
19: ; preds = %14
br label %14
20: ; preds = %14
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
store volatile i64 %22, i64* inttoptr (i64 3758145536 to i64*)
%23 = trunc i64 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @putchar_serial0(i32 returned %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%5 = and i64 %4, 32
%6 = icmp eq i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
store volatile i64 13, i64* inttoptr (i64 3758145536 to i64*)
br label %8
8: ; preds = %7, %1
br label %9
9: ; preds = %8, %9
%10 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%11 = and i64 %10, 32
%12 = icmp eq i64 %11, 0
br i1 %12, label %9, label %13
13: ; preds = %9
%14 = sext i32 %0 to i64
store volatile i64 %14, i64* inttoptr (i64 3758145536 to i64*)
ret i32 %0
}
int test_imm_FEuint32_mem(unsigned int *val) {
  return ((*val) & (0xFE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FEuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 254
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double exp(double);
double __ccv_gaussian_kernel(double x, double y, void *data) {
  double sigma = *(double *)data;
  return exp(-(x * x + y * y) / (2 * sigma * sigma));
}


x86 assembly (clang, -O0):
<__ccv_gaussian_kernel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe92(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ccv_gaussian_kernel>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  0xedc(%rip),%xmm0
movsd  (%rdi),%xmm1
movapd %xmm1,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @__ccv_gaussian_kernel(double %0, double %1, i8* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i8*
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %7
%11 = load double, double* %4
%12 = load double, double* %4
%13 = load double, double* %5
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = call double @llvm.fmuladd.f64(double %11, double %12, double %15)
%17 = fneg double %16
%18 = load double, double* %7
%19 = fmul double 2.000000e+00, %18
%20 = load double, double* %7
%21 = fmul double %19, %20
%22 = fdiv double %17, %21
%23 = call double @exp(double %22)
ret double %23
}

LLVM IR (-O2):
define double @__ccv_gaussian_kernel(double %0, double %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to double*
%5 = load double, double* %4
%6 = fmul double %1, %1
%7 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %6)
%8 = fneg double %7
%9 = fmul double %5, 2.000000e+00
%10 = fmul double %5, %9
%11 = fdiv double %8, %10
%12 = tail call double @exp(double %11)
ret double %12
}
void next() {}


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

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

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

LLVM IR (-O2):
define void @next() {
ret void
}