xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t pbbase64_decoded_length(size_t n) { return (n * 3 + 3) / 4; }


x86 assembly (clang, -O0):
<pbbase64_decoded_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x3,-0x8(%rbp),%rax
add    $0x3,%rax
shr    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbbase64_decoded_length>:
lea    (%rdi,%rdi,2),%rax
add    $0x3,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @pbbase64_decoded_length(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 3
%5 = add i64 %4, 3
%6 = udiv i64 %5, 4
ret i64 %6
}

LLVM IR (-O2):
define i64 @pbbase64_decoded_length(i64 %0) {
%2 = mul i64 %0, 3
%3 = add i64 %2, 3
%4 = lshr i64 %3, 2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a, b, c = 0;
  const int r = 89;
  a = 10, b = 20;
  printf("Sum is: %d\n", b + a);
  float bb = 78.9090;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x59,-0x14(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0xc(%rbp),%esi
add    -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
movss  0xeab(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Sum is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 0, i32* %1
store i32 0, i32* %4
store i32 89, i32* %5
store i32 10, i32* %2
store i32 20, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9)
store float 0x4053BA2D00000000, float* %6
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Sum is: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 30)
ret i32 0
}
int generic_noop(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @generic_noop() {
ret i32 0
}
void rop3_118_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = ~S;
  stk3 = T & stk4;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_118_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xe(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xe(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_118_0_0>:
mov    %esi,%eax
not    %al
and    %dl,%al
or     (%rdi),%al
xor    %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_118_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = load i8, i8* %10
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %9
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = load i8, i8* %9
%25 = zext i8 %24 to i32
%26 = or i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %8
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = load i8, i8* %8
%31 = zext i8 %30 to i32
%32 = xor i32 %29, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = load i8*, i8** %4
store i8 %34, i8* %35
ret void
}

LLVM IR (-O2):
define void @rop3_118_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = and i8 %4, %2
%6 = load i8, i8* %0
%7 = or i8 %6, %5
%8 = xor i8 %7, %1
store i8 %8, i8* %0
ret void
}
int search(int value, int values[], int n) {
  for (int i = 0; i < n; i++)
    if (value == values[i])
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <search+0x54>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1141 <search+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <search+0x5b>
jmp    1146 <search+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <search+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
test   %edx,%edx
jle    113a <search+0x3a>
mov    $0x1,%eax
cmp    %edi,(%rsi)
je     1139 <search+0x39>
mov    %edx,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rdx
cmp    %rax,%rcx
je     1131 <search+0x31>
lea    0x1(%rdx),%rax
cmp    %edi,(%rsi,%rdx,4)
jne    1120 <search+0x20>
xor    %eax,%eax
cmp    %rcx,%rdx
setb   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @search(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* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %23, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load i32, i32* %5
%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 = icmp eq i32 %14, %19
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 1, i32* %4
br label %27
22: ; preds = %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %9
26: ; preds = %9
store i32 0, i32* %4
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @search(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %21
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = zext i32 %2 to i64
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, %0
br i1 %9, label %21, label %10
10: ; preds = %5, %13
%11 = phi i64 [ %17, %13 ], [ 1, %5 ]
%12 = icmp eq i64 %11, %7
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = getelementptr inbounds i32, i32* %1, i64 %11
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, %0
%17 = add nuw nsw i64 %11, 1
br i1 %16, label %18, label %10
18: ; preds = %10, %13
%19 = icmp ult i64 %11, %6
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %18, %5, %3
%22 = phi i32 [ 0, %3 ], [ 1, %5 ], [ %20, %18 ]
ret i32 %22
}
float version() { return 1.5; }


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @version() {
ret float 1.500000e+00
}

LLVM IR (-O2):
define float @version() {
ret float 1.500000e+00
}
void strCpy(char s1[], char s2[]) {
  int i;
  for (i = 0; s2[i] != '\0'; i++)
    s1[i] = s2[i];
  s1[i] = 0;
  return;
}


x86 assembly (clang, -O0):
<strCpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <strCpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%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    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strCpy>:
mov    (%rsi),%al
test   %al,%al
je     1127 <strCpy+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rdi,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <strCpy+0x10>
mov    %ecx,%eax
movb   $0x0,(%rdi,%rax,1)
ret
xor    %eax,%eax
movb   $0x0,(%rdi,%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 = %24, %2
%7 = load i8*, i8** %4
%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 %27
14: ; preds = %6
%15 = load i8*, i8** %4
%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** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 %19, i8* %23
br label %24
24: ; preds = %14
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %6
27: ; preds = %6
%28 = load i8*, i8** %3
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
store i8 0, i8* %31
ret void
}

LLVM IR (-O2):
define void @strCpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%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* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, 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* %0, i64 %16
store i8 0, i8* %17
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_ToRadians_init(void) {
  _hmt_register_covercase("HMM_ToRadians", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_ToRadians_init>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"HMM_ToRadians\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_ToRadians_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"HMM_ToRadians\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_ToRadians_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int cmd_print_env(char *arg_list[], int n) {
  sw_printf("\nstart run %s...\n\n\r", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<cmd_print_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x0,%al
call   1030 <sw_printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"\0Astart run %s...\0A\0A\0D\00"
@__func__.cmd_print_env = [14 x i8] c"cmd_print_env\00"
define i32 @cmd_print_env(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @sw_printf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.cmd_print_env, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0Astart run %s...\0A\0A\0D\00"
@__func__.cmd_print_env = [14 x i8] c"cmd_print_env\00"
define i32 @cmd_print_env(i8** nocapture readnone %0, i32 %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @sw_printf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.cmd_print_env, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
int fmyinput(char *prmpt, char *ibuf, int maxlen) {
  printf("%s", prmpt);
  fgets(ibuf, maxlen + 1, stdin);
  ibuf[strlen(ibuf) - 1] = 0;
  return (strlen(ibuf));
}


x86 assembly (clang, -O0):
<fmyinput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    0x2e84(%rip),%rax
mov    (%rax),%edx
call   1050 <fgets@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmyinput>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
add    $0x1,%ebp
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
define i32 @fmyinput(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
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 1
%12 = load i32, i32* @stdin
%13 = call i32 @fgets(i8* %9, i32 %11, i32 %12)
%14 = load i8*, i8** %5
%15 = load i8*, i8** %5
%16 = call i32 @strlen(i8* %15)
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %14, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %5
%21 = call i32 @strlen(i8* %20)
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
define i32 @fmyinput(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = add nsw i32 %2, 1
%6 = load i32, i32* @stdin
%7 = tail call i32 @fgets(i8* %1, i32 %5, i32 %6)
%8 = tail call i32 @strlen(i8* %1)
%9 = add nsw i32 %8, -1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %1, i64 %10
store i8 0, i8* %11
%12 = tail call i32 @strlen(i8* %1)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a = 0;
  int *p = &a;
  int i;
  for (i = 0; i < 10; i++) {
  }
  *p = 10;
  assert(a == 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1152 <main+0x42>
jmp    1144 <main+0x34>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <main+0x25>
mov    -0x10(%rbp),%rax
movl   $0xa,(%rax)
cmpl   $0xa,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SPIM_1_DisableRxInt();
int /*<<< orphan*/ SPIM_1_DisableTxInt();
void SPIM_1_DisableInt(void) {
  SPIM_1_DisableTxInt();
  SPIM_1_DisableRxInt();
}


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

x86 assembly (clang, -O2):
<SPIM_1_DisableInt>:
push   %rax
xor    %eax,%eax
call   1040 <SPIM_1_DisableTxInt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <SPIM_1_DisableRxInt@plt>

LLVM IR (-O0):
define void @SPIM_1_DisableInt() {
%1 = call i32 (...) @SPIM_1_DisableTxInt()
%2 = call i32 (...) @SPIM_1_DisableRxInt()
ret void
}

LLVM IR (-O2):
define void @SPIM_1_DisableInt() {
%1 = tail call i32 (...) @SPIM_1_DisableTxInt()
%2 = tail call i32 (...) @SPIM_1_DisableRxInt()
ret void
}
int prime(int n) {
  int f = 0;
  for (int i = 2; i < n; ++i) {
    if (n % i == 0) {
      f = 1;
      break;
    }
  }
  return f;
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1150 <prime+0x50>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113d <prime+0x3d>
movl   $0x1,-0x8(%rbp)
jmp    1150 <prime+0x50>
jmp    1142 <prime+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <prime+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
xor    %ecx,%ecx
cmp    $0x3,%edi
jl     1120 <prime+0x20>
mov    $0x2,%esi
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <prime+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%ecx
mov    %ecx,%eax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void copylines(FILE *input, FILE *output) {
  char buffer[1024];
  while (fgets(buffer, 1024, input) != NULL)
    fputs(buffer, output);
}


x86 assembly (clang, -O0):
<copylines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1167 <copylines+0x47>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fputs@plt>
jmp    1133 <copylines+0x13>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copylines>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%rdi
mov    $0x400,%esi
mov    %r15,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     1170 <copylines+0x50>
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fputs@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r15,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
jne    1150 <copylines+0x30>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @copylines(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1024 x i8]
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %11, %2
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%8 = load i32*, i32** %3
%9 = call i32* @fgets(i8* %7, i32 1024, i32* %8)
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%13 = load i32*, i32** %4
%14 = call i32 @fputs(i8* %12, i32* %13)
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @copylines(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32* @fgets(i8* %4, i32 1024, i32* %0)
%6 = icmp eq i32* %5, null
br i1 %6, label %11, label %7
7: ; preds = %2, %7
%8 = call i32 @fputs(i8* %4, i32* %1)
%9 = call i32* @fgets(i8* %4, i32 1024, i32* %0)
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %7
11: ; preds = %7, %2
ret void
}
/* Variables and functions */
int ENXIO;
int pm8921_bms_cc_uah(int *cc_uah) { return -ENXIO; }


x86 assembly (clang, -O0):
<pm8921_bms_cc_uah>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8921_bms_cc_uah>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @pm8921_bms_cc_uah(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENXIO
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
char *strchr(char const *, int);
size_t strlen(char const *);
const char *mystrchrnul(const char *s, int c) {
  const char *r = strchr(s, c);
  if (!r) {
    return &s[strlen(s)];
  }
  return r;
}


x86 assembly (clang, -O0):
<mystrchrnul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116e <mystrchrnul+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <mystrchrnul+0x56>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrchrnul>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strchr@plt>
test   %rax,%rax
je     1130 <mystrchrnul+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mystrchrnul(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i8* @strchr(i8* %7, i32 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %17, label %12
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i8*, i8** %4
%15 = call i64 @strlen(i8* %14)
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8* %16, i8** %3
br label %19
17: ; preds = %2
%18 = load i8*, i8** %6
store i8* %18, i8** %3
br label %19
19: ; preds = %17, %12
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @mystrchrnul(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%7 = getelementptr inbounds i8, i8* %0, i64 %6
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ %3, %2 ]
ret i8* %9
}
/* Variables and functions */
int cc2400_get(int);
int /*<<< orphan*/ cc2400_set(int, int);
void cc2400_reset() {
  cc2400_set(0x00, 0x0000);
  while (cc2400_get(0x00) != 0x0000)
    ;
  cc2400_set(0x00, 0x8000);
  while (cc2400_get(0x00) != 0x8000)
    ;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1040 <cc2400_set@plt>
xor    %edi,%edi
call   1030 <cc2400_get@plt>
cmp    $0x0,%eax
je     1142 <cc2400_reset+0x22>
jmp    112d <cc2400_reset+0xd>
xor    %edi,%edi
mov    $0x8000,%esi
call   1040 <cc2400_set@plt>
xor    %edi,%edi
call   1030 <cc2400_get@plt>
cmp    $0x8000,%eax
je     1165 <cc2400_reset+0x45>
jmp    114e <cc2400_reset+0x2e>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <cc2400_set@plt>
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <cc2400_get@plt>
test   %eax,%eax
jne    1130 <cc2400_reset+0x10>
xor    %edi,%edi
mov    $0x8000,%esi
call   1040 <cc2400_set@plt>
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <cc2400_get@plt>
cmp    $0x8000,%eax
jne    1150 <cc2400_reset+0x30>
pop    %rax
ret

LLVM IR (-O0):
define void @cc2400_reset() {
%1 = call i32 @cc2400_set(i32 0, i32 0)
br label %2
2: ; preds = %5, %0
%3 = call i32 @cc2400_get(i32 0)
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
%7 = call i32 @cc2400_set(i32 0, i32 32768)
br label %8
8: ; preds = %11, %6
%9 = call i32 @cc2400_get(i32 0)
%10 = icmp ne i32 %9, 32768
br i1 %10, label %11, label %12
11: ; preds = %8
br label %8
12: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @cc2400_reset() {
%1 = tail call i32 @cc2400_set(i32 0, i32 0)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @cc2400_get(i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
%6 = tail call i32 @cc2400_set(i32 0, i32 32768)
br label %7
7: ; preds = %7, %5
%8 = tail call i32 @cc2400_get(i32 0)
%9 = icmp eq i32 %8, 32768
br i1 %9, label %10, label %7
10: ; preds = %7
ret void
}
/* Variables and functions */
unsigned int __raw_readl(unsigned int);
int /*<<< orphan*/ __raw_writel(unsigned int, unsigned int);
void __raw_bits_and(unsigned int v, unsigned int a) {
  __raw_writel((__raw_readl(a) & v), a);
}


x86 assembly (clang, -O0):
<__raw_bits_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <__raw_readl@plt>
mov    %eax,%edi
and    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <__raw_writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__raw_bits_and>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <__raw_readl@plt>
and    %eax,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__raw_writel@plt>

LLVM IR (-O0):
define void @__raw_bits_and(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @__raw_readl(i32 %5)
%7 = load i32, i32* %3
%8 = and i32 %6, %7
%9 = load i32, i32* %4
%10 = call i32 @__raw_writel(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @__raw_bits_and(i32 %0, i32 %1) {
%3 = tail call i32 @__raw_readl(i32 %1)
%4 = and i32 %3, %0
%5 = tail call i32 @__raw_writel(i32 %4, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ test_point_addition(unsigned int);
void check_add_point_point(unsigned int number_of_tests) {
  printf("Point addition:\n");
  if (test_point_addition(number_of_tests)) {
    printf("Success\n");
  } else {
    printf("Failed\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<check_add_point_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <test_point_addition@plt>
cmp    $0x0,%rax
je     115a <check_add_point_point+0x3a>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <check_add_point_point+0x46>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_add_point_point>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
call   1050 <test_point_addition@plt>
test   %rax,%rax
lea    0xec0(%rip),%rax
lea    0xec0(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Point addition:\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
@.str.2 = [8 x i8] c"Failed\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @check_add_point_point(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i64 @test_point_addition(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Point addition:\00"
@str.4 = [7 x i8] c"Failed\00"
@str.5 = [8 x i8] c"Success\00"
define void @check_add_point_point(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = tail call i64 @test_point_addition(i32 %0)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
%7 = tail call i32 @putchar(i32 10)
ret void
}
void dummyvideo_ChangeWindow(void) {}


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

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

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

LLVM IR (-O2):
define void @dummyvideo_ChangeWindow() {
ret void
}
/* Type definitions */
struct theft_bloom {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct theft_bloom *);
void theft_bloom_free(struct theft_bloom *b) { free(b); }


x86 assembly (clang, -O0):
<theft_bloom_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):
<theft_bloom_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.theft_bloom = type { i32 }
define void @theft_bloom_free(%struct.theft_bloom* nocapture %0) {
%2 = tail call i32 @free(%struct.theft_bloom* %0)
ret void
}
int __attribute__((__ms_abi__)) test(int i) { return i; }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
push   %rax
mov    %ecx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define win64cc i32 @test(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct allocation_header {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_internal(char *, struct allocation_header *);
struct allocation_header *get_header(char *, void *);
int /*<<< orphan*/ lock();
int /*<<< orphan*/ unlock();
void free(void *ptr) {
  if (ptr == NULL)
    return;
  lock();
  struct allocation_header *header = get_header("free", ptr);
  free_internal("free", header);
  unlock();
}


x86 assembly (clang, -O0):
<free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115c <free+0x1c>
jmp    118e <free+0x4e>
mov    $0x0,%al
call   1040 <lock@plt>
mov    -0x8(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1050 <get_header@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1060 <free_internal@plt>
mov    $0x0,%al
call   1030 <unlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free>:
test   %rdi,%rdi
je     117e <free+0x3e>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <lock@plt>
lea    0xea6(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <get_header@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1060 <free_internal@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <unlock@plt>
ret

LLVM IR (-O0):
%struct.allocation_header = type { i32 }
@.str = [5 x i8] c"free\00"
define void @free(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.allocation_header*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %14
7: ; preds = %1
%8 = call i32 (...) @lock()
%9 = load i8*, i8** %2
%10 = call %struct.allocation_header* @get_header(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %9)
store %struct.allocation_header* %10, %struct.allocation_header** %3
%11 = load %struct.allocation_header*, %struct.allocation_header** %3
%12 = call i32 @free_internal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.allocation_header* %11)
%13 = call i32 (...) @unlock()
br label %14
14: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.allocation_header = type { i32 }
@.str = [5 x i8] c"free\00"
define void @free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 (...) @lock()
%5 = tail call %struct.allocation_header* @get_header(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @free_internal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.allocation_header* %5)
%7 = tail call i32 (...) @unlock()
br label %8
8: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void isa_write_8(uint16_t port, uint8_t val) {
  volatile uint8_t *addr = ((volatile uint8_t *)0x14000000 + 0x80000000) + port;
  *addr = val;
}


x86 assembly (clang, -O0):
<isa_write_8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rcx
mov    $0x14000000,%eax
movabs $0x200000000,%rdx
add    %rdx,%rax
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<isa_write_8>:
movslq %edi,%rax
movabs $0x214000000,%rcx
mov    %esi,(%rcx,%rax,4)
ret

LLVM IR (-O0):
define void @isa_write_8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* getelementptr inbounds (i32, i32* inttoptr (i64 335544320 to i32*), i64 2147483648), i64 %7
store i32* %8, i32** %5
%9 = load i32, i32* %4
%10 = load i32*, i32** %5
store volatile i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @isa_write_8(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* inttoptr (i64 8925478912 to i32*), i64 %3
store volatile i32 %1, i32* %4
ret void
}
/* Variables and functions */
int ctest_main(int, char const **);
int main(int argc, const char **argv) { return ctest_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <ctest_main@plt>

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 = load i8**, i8*** %5
%8 = call i32 @ctest_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ctest_main(i32 %0, i8** %1)
ret i32 %3
}
char *strbuf(s)
char *s;
{ return (s); }


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

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

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

LLVM IR (-O2):
define i8* @strbuf(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ writes(char *);
void writenl(void) { writes("\012"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @writenl() {
%1 = tail call i32 @writes(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void xed_derror(const char *s) {
  do {
    do {
    } while (0);
  } while (0);
  (void)s;
}


x86 assembly (clang, -O0):
<xed_derror>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    110d <xed_derror+0xd>
jmp    1112 <xed_derror+0x12>
jmp    1117 <xed_derror+0x17>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @xed_derror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
br label %5
5: ; preds = %4
br label %6
6: ; preds = %5
%7 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @xed_derror(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ROL_();
int /*<<< orphan*/ c64_memZeroX();
void ROL_zpx(void) {
  c64_memZeroX();
  ROL_();
}


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

x86 assembly (clang, -O2):
<ROL_zpx>:
push   %rax
xor    %eax,%eax
call   1040 <c64_memZeroX@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ROL_@plt>

LLVM IR (-O0):
define void @ROL_zpx() {
%1 = call i32 (...) @c64_memZeroX()
%2 = call i32 (...) @ROL_()
ret void
}

LLVM IR (-O2):
define void @ROL_zpx() {
%1 = tail call i32 (...) @c64_memZeroX()
%2 = tail call i32 (...) @ROL_()
ret void
}
short int cast_int_short_fast(int x) { return (short int)x; }


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

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

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

LLVM IR (-O2):
define signext i16 @cast_int_short_fast(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
void av_packet_make_refcounted() {}


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

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

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

LLVM IR (-O2):
define void @av_packet_make_refcounted() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void name_arg_bye(char *s) {
  fprintf(stderr, "%s\n", s);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @name_arg_bye(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t TimerLoadGet(uint32_t ui32Base, uint32_t ui32Timer) {
  ;
  ;
  return ((ui32Timer == 0x000000ff)
              ? (*((volatile unsigned long *)(ui32Base + 0x00000028)))
              : (*((volatile unsigned long *)(ui32Base + 0x0000002C))));
}


x86 assembly (clang, -O0):
<TimerLoadGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jne    112b <TimerLoadGet+0x2b>
mov    -0x4(%rbp),%eax
add    $0x28,%eax
cltq
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    113a <TimerLoadGet+0x3a>
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerLoadGet>:
xor    %eax,%eax
cmp    $0xff,%esi
setne  %al
lea    0x28(,%rax,4),%eax
movslq %edi,%rcx
mov    (%rax,%rcx,1),%rax
ret

LLVM IR (-O0):
define i32 @TimerLoadGet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 255
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 40
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
br label %19
13: ; preds = %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 44
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
br label %19
19: ; preds = %13, %7
%20 = phi i64 [ %12, %7 ], [ %18, %13 ]
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @TimerLoadGet(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 255
%4 = select i1 %3, i32 40, i32 44
%5 = add nsw i32 %4, %0
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = trunc i64 %8 to i32
ret i32 %9
}
unsigned short int bytevector_to_word(unsigned char *bytevector) {
  return ((unsigned short int)bytevector[1] << 8) + bytevector[2];
}


x86 assembly (clang, -O0):
<bytevector_to_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
movzwl %ax,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytevector_to_word>:
movzwl 0x1(%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @bytevector_to_word(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = add nsw i32 %8, %12
%14 = trunc i32 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @bytevector_to_word(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = or i16 %5, %8
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
void clear_kb(void) {
  char junk[80];
  gets(junk);
}


x86 assembly (clang, -O0):
<clear_kb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
call   1030 <gets@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_kb>:
sub    $0x58,%rsp
mov    %rsp,%rdi
call   1030 <gets@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
define void @clear_kb() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
ret void
}

LLVM IR (-O2):
define void @clear_kb() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn_glutSwapBuffers();
void glutSwapBuffers() { fn_glutSwapBuffers(); }


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

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

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

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