xunge/DecIR huggingface dataset:
char h(char *x) { return x[4]; }


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

x86 assembly (clang, -O2):
<h>:
mov    0x4(%rdi),%al
ret

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

LLVM IR (-O2):
define signext i8 @h(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = load i8, i8* %2
ret i8 %3
}
/* Variables and functions */
void MemManage_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @MemManage_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
const char *RA_version(void) {
  return ("readascii : V1.0 2007-09-07 Peter Boesecke");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"readascii : V1.0 2007-09-07 Peter Boesecke\00"
define i8* @RA_version() {
ret i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [43 x i8] c"readascii : V1.0 2007-09-07 Peter Boesecke\00"
define i8* @RA_version() {
ret i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0)
}
int gcd(int i, int j) {
  int t;
  while (i != 0) {
    if (j >= i)
      j -= i;
    else {
      t = i;
      i = j;
      j = t;
    }
  }
  return j;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1147 <gcd+0x47>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     1130 <gcd+0x30>
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <gcd+0x42>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
test   %edi,%edi
je     111f <gcd+0x1f>
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
sub    %edi,%eax
cmovl  %edi,%eax
cmovl  %esi,%edi
mov    %eax,%esi
test   %edi,%edi
jne    1110 <gcd+0x10>
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %0, %2 ]
%6 = phi i32 [ %9, %4 ], [ %1, %2 ]
%7 = icmp slt i32 %6, %5
%8 = sub nsw i32 %6, %5
%9 = select i1 %7, i32 %5, i32 %8
%10 = select i1 %7, i32 %6, i32 %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ %1, %2 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
void *_zero_arr_plus_other_fn(unsigned int, void **, int, int, char const *,
                              unsigned int);
void *_zero_arr_inplace_plus_post_voidstar_fn(unsigned t, void **x, int orig_i,
                                              const char *filename,
                                              unsigned lineno) {
  void **_zap_res = *x;
  *x = _zero_arr_plus_other_fn(t, _zap_res, 1, orig_i, filename, lineno);
  return _zap_res;
}


x86 assembly (clang, -O0):
<_zero_arr_inplace_plus_post_voidstar_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    $0x1,%edx
call   1030 <_zero_arr_plus_other_fn@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zero_arr_inplace_plus_post_voidstar_fn>:
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%r14
mov    (%rsi),%rbx
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <_zero_arr_plus_other_fn@plt>
mov    %rax,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_zero_arr_inplace_plus_post_voidstar_fn(i32 %0, i8** %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8**
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %12
%14 = bitcast i8* %13 to i8**
store i8** %14, i8*** %11
%15 = load i32, i32* %6
%16 = load i8**, i8*** %11
%17 = load i32, i32* %8
%18 = load i8*, i8** %9
%19 = load i32, i32* %10
%20 = call i8* @_zero_arr_plus_other_fn(i32 %15, i8** %16, i32 1, i32 %17, i8* %18, i32 %19)
%21 = load i8**, i8*** %7
store i8* %20, i8** %21
%22 = load i8**, i8*** %11
%23 = bitcast i8** %22 to i8*
ret i8* %23
}

LLVM IR (-O2):
define i8* @_zero_arr_inplace_plus_post_voidstar_fn(i32 %0, i8** nocapture %1, i32 %2, i8* %3, i32 %4) {
%6 = load i8*, i8** %1
%7 = bitcast i8* %6 to i8**
%8 = tail call i8* @_zero_arr_plus_other_fn(i32 %0, i8** %7, i32 1, i32 %2, i8* %3, i32 %4)
store i8* %8, i8** %1
ret i8* %6
}
float lin_int_bnd(float x, float xmin, float xmax, float ymin, float ymax) {
  float y;
  if (x <= xmin)
    y = ymin;
  else if (x >= xmax)
    y = ymax;
  else
    y = ymin + (x - xmin) * (ymax - ymin) / (xmax - xmin);
  return (y);
}


x86 assembly (clang, -O0):
<lin_int_bnd>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     113f <lin_int_bnd+0x3f>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    1196 <lin_int_bnd+0x96>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     115d <lin_int_bnd+0x5d>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    1191 <lin_int_bnd+0x91>
movss  -0x10(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
subss  -0x10(%rbp),%xmm2
mulss  %xmm2,%xmm1
movss  -0xc(%rbp),%xmm2
subss  -0x8(%rbp),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    1196 <lin_int_bnd+0x96>
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lin_int_bnd>:
ucomiss %xmm0,%xmm1
jae    1122 <lin_int_bnd+0x22>
ucomiss %xmm2,%xmm0
jae    1126 <lin_int_bnd+0x26>
subss  %xmm1,%xmm0
subss  %xmm3,%xmm4
mulss  %xmm0,%xmm4
subss  %xmm1,%xmm2
divss  %xmm2,%xmm4
addss  %xmm4,%xmm3
movaps %xmm3,%xmm0
ret
movaps %xmm4,%xmm0
ret

LLVM IR (-O0):
define float @lin_int_bnd(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%12 = load float, float* %6
%13 = load float, float* %7
%14 = fcmp ole float %12, %13
br i1 %14, label %15, label %17
15: ; preds = %5
%16 = load float, float* %9
store float %16, float* %11
br label %38
17: ; preds = %5
%18 = load float, float* %6
%19 = load float, float* %8
%20 = fcmp oge float %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load float, float* %10
store float %22, float* %11
br label %37
23: ; preds = %17
%24 = load float, float* %9
%25 = load float, float* %6
%26 = load float, float* %7
%27 = fsub float %25, %26
%28 = load float, float* %10
%29 = load float, float* %9
%30 = fsub float %28, %29
%31 = fmul float %27, %30
%32 = load float, float* %8
%33 = load float, float* %7
%34 = fsub float %32, %33
%35 = fdiv float %31, %34
%36 = fadd float %24, %35
store float %36, float* %11
br label %37
37: ; preds = %23, %21
br label %38
38: ; preds = %37, %15
%39 = load float, float* %11
ret float %39
}

LLVM IR (-O2):
define float @lin_int_bnd(float %0, float %1, float %2, float %3, float %4) {
%6 = fcmp ugt float %0, %1
br i1 %6, label %7, label %16
7: ; preds = %5
%8 = fcmp ult float %0, %2
br i1 %8, label %9, label %16
9: ; preds = %7
%10 = fsub float %0, %1
%11 = fsub float %4, %3
%12 = fmul float %10, %11
%13 = fsub float %2, %1
%14 = fdiv float %12, %13
%15 = fadd float %14, %3
br label %16
16: ; preds = %7, %5, %9
%17 = phi float [ %15, %9 ], [ %3, %5 ], [ %4, %7 ]
ret float %17
}
/* Type definitions */
struct SkipListNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct SkipListNode *);
void SkipListNode_free(struct SkipListNode *node) { free(node); }


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

x86 assembly (clang, -O2):
<SkipListNode_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.SkipListNode = type { i32 }
define void @SkipListNode_free(%struct.SkipListNode* nocapture %0) {
%2 = tail call i32 @free(%struct.SkipListNode* %0)
ret void
}
/* Type definitions */
struct constant {
  int dummy;
};

/* Variables and functions */
struct constant *constant_str_integer(char const *);
struct constant *constant_hex_integer(const char *string) {
  return constant_str_integer(string);
}


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

x86 assembly (clang, -O2):
<constant_hex_integer>:
jmp    1030 <constant_str_integer@plt>

LLVM IR (-O0):
%struct.constant = type { i32 }
define %struct.constant* @constant_hex_integer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.constant* @constant_str_integer(i8* %3)
ret %struct.constant* %4
}

