xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
int myrand(int max) {
  return (int)(((double)max * (double)rand()) / (double)RAND_MAX);
}


x86 assembly (clang, -O0):
<myrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
mov    0x2ea7(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrand>:
push   %rax
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2eb8(%rip),%rax
cvtsi2sdq (%rax),%xmm1
mulsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @myrand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = fmul double %4, %6
%8 = load i64, i64* @RAND_MAX
%9 = sitofp i64 %8 to double
%10 = fdiv double %7, %9
%11 = fptosi double %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @myrand(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = fmul double %2, %4
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fdiv double %5, %7
%9 = fptosi double %8 to i32
ret i32 %9
}
int input_map_a4(char c) { return 0; }


x86 assembly (clang, -O0):
<input_map_a4>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @input_map_a4(i8 signext %0) {
ret i32 0
}
int neg_char(char a) { return !a; }


x86 assembly (clang, -O0):
<neg_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_char>:
xor    %eax,%eax
test   %dil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @neg_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @neg_char(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t space_consumed(int64_t filesize) {
  int64_t block_size = 4096;
  int64_t blocks = filesize / block_size;
  if (filesize % block_size)
    blocks++;
  return blocks * block_size;
}


x86 assembly (clang, -O0):
<space_consumed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1000,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
je     1131 <space_consumed+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<space_consumed>:
lea    0xfff(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
shr    $0xc,%eax
and    $0xfff,%edi
cmp    $0x1,%edi
sbb    $0xffffffff,%eax
shl    $0xc,%eax
ret

LLVM IR (-O0):
define i32 @space_consumed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 4096, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = sdiv i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = srem i32 %8, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %15
15: ; preds = %12, %1
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = mul nsw i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @space_consumed(i32 %0) {
%2 = sdiv i32 %0, 4096
%3 = and i32 %0, 4095
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %2, %5
%7 = shl nsw i32 %6, 12
ret i32 %7
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int is_empty(struct node *);
int /*<<< orphan*/ pop_stack(struct node *);
void release_stack(struct node *p_top) {
  while (is_empty(p_top) == 1) {
    pop_stack(p_top);
  }
}


x86 assembly (clang, -O0):
<release_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_empty@plt>
cmp    $0x1,%eax
jne    114c <release_stack+0x2c>
mov    -0x8(%rbp),%rdi
call   1040 <pop_stack@plt>
jmp    112c <release_stack+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<release_stack>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <is_empty@plt>
cmp    $0x1,%eax
jne    1147 <release_stack+0x27>
mov    %rbx,%rdi
call   1040 <pop_stack@plt>
mov    %rbx,%rdi
jmp    1130 <release_stack+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define void @release_stack(%struct.node* %0) {
%2 = alloca %struct.node*
store %struct.node* %0, %struct.node** %2
br label %3
3: ; preds = %7, %1
%4 = load %struct.node*, %struct.node** %2
%5 = call i32 @is_empty(%struct.node* %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load %struct.node*, %struct.node** %2
%9 = call i32 @pop_stack(%struct.node* %8)
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @release_stack(%struct.node* %0) {
%2 = tail call i32 @is_empty(%struct.node* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 @pop_stack(%struct.node* %0)
%6 = tail call i32 @is_empty(%struct.node* %0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %4, label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int wfc_util_is_random_mac(char *mac_add) {
  if (0 == strncmp(mac_add, "001122", 6)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<wfc_util_is_random_mac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    114b <wfc_util_is_random_mac+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <wfc_util_is_random_mac+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfc_util_is_random_mac>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"001122\00"
define i32 @wfc_util_is_random_mac(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello world, I'm in CPTS 122 now!\n\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Hello world, I'm in CPTS 122 now!\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"Hello world, I'm in CPTS 122 now!\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double strtod(char const *, char **);
int get_double_arg(const char *arg, double *val) {
  char *endptr = (char *)arg;
  *val = strtod(arg, &endptr);
  return (*endptr || endptr == arg) ? -1 : 0;
}


x86 assembly (clang, -O0):
<get_double_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <strtod@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
jne    1160 <get_double_arg+0x50>
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%dl
xor    %eax,%eax
mov    $0xffffffff,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_double_arg>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdi,(%rsp)
mov    %rsp,%rsi
call   1030 <strtod@plt>
movsd  %xmm0,(%r14)
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
setne  %cl
cmp    %rbx,%rax
sete   %al
or     %cl,%al
movzbl %al,%eax
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @get_double_arg(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
%5 = alloca i8*
store i8* %0, i8** %3
store double* %1, double** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = call double @strtod(i8* %7, i8** %5)
%9 = load double*, double** %4
store double %8, double* %9
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = icmp eq i8* %15, %16
br label %18
18: ; preds = %14, %2
%19 = phi i1 [ true, %2 ], [ %17, %14 ]
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 -1, i32 0
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_double_arg(i8* %0, double* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* %0, i8** %3
%5 = call double @strtod(i8* %0, i8** %3)
store double %5, double* %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = icmp eq i8* %6, %0
%10 = or i1 %9, %8
%11 = sext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ rand();
scalar_t__ test__paritysi2(int /*<<< orphan*/);
int main() {
  int i;
  for (i = 0; i < 10000; ++i)
    if (test__paritysi2(rand()))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    117a <main+0x5a>
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,%edi
call   1030 <test__paritysi2@plt>
cmp    $0x0,%rax
je     1167 <main+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1181 <main+0x61>
jmp    116c <main+0x4c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2710,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%edi
call   1030 <test__paritysi2@plt>
test   %rax,%rax
jne    114c <main+0x2c>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10000
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = call i32 (...) @rand()
%8 = call i64 @test__paritysi2(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
store i32 1, i32* %1
br label %16
11: ; preds = %6
br label %12
12: ; preds = %11
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %3
store i32 0, i32* %1
br label %16
16: ; preds = %15, %10
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
br label %4
1: ; preds = %4
%2 = add nuw nsw i32 %5, 1
%3 = icmp eq i32 %2, 10000
br i1 %3, label %9, label %4
4: ; preds = %0, %1
%5 = phi i32 [ 0, %0 ], [ %2, %1 ]
%6 = tail call i32 (...) @rand()
%7 = tail call i64 @test__paritysi2(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %1, label %9
9: ; preds = %1, %4
%10 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void printBitString(uint16_t bitString, uint8_t length) {
  uint16_t mask = (0x01 << (length - 1));
  for (int bitIndex = 0; bitIndex < length; bitIndex++) {
    if (bitString & (mask >> bitIndex)) {
      ;
    } else {
      ;
    }
  }
}


x86 assembly (clang, -O0):
<printBitString>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <printBitString+0x62>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     114a <printBitString+0x4a>
jmp    114f <printBitString+0x4f>
jmp    114f <printBitString+0x4f>
jmp    1154 <printBitString+0x54>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1121 <printBitString+0x21>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @printBitString(i32 %0, i32 %1) {
ret void
}
int kasan_add_zero_shadow(void *start, unsigned long size) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kasan_add_zero_shadow(i8* nocapture readnone %0, i64 %1) {
ret i32 0
}
int arr_contains(char character, char array[], int length) {
  int i;
  for (i = 0; i < length; ++i) {
    if (array[i] == character)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<arr_contains>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115b <arr_contains+0x5b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1148 <arr_contains+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1162 <arr_contains+0x62>
jmp    114d <arr_contains+0x4d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1118 <arr_contains+0x18>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr_contains>:
test   %edx,%edx
jle    111f <arr_contains+0x1f>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %dil,(%rsi,%rcx,1)
je     1122 <arr_contains+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <arr_contains+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @arr_contains(i8 signext %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i8, i8* %1, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, %0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
signed short signedshort_ignoring_unsignedshort(signed short x,
                                                unsigned short y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedshort_ignoring_unsignedshort>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define signext i16 @signedshort_ignoring_unsignedshort(i16 returned signext %0, i16 zeroext %1) {
ret i16 %0
}
void DSP_Stop() {}


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

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

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

LLVM IR (-O2):
define void @DSP_Stop() {
ret void
}
/* Variables and functions */
float readFloat();
int /*<<< orphan*/ writeCommand(char *);
float firmwareVersion(void) {
  float version;
  writeCommand("FV");
  version = readFloat();
  return version;
}


x86 assembly (clang, -O0):
<firmwareVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <writeCommand@plt>
mov    $0x0,%al
call   1040 <readFloat@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<firmwareVersion>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <writeCommand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <readFloat@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"FV\00"
define float @firmwareVersion() {
%1 = alloca float
%2 = call i32 @writeCommand(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = call float (...) @readFloat()
store float %3, float* %1
%4 = load float, float* %1
ret float %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"FV\00"
define float @firmwareVersion() {
%1 = tail call i32 @writeCommand(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call float (...) @readFloat()
ret float %2
}
int main(void) {
  long long i;
  unsigned long long u;
  i = 1;
  i = -1;
  i = -1l;
  i = -1u;
  i = -1ll;
  i = -1ll & 3;
  i = -1ll < 0;
  u = 1;
  u = -1;
  u = -1l;
  u = -1u;
  u = -1ll;
  u = -1llu & 3;
  u = -1llu < 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    $0xffffffff,%eax
mov    %rax,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
movq   $0x3,-0x10(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
mov    $0xffffffff,%eax
mov    %rax,-0x18(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
movq   $0x3,-0x18(%rbp)
movq   $0x0,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %2
store i64 -1, i64* %2
store i64 -1, i64* %2
store i64 4294967295, i64* %2
store i64 -1, i64* %2
store i64 3, i64* %2
store i64 1, i64* %2
store i64 1, i64* %3
store i64 -1, i64* %3
store i64 -1, i64* %3
store i64 4294967295, i64* %3
store i64 -1, i64* %3
store i64 3, i64* %3
store i64 0, i64* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct terminal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_cursor(struct terminal *, int, int /*<<< orphan*/);
void nl(struct terminal *term, void *arg) { move_cursor(term, 1, 0); }


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

x86 assembly (clang, -O2):
<nl>:
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <move_cursor@plt>

LLVM IR (-O0):
%struct.terminal = type { i32 }
define void @nl(%struct.terminal* %0, i8* %1) {
%3 = alloca %struct.terminal*
%4 = alloca i8*
store %struct.terminal* %0, %struct.terminal** %3
store i8* %1, i8** %4
%5 = load %struct.terminal*, %struct.terminal** %3
%6 = call i32 @move_cursor(%struct.terminal* %5, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
define void @nl(%struct.terminal* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @move_cursor(%struct.terminal* %0, i32 1, i32 0)
ret void
}
/* Variables and functions */
int f133(int *);
int f134(int *p) { return f133(p); }


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

x86 assembly (clang, -O2):
<f134>:
jmp    1030 <f133@plt>

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

LLVM IR (-O2):
define i32 @f134(i32* %0) {
%2 = tail call i32 @f133(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ PutBits(int, int /*<<< orphan*/);
int /*<<< orphan*/ SendBlock();
void HufEncodeEnd() {
  SendBlock();
  PutBits(8 - 1, 0);
  return;
}


x86 assembly (clang, -O0):
<HufEncodeEnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <SendBlock@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <PutBits@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HufEncodeEnd>:
push   %rax
xor    %eax,%eax
call   1040 <SendBlock@plt>
mov    $0x7,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <PutBits@plt>

LLVM IR (-O0):
define void @HufEncodeEnd() {
%1 = call i32 (...) @SendBlock()
%2 = call i32 @PutBits(i32 7, i32 0)
ret void
}

LLVM IR (-O2):
define void @HufEncodeEnd() {
%1 = tail call i32 (...) @SendBlock()
%2 = tail call i32 @PutBits(i32 7, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _uniq_error(char const *message, int ret) {
  fputs("uniq"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_uniq_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_uniq_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"uniq: \00"
@stderr = global i32 0
define i32 @_uniq_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"uniq: \00"
@stderr = global i32 0
define i32 @_uniq_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ dputchar(char const);
void dputs(const char *str) {
  while (*str) {
    dputchar(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<dputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <dputs+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <dputchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <dputs+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dputs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <dputs+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <dputchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <dputs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @dputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @dputchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run_bin(char const *);
int main(int argc, const char *argv[]) {
  if (argc < 2)
    return 0;
  run_bin(argv[1]);
  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)
cmpl   $0x2,-0x8(%rbp)
jge    113c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1150 <main+0x40>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <run_bin@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     1123 <main+0x13>
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <run_bin@plt>
add    $0x8,%rsp
xor    %eax,%eax
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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @run_bin(i8* %12)
store i32 0, i32* %3
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @run_bin(i8* %6)
br label %8
8: ; preds = %2, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_stub_without_call_stub() {
  printf("test_stub_without_call_stub\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<test_stub_without_call_stub>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [28 x i8] c"test_stub_without_call_stub\00"
define i32 @test_stub_without_call_stub() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int fun555() { return 555; }


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

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

LLVM IR (-O0):
define i32 @fun555() {
ret i32 555
}

LLVM IR (-O2):
define i32 @fun555() {
ret i32 555
}
int CanFormTriangle(double a, double b, double c) {
  if (a + b <= c)
    return 0;
  if (a + c <= b)
    return 0;
  if (b + c <= a)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<CanFormTriangle>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1138 <CanFormTriangle+0x38>
movl   $0x0,-0x4(%rbp)
jmp    1189 <CanFormTriangle+0x89>
movsd  -0x10(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     115d <CanFormTriangle+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1189 <CanFormTriangle+0x89>
movsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1182 <CanFormTriangle+0x82>
movl   $0x0,-0x4(%rbp)
jmp    1189 <CanFormTriangle+0x89>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CanFormTriangle>:
movapd %xmm0,%xmm3
addsd  %xmm1,%xmm3
ucomisd %xmm3,%xmm2
setb   %al
movapd %xmm0,%xmm3
addsd  %xmm2,%xmm3
ucomisd %xmm3,%xmm1
setb   %cl
and    %al,%cl
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
setb   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @CanFormTriangle(double %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fadd double %8, %9
%11 = load double, double* %7
%12 = fcmp ole double %10, %11
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 0, i32* %4
br label %29
14: ; preds = %3
%15 = load double, double* %5
%16 = load double, double* %7
%17 = fadd double %15, %16
%18 = load double, double* %6
%19 = fcmp ole double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 0, i32* %4
br label %29
21: ; preds = %14
%22 = load double, double* %6
%23 = load double, double* %7
%24 = fadd double %22, %23
%25 = load double, double* %5
%26 = fcmp ole double %24, %25
br i1 %26, label %27, label %28
27: ; preds = %21
store i32 0, i32* %4
br label %29
28: ; preds = %21
store i32 1, i32* %4
br label %29
29: ; preds = %28, %27, %20, %13
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @CanFormTriangle(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fcmp ugt double %4, %2
%6 = fadd double %0, %2
%7 = fcmp ugt double %6, %1
%8 = and i1 %5, %7
%9 = fadd double %1, %2
%10 = fcmp ugt double %9, %0
%11 = and i1 %10, %8
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
struct pevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pevent_free(struct pevent *);
void pevent_unref(struct pevent *pevent) { pevent_free(pevent); }


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

x86 assembly (clang, -O2):
<pevent_unref>:
jmp    1030 <pevent_free@plt>

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

LLVM IR (-O2):
%struct.pevent = type { i32 }
define void @pevent_unref(%struct.pevent* %0) {
%2 = tail call i32 @pevent_free(%struct.pevent* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ t1();
int /*<<< orphan*/ t2();
int /*<<< orphan*/ t3();
int /*<<< orphan*/ t4();
int /*<<< orphan*/ t5();
int /*<<< orphan*/ t6();
void testmain() {
  print("declaration");
  t1();
  t2();
  t3();
  t4();
  t5();
  t6();
}


x86 assembly (clang, -O0):
<testmain>:
push   %rbp
mov    %rsp,%rbp
lea    0xe85(%rip),%rdi
call   1060 <print@plt>
mov    $0x0,%al
call   1030 <t1@plt>
mov    $0x0,%al
call   1070 <t2@plt>
mov    $0x0,%al
call   1040 <t3@plt>
mov    $0x0,%al
call   1080 <t4@plt>
mov    $0x0,%al
call   1050 <t5@plt>
mov    $0x0,%al
call   1090 <t6@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testmain>:
push   %rax
lea    0xe88(%rip),%rdi
call   1060 <print@plt>
xor    %eax,%eax
call   1030 <t1@plt>
xor    %eax,%eax
call   1070 <t2@plt>
xor    %eax,%eax
call   1040 <t3@plt>
xor    %eax,%eax
call   1080 <t4@plt>
xor    %eax,%eax
call   1050 <t5@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <t6@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"declaration\00"
define void @testmain() {
%1 = call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @t1()
%3 = call i32 (...) @t2()
%4 = call i32 (...) @t3()
%5 = call i32 (...) @t4()
%6 = call i32 (...) @t5()
%7 = call i32 (...) @t6()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"declaration\00"
define void @testmain() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @t1()
%3 = tail call i32 (...) @t2()
%4 = tail call i32 (...) @t3()
%5 = tail call i32 (...) @t4()
%6 = tail call i32 (...) @t5()
%7 = tail call i32 (...) @t6()
ret void
}
_Atomic(int) compound_and(_Atomic(int) in) { return (in &= 5); }


x86 assembly (clang, -O0):
<compound_and>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
and    $0x5,%ecx
lock cmpxchg %ecx,-0x4(%rbp)
sete   %cl
mov    %eax,-0xc(%rbp)
test   $0x1,%cl
mov    %eax,-0x8(%rbp)
jne    1131 <compound_and+0x31>
jmp    110d <compound_and+0xd>
mov    -0xc(%rbp),%eax
and    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compound_and>:
mov    %edi,%eax
mov    %edi,-0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
and    $0x5,%ecx
lock cmpxchg %ecx,-0x4(%rsp)
jne    1110 <compound_and+0x10>
and    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @compound_and(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = atomicrmw and i32* %2, i32 5 seq_cst
%4 = and i32 %3, 5
ret i32 %4
}

LLVM IR (-O2):
define i32 @compound_and(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = atomicrmw and i32* %2, i32 5 seq_cst
%4 = and i32 %3, 5
ret i32 %4
}
void oc_random_destroy(void) {}


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

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

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

LLVM IR (-O2):
define void @oc_random_destroy() {
ret void
}
/* Variables and functions */
float get_overhead();
float peakbandwidth(float);
int /*<<< orphan*/ pmcr_init();
int /*<<< orphan*/ printf(char *, float);
int main() {
  float peakbandwidth_result;
  pmcr_init();
  float ccnt_overhead;
  ccnt_overhead = get_overhead();
  printf("Reading overhead time is : %f\n", ccnt_overhead);
  peakbandwidth_result = peakbandwidth(ccnt_overhead);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <pmcr_init@plt>
mov    $0x0,%al
call   1040 <get_overhead@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
call   1060 <peakbandwidth@plt>
movss  %xmm0,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <pmcr_init@plt>
xor    %eax,%eax
call   1040 <get_overhead@plt>
movss  %xmm0,0x4(%rsp)
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
call   1060 <peakbandwidth@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Reading overhead time is : %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (...) @pmcr_init()
%5 = call float (...) @get_overhead()
store float %5, float* %3
%6 = load float, float* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float %6)
%8 = load float, float* %3
%9 = call float @peakbandwidth(float %8)
store float %9, float* %2
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Reading overhead time is : %f\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @pmcr_init()
%2 = tail call float (...) @get_overhead()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float %2)
%4 = tail call float @peakbandwidth(float %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LCDClear(int);
void Clear_2_3() { LCDClear(1); }


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

x86 assembly (clang, -O2):
<Clear_2_3>:
mov    $0x1,%edi
jmp    1030 <LCDClear@plt>

LLVM IR (-O0):
define void @Clear_2_3() {
%1 = call i32 @LCDClear(i32 1)
ret void
}

LLVM IR (-O2):
define void @Clear_2_3() {
%1 = tail call i32 @LCDClear(i32 1)
ret void
}
int search_from_tail(int *array, int tam, int b, int target) {
  if (b < 0)
    return tam;
  if (array[b] == target)
    return b;
  return search_from_tail(array, tam, b - 1, target);
}


x86 assembly (clang, -O0):
<search_from_tail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    113a <search_from_tail+0x2a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <search_from_tail+0x61>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x1c(%rbp),%eax
jne    1159 <search_from_tail+0x49>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <search_from_tail+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
mov    -0x1c(%rbp),%ecx
call   1030 <search_from_tail@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_from_tail>:
mov    %esi,%eax
test   %edx,%edx
js     1121 <search_from_tail+0x21>
mov    %edx,%esi
lea    (%rdi,%rsi,4),%rsi
nopl   0x0(%rax)
cmp    %ecx,(%rsi)
je     1122 <search_from_tail+0x22>
lea    -0x1(%rdx),%edi
add    $0xfffffffffffffffc,%rsi
test   %edx,%edx
mov    %edi,%edx
jg     1110 <search_from_tail+0x10>
ret
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @search_from_tail(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %2, 0
br i1 %5, label %15, label %6
6: ; preds = %4, %12
%7 = phi i32 [ %13, %12 ], [ %2, %4 ]
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %3
br i1 %11, label %15, label %12
12: ; preds = %6
%13 = add nsw i32 %7, -1
%14 = icmp slt i32 %7, 1
br i1 %14, label %15, label %6
15: ; preds = %12, %6, %4
%16 = phi i32 [ %1, %4 ], [ %7, %6 ], [ %1, %12 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ BlinkC__Leds__led2Toggle();
void BlinkC__Timer2__fired(void) { BlinkC__Leds__led2Toggle(); }


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

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

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

LLVM IR (-O2):
define void @BlinkC__Timer2__fired() {
%1 = tail call i32 (...) @BlinkC__Leds__led2Toggle()
ret void
}
/* Variables and functions */
int sched_yield(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sched_yield() {
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t __bswap_16(uint16_t x) {
  return (((x & 0xff00) >> 8) | ((x & 0x00ff) << 8));
}


x86 assembly (clang, -O0):
<__bswap_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bswap_16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @__bswap_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__bswap_16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
__typeof__(strlen((void *)1)) test_strlen_194(void) {
  return strlen((void *)1);
}


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

x86 assembly (clang, -O2):
<test_strlen_194>:
mov    $0x1,%edi
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i64 @test_strlen_194() {
%1 = call i64 @strlen(i8* inttoptr (i64 1 to i8*))
ret i64 %1
}

LLVM IR (-O2):
define i64 @test_strlen_194() {
%1 = tail call i64 @strlen(i8* inttoptr (i64 1 to i8*))
ret i64 %1
}
void Dummyfunc(void) {}


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

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

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

LLVM IR (-O2):
define void @Dummyfunc() {
ret void
}
int Clamp8b(int val) {
  const int min_val = 0;
  const int max_val = 0xff;
  return (val < min_val) ? min_val : (val > max_val) ? max_val : val;
}


x86 assembly (clang, -O0):
<Clamp8b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xff,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1129 <Clamp8b+0x29>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    114f <Clamp8b+0x4f>
cmpl   $0xff,-0x4(%rbp)
jle    1143 <Clamp8b+0x43>
mov    $0xff,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <Clamp8b+0x49>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Clamp8b>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Clamp8b(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
A0AR1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((*((short *)10000000)) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<A0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movswl (%rax),%eax
mov    -0x20(%rbp),%rcx
movswl 0x87a22(%rcx),%ecx
cmp    %ecx,%eax
jg     1146 <A0AR1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <A0AR1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A0AR1>:
movzwl 0x989680,%ecx
xor    %eax,%eax
cmp    0x87a22(%r9),%cx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @A0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = load i16, i16* inttoptr (i64 10000000 to i16*)
%8 = getelementptr inbounds i16, i16* %5, i64 277777
%9 = load i16, i16* %8
%10 = icmp sle i16 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}