xunge/DecIR huggingface dataset:
void pil_force_shutdown(const char *name) {}


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

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

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

LLVM IR (-O2):
define void @pil_force_shutdown(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void wait() { getc(stdin); }


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define void @wait() {
%1 = load i32, i32* @stdin
%2 = call i32 @getc(i32 %1)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @wait() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @getc(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IsAlphaNumeric(char);
int /*<<< orphan*/ IsBlank(char);
scalar_t__ NotEoln(char);
int IsOther(char c) { return !IsAlphaNumeric(c) && !IsBlank(c) && NotEoln(c); }


x86 assembly (clang, -O0):
<IsOther>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <IsAlphaNumeric@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    1183 <IsOther+0x53>
movsbl -0x1(%rbp),%edi
call   1040 <IsBlank@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    1183 <IsOther+0x53>
movsbl -0x1(%rbp),%edi
call   1050 <NotEoln@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsOther>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <IsAlphaNumeric@plt>
xor    %ebx,%ebx
test   %eax,%eax
jne    115e <IsOther+0x2e>
movsbl %bpl,%ebp
mov    %ebp,%edi
call   1040 <IsBlank@plt>
test   %eax,%eax
jne    115e <IsOther+0x2e>
mov    %ebp,%edi
call   1050 <NotEoln@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @IsOther(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @IsAlphaNumeric(i8 signext %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i32 @IsBlank(i8 signext %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = call i64 @NotEoln(i8 signext %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ false, %6 ], [ false, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @IsOther(i8 signext %0) {
%2 = tail call i32 @IsAlphaNumeric(i8 signext %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i32 @IsBlank(i8 signext %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @NotEoln(i8 signext %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
size_t strnlen(const char *s, size_t n) {
  size_t len = 0;
  while (*s != 0 && n) {
    len += 1;
    s += 1;
    n--;
  }
  return len;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1134 <strnlen+0x34>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1144 <strnlen+0x44>
jmp    116d <strnlen+0x6d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
je     1133 <strnlen+0x33>
test   %rsi,%rsi
je     1133 <strnlen+0x33>
add    $0xffffffffffffffff,%rsi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
je     1133 <strnlen+0x33>
cmp    %rcx,%rsi
mov    %rax,%rcx
jne    1120 <strnlen+0x20>
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp ne i8 %3, 0
%5 = icmp ne i64 %1, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %18
7: ; preds = %2, %7
%8 = phi i64 [ %11, %7 ], [ 0, %2 ]
%9 = phi i64 [ %13, %7 ], [ %1, %2 ]
%10 = phi i8* [ %12, %7 ], [ %0, %2 ]
%11 = add nuw i64 %8, 1
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = add i64 %9, -1
%14 = load i8, i8* %12
%15 = icmp ne i8 %14, 0
%16 = icmp ne i64 %13, 0
%17 = select i1 %15, i1 %16, i1 false
br i1 %17, label %7, label %18
18: ; preds = %7, %2
%19 = phi i64 [ 0, %2 ], [ %11, %7 ]
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_numeric_args(char *args) {
  if (args != NULL)
    free(args);
}


x86 assembly (clang, -O0):
<free_numeric_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_numeric_args+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_numeric_args>:
test   %rdi,%rdi
je     111a <free_numeric_args+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @free_numeric_args(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @free_numeric_args(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int syscall_fork();
int fork() { return syscall_fork(); }


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

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

LLVM IR (-O0):
define i32 @fork() {
%1 = call i32 (...) @syscall_fork()
ret i32 %1
}

LLVM IR (-O2):
define i32 @fork() {
%1 = tail call i32 (...) @syscall_fork()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ decryptfile();
int /*<<< orphan*/ encryptfile();
int main(int argc, const char *argv[]) {
  encryptfile();
  decryptfile();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @encryptfile()
%4 = tail call i32 (...) @decryptfile()
ret i32 0
}
char dispMasterFlg(int d) {
  if (d == 1) {
    return 'M';
  }
  if (d == 2) {
    return 'S';
  }
  return ' ';
}


x86 assembly (clang, -O0):
<dispMasterFlg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111a <dispMasterFlg+0x1a>
movb   $0x4d,-0x1(%rbp)
jmp    1131 <dispMasterFlg+0x31>
cmpl   $0x2,-0x8(%rbp)
jne    112d <dispMasterFlg+0x2d>
movb   $0x53,-0x1(%rbp)
jmp    1131 <dispMasterFlg+0x31>
movb   $0x20,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispMasterFlg>:
cmp    $0x2,%edi
mov    $0x53,%eax
mov    $0x20,%ecx
cmove  %eax,%ecx
cmp    $0x1,%edi
mov    $0x4d,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @dispMasterFlg(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 77, i8* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 83, i8* %2
br label %12
11: ; preds = %7
store i8 32, i8* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i8, i8* %2
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @dispMasterFlg(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8 83, i8 32
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8 77, i8 %3
ret i8 %5
}
void LCD_Char_1_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @LCD_Char_1_SaveConfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int rightrot(int, int);
int main(void) {
  assert(rightrot(24, 3) == 3);
  assert(rightrot(1, 16) == 65536);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x18,%edi
mov    $0x3,%esi
call   1030 <rightrot@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
mov    $0x10,%esi
call   1030 <rightrot@plt>
cmp    $0x10000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x18,%edi
mov    $0x3,%esi
call   1030 <rightrot@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x1,%edi
mov    $0x10,%esi
call   1030 <rightrot@plt>
xor    %edi,%edi
cmp    $0x10000,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @rightrot(i32 24, i32 3)
%3 = icmp eq i32 %2, 3
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @rightrot(i32 1, i32 16)
%7 = icmp eq i32 %6, 65536
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @rightrot(i32 24, i32 3)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @rightrot(i32 1, i32 16)
%6 = icmp eq i32 %5, 65536
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  extern int g;
  int v = 1;
  printf("g=%d\n", g);
  printf("%d\n", 2);
  printf("%d\n", v);
  printf("%d\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"g=%d\0A\00"
@g = external global i32
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = load i32, i32* @g
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
int sum(int a, int limit) {
  int n;
  n = ((limit - 1) / a);
  return a * (n * (n + 1) / 2);
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    -0x1(%rsi),%eax
cltd
idiv   %edi
lea    0x1(%rax),%ecx
imul   %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @sum(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* %4
%7 = sub nsw i32 %6, 1
%8 = load i32, i32* %3
%9 = sdiv i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
%14 = mul nsw i32 %11, %13
%15 = sdiv i32 %14, 2
%16 = mul nsw i32 %10, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sdiv i32 %3, %0
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %5, %4
%7 = sdiv i32 %6, 2
%8 = mul nsw i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRDD_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRDD_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRDD_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int e();
int main(void) { return e(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @e()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @e()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *clnt_spcreateerror(char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void clnt_pcreateerror(const char *s) {
  assert(s != NULL);
  (void)fprintf(stderr, "%s\n", clnt_spcreateerror(s));
}


x86 assembly (clang, -O0):
<clnt_pcreateerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <clnt_spcreateerror@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
lea    0xe90(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clnt_pcreateerror>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%ebp
mov    %rbx,%rdi
call   1030 <clnt_spcreateerror@plt>
lea    0xea4(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @clnt_pcreateerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %2
%9 = call i8* @clnt_spcreateerror(i8* %8)
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @clnt_pcreateerror(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i8* @clnt_spcreateerror(i8* %0)
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_JPEG_SetTargetWordCount(unsigned long dwCount) {
  dwCount >>= 2;
  VIM_HIF_SetReg8((0x0000 + 0x00B), (unsigned char)dwCount);
  VIM_HIF_SetReg8((0x0000 + 0x00A), (unsigned char)(dwCount >> 8));
  VIM_HIF_SetReg8((0x0000 + 0x009), (unsigned char)(dwCount >> 16));
  VIM_HIF_SetReg8((0x0000 + 0x008), (unsigned char)(dwCount >> 24));
}


x86 assembly (clang, -O0):
<VIM_JPEG_SetTargetWordCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xb,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
mov    $0xa,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
mov    $0x9,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
mov    $0x8,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_SetTargetWordCount>:
push   %rbx
mov    %rdi,%rbx
mov    %ebx,%eax
shr    $0x2,%eax
movzbl %al,%esi
mov    $0xb,%edi
call   1030 <VIM_HIF_SetReg8@plt>
mov    %ebx,%eax
shr    $0xa,%eax
movzbl %al,%esi
mov    $0xa,%edi
call   1030 <VIM_HIF_SetReg8@plt>
mov    %ebx,%eax
shr    $0x12,%eax
movzbl %al,%esi
mov    $0x9,%edi
call   1030 <VIM_HIF_SetReg8@plt>
shr    $0x1a,%rbx
movzbl %bl,%esi
mov    $0x8,%edi
pop    %rbx
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_JPEG_SetTargetWordCount(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 2
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i8
%7 = call i32 @VIM_HIF_SetReg8(i32 11, i8 zeroext %6)
%8 = load i64, i64* %2
%9 = lshr i64 %8, 8
%10 = trunc i64 %9 to i8
%11 = call i32 @VIM_HIF_SetReg8(i32 10, i8 zeroext %10)
%12 = load i64, i64* %2
%13 = lshr i64 %12, 16
%14 = trunc i64 %13 to i8
%15 = call i32 @VIM_HIF_SetReg8(i32 9, i8 zeroext %14)
%16 = load i64, i64* %2
%17 = lshr i64 %16, 24
%18 = trunc i64 %17 to i8
%19 = call i32 @VIM_HIF_SetReg8(i32 8, i8 zeroext %18)
ret void
}

LLVM IR (-O2):
define void @VIM_JPEG_SetTargetWordCount(i64 %0) {
%2 = lshr i64 %0, 2
%3 = trunc i64 %2 to i8
%4 = tail call i32 @VIM_HIF_SetReg8(i32 11, i8 zeroext %3)
%5 = lshr i64 %0, 10
%6 = trunc i64 %5 to i8
%7 = tail call i32 @VIM_HIF_SetReg8(i32 10, i8 zeroext %6)
%8 = lshr i64 %0, 18
%9 = trunc i64 %8 to i8
%10 = tail call i32 @VIM_HIF_SetReg8(i32 9, i8 zeroext %9)
%11 = lshr i64 %0, 26
%12 = trunc i64 %11 to i8
%13 = tail call i32 @VIM_HIF_SetReg8(i32 8, i8 zeroext %12)
ret void
}
__attribute__((no, noclone)) void f3(unsigned int v) {
  unsigned int x = -214748365U * (v - 1);
  if (x != -1932735285U)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
imul   $0xf3333333,%eax,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x8ccccccb,-0x8(%rbp)
je     113c <f3+0x2c>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
imul   $0xf3333333,%edi,%eax
cmp    $0x7ffffffe,%eax
jne    111e <f3+0xe>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub i32 %4, 1
%6 = mul i32 -214748365, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, -1932735285
br i1 %8, label %9, label %10
9: ; preds = %1
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f3(i32 %0) {
%2 = mul i32 %0, -214748365
%3 = icmp eq i32 %2, 2147483646
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @abort()
unreachable
5: ; preds = %1
ret void
}
void UART0_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @UART0_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
double atan2(double, double);
double polar_angle(double p1_x, double p1_y, double p2_x, double p2_y) {
  double deltaY = p2_y - p1_y;
  double deltaX = p2_x - p1_x;
  double polar_angle = atan2(deltaY, deltaX);
  return polar_angle;
}


x86 assembly (clang, -O0):
<polar_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polar_angle>:
subsd  %xmm1,%xmm3
subsd  %xmm0,%xmm2
movapd %xmm3,%xmm0
movapd %xmm2,%xmm1
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @polar_angle(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%12 = load double, double* %8
%13 = load double, double* %6
%14 = fsub double %12, %13
store double %14, double* %9
%15 = load double, double* %7
%16 = load double, double* %5
%17 = fsub double %15, %16
store double %17, double* %10
%18 = load double, double* %9
%19 = load double, double* %10
%20 = call double @atan2(double %18, double %19)
store double %20, double* %11
%21 = load double, double* %11
ret double %21
}

LLVM IR (-O2):
define double @polar_angle(double %0, double %1, double %2, double %3) {
%5 = fsub double %3, %1
%6 = fsub double %2, %0
%7 = tail call double @atan2(double %5, double %6)
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fileExists(char *filename) {
  FILE *file;
  if ((file = fopen(filename, "r"))) {
    fclose(file);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115f <fileExists+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <fileExists+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <fileExists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @fileExists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
void genbltzall_out() {}


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

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

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

LLVM IR (-O2):
define void @genbltzall_out() {
ret void
}
/* Variables and functions */
float expf(float);
float logf(float);
float HMM_PowerF(float Base, float Exponent) {
  float Result = expf(Exponent * logf(Base));
  return (Result);
}


x86 assembly (clang, -O0):
<HMM_PowerF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1040 <expf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMM_PowerF>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <logf@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <expf@plt>

LLVM IR (-O0):
define float @HMM_PowerF(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %4
%7 = load float, float* %3
%8 = call float @logf(float %7)
%9 = fmul float %6, %8
%10 = call float @expf(float %9)
store float %10, float* %5
%11 = load float, float* %5
ret float %11
}

LLVM IR (-O2):
define float @HMM_PowerF(float %0, float %1) {
%3 = tail call float @logf(float %0)
%4 = fmul float %3, %1
%5 = tail call float @expf(float %4)
ret float %5
}
/* Variables and functions */
bool c_islower(int c) { return (c >= 'a' && c <= 'z'); }


x86 assembly (clang, -O0):
<c_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <c_islower+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @c_islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @c_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("what is \\c \c"); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"what is \\c c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
long do_random(unsigned long *ctx) {
  long hi, lo, x;
  x = *ctx;
  if (x == 0)
    x = 123459876L;
  hi = x / 127773L;
  lo = x % 127773L;
  x = 16807L * lo - 2836L * hi;
  if (x < 0)
    x += 0x7fffffffL;
  return ((*ctx = x) % ((unsigned long)0x7FFFFFFF + 1));
}


x86 assembly (clang, -O0):
<do_random>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1126 <do_random+0x26>
movq   $0x75bd924,-0x20(%rbp)
07
mov    -0x20(%rbp),%rax
mov    $0x1f31d,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x1f31d,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x18(%rbp)
imul   $0x41a7,-0x18(%rbp),%rax
imul   $0xb14,-0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    117a <do_random+0x7a>
mov    -0x20(%rbp),%rax
add    $0x7fffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rax,(%rcx)
and    $0x7fffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_random>:
mov    (%rdi),%rax
test   %rax,%rax
mov    $0x75bd924,%ecx
cmovne %rax,%rcx
movabs $0x41a705af1fe3fb79,%rdx
05 a7 41
mov    %rcx,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xf,%rdx
add    %rax,%rdx
imul   $0x1f31d,%rdx,%rax
sub    %rax,%rcx
imul   $0x41a7,%rcx,%rcx
imul   $0xfffffffffffff4ec,%rdx,%rdx
lea    (%rdx,%rcx,1),%rax
add    $0x7fffffff,%rax
add    %rcx,%rdx
cmovns %rdx,%rax
mov    %rax,(%rdi)
and    $0x7fffffff,%eax
ret

LLVM IR (-O0):
define i64 @do_random(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %2
%6 = load i64*, i64** %2
%7 = load i64, i64* %6
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i64 123459876, i64* %5
br label %11
11: ; preds = %10, %1
%12 = load i64, i64* %5
%13 = sdiv i64 %12, 127773
store i64 %13, i64* %3
%14 = load i64, i64* %5
%15 = srem i64 %14, 127773
store i64 %15, i64* %4
%16 = load i64, i64* %4
%17 = mul nsw i64 16807, %16
%18 = load i64, i64* %3
%19 = mul nsw i64 2836, %18
%20 = sub nsw i64 %17, %19
store i64 %20, i64* %5
%21 = load i64, i64* %5
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %11
%24 = load i64, i64* %5
%25 = add nsw i64 %24, 2147483647
store i64 %25, i64* %5
br label %26
26: ; preds = %23, %11
%27 = load i64, i64* %5
%28 = load i64*, i64** %2
store i64 %27, i64* %28
%29 = urem i64 %27, 2147483648
ret i64 %29
}

LLVM IR (-O2):
define i64 @do_random(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i64 123459876, i64 %2
%5 = sdiv i64 %4, 127773
%6 = srem i64 %4, 127773
%7 = mul nsw i64 %6, 16807
%8 = mul nsw i64 %5, -2836
%9 = add nsw i64 %8, %7
%10 = icmp slt i64 %9, 0
%11 = add nsw i64 %9, 2147483647
%12 = select i1 %10, i64 %11, i64 %9
store i64 %12, i64* %0
%13 = and i64 %12, 2147483647
ret i64 %13
}
/* Type definitions */
typedef scalar_t__ int_least8_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_int_least8_t(int_least8_t const k1,
                                           int_least8_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_EQUALS_int_least8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_int_least8_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_EQUALS_int_least8_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_int_least8_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void gtk_icon_theme_get_icon_sizes() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_theme_get_icon_sizes() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("!!!Mundoo!!!");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"!!!Mundoo!!!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"!!!Mundoo!!!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int *);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  unsigned int *p = (unsigned int *)strtol(argv[1], NULL, 16);
  p[0] = 0x08048454;
  printf("What? You're not fuc*ing supposed to be here: %p\n", p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x8048454,(%rax)
mov    -0x18(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtol@plt>
movl   $0x8048454,(%rax)
lea    0xec2(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"What? You're not fuc*ing supposed to be here: %p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i64 @strtol(i8* %9, i32* null, i32 16)
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %6
%12 = load i32*, i32** %6
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 134513748, i32* %13
%14 = load i32*, i32** %6
%15 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [50 x i8] c"What? You're not fuc*ing supposed to be here: %p\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strtol(i8* nocapture %4, i32* null, i32 16)
%6 = inttoptr i64 %5 to i32*
store i32 134513748, i32* %6
%7 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32* %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ operand(int, int);
load2() { operand(2, (0x02 | 0x04 | 0x08 | 0x10)); }


x86 assembly (clang, -O0):
<load2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x1e,%esi
call   1030 <operand@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load2>:
mov    $0x2,%edi
mov    $0x1e,%esi
jmp    1030 <operand@plt>

LLVM IR (-O0):
define i32 @load2() {
%1 = alloca i32
%2 = call i32 @operand(i32 2, i32 30)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @load2() {
%1 = tail call i32 @operand(i32 2, i32 30)
ret i32 undef
}
int Number() { return 42; }


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

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

LLVM IR (-O0):
define i32 @Number() {
ret i32 42
}

LLVM IR (-O2):
define i32 @Number() {
ret i32 42
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned long pthreads_thread_id() { return (unsigned long)pthread_self(); }


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

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

LLVM IR (-O0):
define i64 @pthreads_thread_id() {
%1 = call i64 (...) @pthread_self()
ret i64 %1
}

LLVM IR (-O2):
define i64 @pthreads_thread_id() {
%1 = tail call i64 (...) @pthread_self()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ stuff(int);
void hiphip(void (*f)()) {
  stuff(2);
  f();
}


x86 assembly (clang, -O0):
<hiphip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <stuff@plt>
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hiphip>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
call   1030 <stuff@plt>
xor    %eax,%eax
mov    %rbx,%rcx
pop    %rbx
jmp    *%rcx

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

LLVM IR (-O2):
define void @hiphip(void (...)* nocapture %0) {
%2 = tail call i32 @stuff(i32 2)
tail call void (...) %0()
ret void
}
void trace_exception_unwind(struct jit_stack_frame *frame) {}


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

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

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

LLVM IR (-O2):
%struct.jit_stack_frame = type opaque
define void @trace_exception_unwind(%struct.jit_stack_frame* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TCFLSH;
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void TerminalFlushOutput(void) {
  (void)ioctl(fileno(stdout), TCFLSH, (char *)0);
}


x86 assembly (clang, -O0):
<TerminalFlushOutput>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
mov    %eax,%edi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <ioctl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TerminalFlushOutput>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
xor    %edx,%edx
pop    %rax
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@stdout = global i32 0
@TCFLSH = global i32 0
define void @TerminalFlushOutput() {
%1 = load i32, i32* @stdout
%2 = call i32 @fileno(i32 %1)
%3 = load i32, i32* @TCFLSH
%4 = call i32 @ioctl(i32 %2, i32 %3, i8* null)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@TCFLSH = global i32 0
define void @TerminalFlushOutput() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fileno(i32 %1)
%3 = load i32, i32* @TCFLSH
%4 = tail call i32 @ioctl(i32 %2, i32 %3, i8* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, double, double,
                           double, double);
void RectOval(FILE *F, double w, double h, double x, double y, char *color) {
  fprintf(F,
          "<rect "
          "style=\"fill:%s;fill-opacity:1;stroke-width:2;"
          "stroke-miterlimit:4;stroke-dasharray:none\" "
          "id=\"rectx\" "
          "width=\"%.2lf\" "
          "height=\"%.2lf\" "
          "x=\"%.2lf\" "
          "y=\"%.2lf\" "
          "ry=\"12.5\" "
          "/>\n",
          color, w, h, x, y);
}


x86 assembly (clang, -O0):
<RectOval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rdx
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RectOval>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"<rect style=\22fill:%s;fill-opacity:1;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none\22 id=\22rectx\22 width=\22%.2lf\22 height=\22%.2lf\22 x=\22%.2lf\22 y=\22%.2lf\22 ry=\2212.5\22 />\0A\00"
define void @RectOval(i32* %0, double %1, double %2, double %3, double %4, i8* %5) {
%7 = alloca i32*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca i8*
store i32* %0, i32** %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store i8* %5, i8** %12
%13 = load i32*, i32** %7
%14 = load i8*, i8** %12
%15 = load double, double* %8
%16 = load double, double* %9
%17 = load double, double* %10
%18 = load double, double* %11
%19 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i8* %14, double %15, double %16, double %17, double %18)
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"<rect style=\22fill:%s;fill-opacity:1;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none\22 id=\22rectx\22 width=\22%.2lf\22 height=\22%.2lf\22 x=\22%.2lf\22 y=\22%.2lf\22 ry=\2212.5\22 />\0A\00"
define void @RectOval(i32* nocapture %0, double %1, double %2, double %3, double %4, i8* %5) {
%7 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i8* %5, double %1, double %2, double %3, double %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fnv04(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
uint32_t fnvstr(char const *buf) { return fnv04(buf, strlen(buf)); }


x86 assembly (clang, -O0):
<fnvstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <fnv04@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnvstr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <fnv04@plt>

LLVM IR (-O0):
define i32 @fnvstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @fnv04(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @fnvstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @fnv04(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int partition(int *, int, int);
void sort(int *elements, int left, int right) {
  if (left < right) {
    int pivot = partition(elements, left, right);
    sort(elements, left, pivot - 1);
    sort(elements, pivot + 1, right);
  }
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}