LLVM IR (-O2):
%struct.constant = type { i32 }
define %struct.constant* @constant_hex_integer(i8* %0) {
%2 = tail call %struct.constant* @constant_str_integer(i8* %0)
ret %struct.constant* %2
}
/* Type definitions */
struct demod_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ selcall_deinit(struct demod_state *);
void eia_deinit(struct demod_state *s) { selcall_deinit(s); }


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

x86 assembly (clang, -O2):
<eia_deinit>:
jmp    1030 <selcall_deinit@plt>

LLVM IR (-O0):
%struct.demod_state = type { i32 }
define void @eia_deinit(%struct.demod_state* %0) {
%2 = alloca %struct.demod_state*
store %struct.demod_state* %0, %struct.demod_state** %2
%3 = load %struct.demod_state*, %struct.demod_state** %2
%4 = call i32 @selcall_deinit(%struct.demod_state* %3)
ret void
}

LLVM IR (-O2):
%struct.demod_state = type { i32 }
define void @eia_deinit(%struct.demod_state* %0) {
%2 = tail call i32 @selcall_deinit(%struct.demod_state* %0)
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
void ref_mul_int16_t(int16_t arg1, int16_t arg2, int16_t *result) {
  *result = arg1 * arg2;
}


x86 assembly (clang, -O0):
<ref_mul_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ref_mul_int16_t>:
imul   %esi,%edi
mov    %edi,(%rdx)
ret

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

LLVM IR (-O2):
define void @ref_mul_int16_t(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = mul nsw i32 %1, %0
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xml_read();
void data_read(void) { xml_read(); }


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

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

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

LLVM IR (-O2):
define void @data_read() {
%1 = tail call i32 (...) @xml_read()
ret void
}
int emac1_etherstatsjabbers_set(unsigned int dev_id,
                                union emac1_etherstatsjabbers_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac1_etherstatsjabbers_u = type opaque
define i32 @emac1_etherstatsjabbers_set(i32 %0, %union.emac1_etherstatsjabbers_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_etherstatsjabbers_u*
store i32 %0, i32* %3
store %union.emac1_etherstatsjabbers_u* %1, %union.emac1_etherstatsjabbers_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_etherstatsjabbers_u = type opaque
define i32 @emac1_etherstatsjabbers_set(i32 %0, %union.emac1_etherstatsjabbers_u* nocapture readnone %1) {
ret i32 1
}
void XContextDependentDrawing() {}


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

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

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

LLVM IR (-O2):
define void @XContextDependentDrawing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core3_print(char *, char *, char const *);
void U_EMRSETBKCOLOR_print(const char *contents) {
  core3_print("U_EMRSETBKCOLOR", "crColor:", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRSETBKCOLOR_print>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <core3_print@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"U_EMRSETBKCOLOR\00"
@.str.1 = [9 x i8] c"crColor:\00"
define void @U_EMRSETBKCOLOR_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core3_print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"U_EMRSETBKCOLOR\00"
@.str.1 = [9 x i8] c"crColor:\00"
define void @U_EMRSETBKCOLOR_print(i8* %0) {
%2 = tail call i32 @core3_print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Hello,world!\r\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello,world!\0D\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello,world!\0D\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(void) {
  long j = 0x40000000;
  if ((unsigned int)(0x40000000 + j) < 0L)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x40000000,-0x10(%rbp)
40
mov    -0x10(%rbp),%rax
add    $0x40000000,%rax
mov    %eax,%eax
cmp    $0x0,%rax
jge    1144 <main+0x34>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 1073741824, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 1073741824, %3
%5 = trunc i64 %4 to i32
%6 = zext i32 %5 to i64
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned long swap_long(unsigned long x) {
  union lconv {
    unsigned long ul;
    unsigned char uc[4];
  } * inp, outx;
  inp = (union lconv *)&x;
  outx.uc[0] = inp->uc[3];
  outx.uc[1] = inp->uc[2];
  outx.uc[2] = inp->uc[1];
  outx.uc[3] = inp->uc[0];
  return outx.ul;
}


x86 assembly (clang, -O0):
<swap_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x17(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x16(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x15(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.lconv = type { i64 }
define i64 @swap_long(i64 %0) {
%2 = alloca i64
%3 = alloca %union.lconv*
%4 = alloca %union.lconv
store i64 %0, i64* %2
%5 = bitcast i64* %2 to %union.lconv*
store %union.lconv* %5, %union.lconv** %3
%6 = load %union.lconv*, %union.lconv** %3
%7 = bitcast %union.lconv* %6 to [4 x i8]*
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 3
%9 = load i8, i8* %8
%10 = bitcast %union.lconv* %4 to [4 x i8]*
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
store i8 %9, i8* %11
%12 = load %union.lconv*, %union.lconv** %3
%13 = bitcast %union.lconv* %12 to [4 x i8]*
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %13, i64 0, i64 2
%15 = load i8, i8* %14
%16 = bitcast %union.lconv* %4 to [4 x i8]*
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 1
store i8 %15, i8* %17
%18 = load %union.lconv*, %union.lconv** %3
%19 = bitcast %union.lconv* %18 to [4 x i8]*
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %19, i64 0, i64 1
%21 = load i8, i8* %20
%22 = bitcast %union.lconv* %4 to [4 x i8]*
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %22, i64 0, i64 2
store i8 %21, i8* %23
%24 = load %union.lconv*, %union.lconv** %3
%25 = bitcast %union.lconv* %24 to [4 x i8]*
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %25, i64 0, i64 0
%27 = load i8, i8* %26
%28 = bitcast %union.lconv* %4 to [4 x i8]*
%29 = getelementptr inbounds [4 x i8], [4 x i8]* %28, i64 0, i64 3
store i8 %27, i8* %29
%30 = bitcast %union.lconv* %4 to i64*
%31 = load i64, i64* %30
ret i64 %31
}

LLVM IR (-O2):
%union.lconv = type { i64 }
define i64 @swap_long(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ _ada_getsys1();
int /*<<< orphan*/ adafinal();
int /*<<< orphan*/ adainit();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\nTesting Reading of Polynomial Systems\n");
  adainit();
  _ada_getsys1();
  adafinal();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <adainit@plt>
mov    $0x0,%al
call   1050 <_ada_getsys1@plt>
mov    $0x0,%al
call   1040 <adafinal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <adainit@plt>
xor    %eax,%eax
call   1050 <_ada_getsys1@plt>
xor    %eax,%eax
call   1040 <adafinal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"\0ATesting Reading of Polynomial Systems\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @adainit()
%4 = call i32 (...) @_ada_getsys1()
%5 = call i32 (...) @adafinal()
ret i32 0
}

LLVM IR (-O2):
@str = [39 x i8] c"\0ATesting Reading of Polynomial Systems\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @adainit()
%3 = tail call i32 (...) @_ada_getsys1()
%4 = tail call i32 (...) @adafinal()
ret i32 0
}
void setCap(void *mem, int cap) {
  int *p = mem;
  p[(1)] = cap;
}


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

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

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

LLVM IR (-O2):
define void @setCap(i8* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = bitcast i8* %3 to i32*
store i32 %1, i32* %4
ret void
}
__attribute((always_)) void do_switch() {}


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

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

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

LLVM IR (-O2):
define void @do_switch() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void brush_motor_ON(void *brushmotor_address) {
  *((volatile int *)brushmotor_address + 3) = 1;
  usleep(50);
}


x86 assembly (clang, -O0):
<brush_motor_ON>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,0xc(%rax)
mov    $0x32,%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brush_motor_ON>:
movl   $0x1,0xc(%rdi)
mov    $0x32,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @brush_motor_ON(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 3
store volatile i32 1, i32* %5
%6 = call i32 @usleep(i32 50)
ret void
}

LLVM IR (-O2):
define void @brush_motor_ON(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = bitcast i8* %2 to i32*
store volatile i32 1, i32* %3
%4 = tail call i32 @usleep(i32 50)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *nmx_alloc(size_t);
void *nmx_calloc(size_t size) {
  void *p;
  p = nmx_alloc(size);
  if (p) {
    memset(p, 0, size);
  }
  return p;
}


x86 assembly (clang, -O0):
<nmx_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nmx_alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <nmx_calloc+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmx_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <nmx_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <nmx_calloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @nmx_calloc(i64 %0) {
%2 = tail call i8* @nmx_alloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int test_imm_65int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x65 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_65int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 101
%7 = icmp ne i64 %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_65int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6619136
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void strcpy(char *src, char *des) {
  int i = 0;
  while (*(src + i) != '\0') {
    *(des + i) = *(src + i);
    i++;
  }
  *(des + i) = '\0';
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <strcpy+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    (%rdi),%al
test   %al,%al
je     1127 <strcpy+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rsi,%rcx,1)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <strcpy+0x10>
mov    %ecx,%eax
movb   $0x0,(%rsi,%rax,1)
ret
xor    %eax,%eax
movb   $0x0,(%rsi,%rax,1)
ret

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

LLVM IR (-O2):
define void @strcpy(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %1, i64 %16
store i8 0, i8* %17
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dot_rev_graph_begin(void) { printf("digraph G {\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"digraph G {\00"
define void @dot_rev_graph_begin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dap_write_word(int, int);
void target_lock(void) { dap_write_word(0x400e0c04, 0x5a00000b | (0 << 8)); }


x86 assembly (clang, -O0):
<target_lock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400e0c04,%edi
mov    $0x5a00000b,%esi
call   1030 <dap_write_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<target_lock>:
mov    $0x400e0c04,%edi
mov    $0x5a00000b,%esi
jmp    1030 <dap_write_word@plt>

LLVM IR (-O0):
define void @target_lock() {
%1 = call i32 @dap_write_word(i32 1074662404, i32 1509949451)
ret void
}

LLVM IR (-O2):
define void @target_lock() {
%1 = tail call i32 @dap_write_word(i32 1074662404, i32 1509949451)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int);
in_addr_t netmask(int prefix_len) {
  return htonl(~((uint32_t)0) << (32 - prefix_len));
}


x86 assembly (clang, -O0):
<netmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x20,%ecx
sub    -0x4(%rbp),%ecx
mov    $0xffffffff,%edi
shl    %cl,%edi
call   1030 <htonl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netmask>:
mov    %edi,%ecx
neg    %cl
mov    $0xffffffff,%edi
shl    %cl,%edi
jmp    1030 <htonl@plt>

LLVM IR (-O0):
define i32 @netmask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 32, %3
%5 = shl i32 -1, %4
%6 = call i32 @htonl(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @netmask(i32 %0) {
%2 = sub nsw i32 32, %0
%3 = shl nsw i32 -1, %2
%4 = tail call i32 @htonl(i32 %3)
ret i32 %4
}
void aos_compiler_memory_barrier(void) {
  __asm__ __volatile__("" ::: "memory");
}


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

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

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

LLVM IR (-O2):
define void @aos_compiler_memory_barrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void __tprintf_flush_newline(void) {
  int i;
  fputc('\n', stdout);
  for (i = 0; i < 3; ++i)
    fputc(' ', stdout);
}


x86 assembly (clang, -O0):
<__tprintf_flush_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    115d <__tprintf_flush_newline+0x4d>
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <__tprintf_flush_newline+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__tprintf_flush_newline>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    (%rbx),%esi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    (%rbx),%esi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    (%rbx),%esi
mov    $0x20,%edi
pop    %rbx
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @__tprintf_flush_newline() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = call i32 @fputc(i8 signext 10, i32 %2)
store i32 0, i32* %1
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* @stdout
%9 = call i32 @fputc(i8 signext 32, i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @__tprintf_flush_newline() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputc(i8 signext 10, i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputc(i8 signext 32, i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputc(i8 signext 32, i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fputc(i8 signext 32, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_free__(void *);
int /*<<< orphan*/ __coverity_mark_as_afm_freed__(void *, char *);
void H5Pclose(void *id) {
  __coverity_free__(id);
  __coverity_mark_as_afm_freed__(id, "H5Pclose");
}


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

x86 assembly (clang, -O2):
<H5Pclose>:
push   %rbx
mov    %rdi,%rbx
call   1040 <__coverity_free__@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__coverity_mark_as_afm_freed__@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"H5Pclose\00"
define void @H5Pclose(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @__coverity_free__(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @__coverity_mark_as_afm_freed__(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"H5Pclose\00"
define void @H5Pclose(i8* %0) {
%2 = tail call i32 @__coverity_free__(i8* %0)
%3 = tail call i32 @__coverity_mark_as_afm_freed__(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strcmp_ci(char *, char *);
int string_ci_lt(char *s1, char *s2, int k) {
  k = 0;
  return strcmp_ci(s1, s2) < 0;
}


x86 assembly (clang, -O0):
<string_ci_lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp_ci@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_ci_lt>:
push   %rax
call   1030 <strcmp_ci@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_ci_lt(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i64 @strcmp_ci(i8* %7, i8* %8)
%10 = icmp slt i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @string_ci_lt(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @strcmp_ci(i8* %0, i8* %1)
%5 = lshr i64 %4, 63
%6 = trunc i64 %5 to i32
ret i32 %6
}
unsigned char window_type_is_ok(const unsigned char type) {
  switch (type) {
  case 1:
  case 2:
  case 3:
  case 13:
  case 4:
  case 5:
  case 6:
  case 7:
  case 8:
  case 9:
  case 10:
  case 11:
  case 12:
  case 14:
    return (type);
    break;
  default:
    return (0);
    break;
  }
}


x86 assembly (clang, -O0):
<window_type_is_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
add    $0xffffffff,%eax
sub    $0xd,%eax
ja     112a <window_type_is_ok+0x2a>
jmp    111f <window_type_is_ok+0x1f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    112e <window_type_is_ok+0x2e>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<window_type_is_ok>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0xe,%cl
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @window_type_is_ok(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %8 [
i32 1, label %6
i32 2, label %6
i32 3, label %6
i32 13, label %6
i32 4, label %6
i32 5, label %6
i32 6, label %6
i32 7, label %6
i32 8, label %6
i32 9, label %6
i32 10, label %6
i32 11, label %6
i32 12, label %6
i32 14, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
%7 = load i8, i8* %3
store i8 %7, i8* %2
br label %9
8: ; preds = %1
store i8 0, i8* %2
br label %9
9: ; preds = %8, %6
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @window_type_is_ok(i8 zeroext %0) {
%2 = add i8 %0, -1
%3 = icmp ult i8 %2, 14
%4 = select i1 %3, i8 %0, i8 0
ret i8 %4
}
void testSelfOperations(int a) {
  if ((a | a) != a)
    ((void)*(char *)0);
  if ((a & a) != a)
    ((void)*(char *)0);
  if ((a ^ a) != 0)
    ((void)*(char *)0);
  if ((a - a) != 0)
    ((void)*(char *)0);
}


x86 assembly (clang, -O0):
<testSelfOperations>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1116 <testSelfOperations+0x16>
mov    -0x4(%rbp),%eax
and    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1125 <testSelfOperations+0x25>
mov    -0x4(%rbp),%eax
xor    -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1134 <testSelfOperations+0x34>
mov    -0x4(%rbp),%eax
sub    -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1143 <testSelfOperations+0x43>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testSelfOperations(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = or i32 %3, %4
%6 = load i32, i32* %2
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8, i8* null
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %2
%12 = load i32, i32* %2
%13 = and i32 %11, %12
%14 = load i32, i32* %2
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = load i8, i8* null
br label %18
18: ; preds = %16, %10
%19 = load i32, i32* %2
%20 = load i32, i32* %2
%21 = xor i32 %19, %20
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = load i8, i8* null
br label %25
25: ; preds = %23, %18
%26 = load i32, i32* %2
%27 = load i32, i32* %2
%28 = sub nsw i32 %26, %27
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = load i8, i8* null
br label %32
32: ; preds = %30, %25
ret void
}

LLVM IR (-O2):
define void @testSelfOperations(i32 %0) {
ret void
}
/* Type definitions */
typedef unsigned int uint8_t;
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
bool get_bit(uint64_t seq, uint8_t *window, uint32_t W) {
  uint32_t bitno = seq % W;
  uint32_t blockno = bitno / 8;
  bitno = bitno % 8;
  return window[blockno] & (1u << bitno);
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %edx,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
mov    %edx,%ecx
lea    0x7(%rcx),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x3,%edx
movslq %edx,%rcx
and    (%rsi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @get_bit(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %6
%11 = srem i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = sdiv i32 %12, 8
store i32 %13, i32* %8
%14 = load i32, i32* %7
%15 = srem i32 %14, 8
store i32 %15, i32* %7
%16 = load i32*, i32** %5
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %7
%22 = shl i32 1, %21
%23 = and i32 %20, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @get_bit(i32 %0, i32* nocapture %1, i32 %2) {
%4 = srem i32 %0, %2
%5 = sdiv i32 %4, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = and i32 %4, 7
%10 = shl nuw nsw i32 1, %9
%11 = and i32 %10, %8
ret i32 %11
}
cubes(top) int top[];
{
  register k, s = 0, n1 = 0, n5 = 0;
  for (k = 0; k < 1; k++) {
    switch (top[k]) {
    case 1:
      n1++;
      break;
    case 5:
      n5++;
      break;
    }
  }
  s += 10 * n1 + 5 * n5;
  return (s);
}


x86 assembly (clang, -O0):
<cubes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    1185 <cubes+0x85>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x1,%eax
je     115b <cubes+0x5b>
jmp    114a <cubes+0x4a>
mov    -0x1c(%rbp),%eax
sub    $0x5,%eax
je     1169 <cubes+0x69>
jmp    1172 <cubes+0x72>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1172 <cubes+0x72>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1177 <cubes+0x77>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <cubes+0x24>
imul   $0xa,-0x14(%rbp),%eax
imul   $0x5,-0x18(%rbp),%ecx
add    %ecx,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubes>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    $0x5,%eax
je     1116 <cubes+0x16>
cmp    $0x1,%eax
jne    111b <cubes+0x1b>
mov    $0xa,%eax
or     %ecx,%eax
ret
mov    $0x5,%ecx
xor    %eax,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cubes(i32* nocapture %0) {
%2 = load i32, i32* %0
switch i32 %2, label %5 [
i32 1, label %3
i32 5, label %4
]
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3
%6 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 10, %3 ]
%7 = phi i32 [ 0, %1 ], [ 5, %4 ], [ 0, %3 ]
%8 = or i32 %7, %6
ret i32 %8
}
int test_imm_6Cint8_mem(signed char *val) {
  return ((*val) & (0x6C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Cint8_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, 108
%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_6Cint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 108
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}