xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int __infer_nondet_int();
int vsnprintf(char *s, size_t n, const char *format, va_list arg) {
  int res;
  res = __infer_nondet_int();
  if (res < 0)
    while (1)
      ;
  return res;
}


x86 assembly (clang, -O0):
<vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1145 <vsnprintf+0x35>
jmp    1140 <vsnprintf+0x30>
jmp    1140 <vsnprintf+0x30>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsnprintf>:
push   %rax
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
test   %eax,%eax
js     1120 <vsnprintf+0x10>
pop    %rcx
ret
xchg   %ax,%ax
jmp    1120 <vsnprintf+0x10>

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

LLVM IR (-O2):
define i32 @vsnprintf(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 (...) @__infer_nondet_int()
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4, %7
br label %7
8: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int row, col;
  int n;
  printf("Enter a number: ");
  scanf("%d", &n);
  return EXIT_SUCCESS;
}


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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
void showResult(int pos, int key) {
  if (pos != -1)
    printf("Key %d is at %d\n", key, pos);
  else
    printf("Key %d is not found\n", key);
  return;
}


x86 assembly (clang, -O0):
<showResult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1141 <showResult+0x31>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1152 <showResult+0x42>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showResult>:
cmp    $0xffffffff,%edi
je     1125 <showResult+0x15>
mov    %edi,%edx
lea    0xee2(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Key %d is at %d\0A\00"
@.str.1 = [21 x i8] c"Key %d is not found\0A\00"
define void @showResult(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
br label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Key %d is at %d\0A\00"
@.str.1 = [21 x i8] c"Key %d is not found\0A\00"
define void @showResult(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %8
8: ; preds = %6, %4
ret void
}
void foo233() {}


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

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

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

LLVM IR (-O2):
define void @foo233() {
ret void
}
/* Variables and functions */
int _stricmp(char const *, char const *);
int strcasecmp(const char *sz1, const char *sz2) { return _stricmp(sz1, sz2); }


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

x86 assembly (clang, -O2):
<strcasecmp>:
jmp    1030 <_stricmp@plt>

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

LLVM IR (-O2):
define i32 @strcasecmp(i8* %0, i8* %1) {
%3 = tail call i32 @_stricmp(i8* %0, i8* %1)
ret i32 %3
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void AESKey3Set(uint32_t ui32Base, uint32_t *pui32Key) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000008))) = pui32Key[0];
  (*((volatile unsigned long *)(ui32Base + 0x0000000C))) = pui32Key[1];
  (*((volatile unsigned long *)(ui32Base + 0x00000000))) = pui32Key[2];
  (*((volatile unsigned long *)(ui32Base + 0x00000004))) = pui32Key[3];
}


x86 assembly (clang, -O0):
<AESKey3Set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xc(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESKey3Set>:
mov    (%rsi),%rax
mov    %rax,0x8(%rdi)
mov    0x8(%rsi),%rax
mov    %rax,0xc(%rdi)
mov    0x10(%rsi),%rax
mov    %rax,(%rdi)
mov    0x18(%rsi),%rax
mov    %rax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @AESKey3Set(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 0
%7 = load i64, i64* %6
%8 = load i64, i64* %3
%9 = add i64 %8, 8
%10 = inttoptr i64 %9 to i64*
store volatile i64 %7, i64* %10
%11 = load i64*, i64** %4
%12 = getelementptr inbounds i64, i64* %11, i64 1
%13 = load i64, i64* %12
%14 = load i64, i64* %3
%15 = add i64 %14, 12
%16 = inttoptr i64 %15 to i64*
store volatile i64 %13, i64* %16
%17 = load i64*, i64** %4
%18 = getelementptr inbounds i64, i64* %17, i64 2
%19 = load i64, i64* %18
%20 = load i64, i64* %3
%21 = add i64 %20, 0
%22 = inttoptr i64 %21 to i64*
store volatile i64 %19, i64* %22
%23 = load i64*, i64** %4
%24 = getelementptr inbounds i64, i64* %23, i64 3
%25 = load i64, i64* %24
%26 = load i64, i64* %3
%27 = add i64 %26, 4
%28 = inttoptr i64 %27 to i64*
store volatile i64 %25, i64* %28
ret void
}

LLVM IR (-O2):
define void @AESKey3Set(i64 %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = add i64 %0, 8
%5 = inttoptr i64 %4 to i64*
store volatile i64 %3, i64* %5
%6 = getelementptr inbounds i64, i64* %1, i64 1
%7 = load i64, i64* %6
%8 = add i64 %0, 12
%9 = inttoptr i64 %8 to i64*
store volatile i64 %7, i64* %9
%10 = getelementptr inbounds i64, i64* %1, i64 2
%11 = load i64, i64* %10
%12 = inttoptr i64 %0 to i64*
store volatile i64 %11, i64* %12
%13 = getelementptr inbounds i64, i64* %1, i64 3
%14 = load i64, i64* %13
%15 = add i64 %0, 4
%16 = inttoptr i64 %15 to i64*
store volatile i64 %14, i64* %16
ret void
}
int checkNumbers(int a, int b) {
  int diff;
  if (a - b) {
    diff = a - b;
    if (diff & 1 << ((8 * sizeof(int)) - 1)) {
      return (b);
    } else
      return (a);
  } else
    return 0;
}


x86 assembly (clang, -O0):
<checkNumbers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1149 <checkNumbers+0x49>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     113e <checkNumbers+0x3e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <checkNumbers+0x50>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <checkNumbers+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkNumbers>:
xor    %eax,%eax
cmp    %esi,%edi
cmovns %edi,%esi
cmovne %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @checkNumbers(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = icmp sgt i32 %3, -1
%6 = select i1 %5, i32 %0, i32 %1
%7 = select i1 %4, i32 0, i32 %6
ret i32 %7
}
int main_called(void) { return 6; }


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

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

LLVM IR (-O0):
define i32 @main_called() {
ret i32 6
}

LLVM IR (-O2):
define i32 @main_called() {
ret i32 6
}
/* Type definitions */
typedef int uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int const *, int, int, int /*<<< orphan*/ *);
void fwrite_int16(bool swap, const uint16_t s, FILE *file) {
  if (swap) {
    const uint16_t x = ((s & 0xff) << 8) | (((s >> 8) & 0xff));
    fwrite(&x, 2, 1, file);
  } else {
    fwrite(&s, 2, 1, file);
  }
}


x86 assembly (clang, -O0):
<fwrite_int16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1164 <fwrite_int16+0x54>
mov    -0x8(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
jmp    117b <fwrite_int16+0x6b>
mov    -0x10(%rbp),%rcx
lea    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwrite_int16>:
push   %rax
mov    %rdx,%rcx
mov    %esi,0x4(%rsp)
test   %edi,%edi
je     112b <fwrite_int16+0x1b>
rol    $0x8,%si
movzwl %si,%eax
mov    %eax,(%rsp)
mov    %rsp,%rdi
jmp    1130 <fwrite_int16+0x20>
lea    0x4(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @fwrite_int16(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* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i32, i32* %5
%12 = and i32 %11, 255
%13 = shl i32 %12, 8
%14 = load i32, i32* %5
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = or i32 %13, %16
store i32 %17, i32* %7
%18 = load i32*, i32** %6
%19 = call i32 @fwrite(i32* %7, i32 2, i32 1, i32* %18)
br label %23
20: ; preds = %3
%21 = load i32*, i32** %6
%22 = call i32 @fwrite(i32* %5, i32 2, i32 1, i32* %21)
br label %23
23: ; preds = %20, %10
ret void
}

LLVM IR (-O2):
define void @fwrite_int16(i32 %0, i32 %1, i32* nocapture %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %1, i32* %4
%6 = icmp eq i32 %0, 0
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = bitcast i32* %5 to i8*
%9 = trunc i32 %1 to i16
%10 = tail call i16 @llvm.bswap.i16(i16 %9)
%11 = zext i16 %10 to i32
store i32 %11, i32* %5
%12 = call i32 @fwrite(i32* %5, i32 2, i32 1, i32* %2)
br label %15
13: ; preds = %3
%14 = call i32 @fwrite(i32* %4, i32 2, i32 1, i32* %2)
br label %15
15: ; preds = %13, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pid_file_kill() {
  printf("NOT IMPLEMENTED:"
         "pa_pid_file_kill"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_pid_file_kill\00"
define i32 @pa_pid_file_kill() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
const char *safe_cstr(const char *s) { return (s ? s : ""); }


x86 assembly (clang, -O0):
<safe_cstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <safe_cstr+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <safe_cstr+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <safe_cstr+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_cstr>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @safe_cstr(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 %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @safe_cstr(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Variables and functions */
double M_PI;
double deg2rad(double r) { return (M_PI * r / 180.0); }


x86 assembly (clang, -O0):
<deg2rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ed8(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2rad>:
mov    0x2ee1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @deg2rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* @M_PI
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = fdiv double %5, 1.800000e+02
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @deg2rad(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ ttputc(int);
void tcapbeep() { ttputc(0x07); }


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

x86 assembly (clang, -O2):
<tcapbeep>:
mov    $0x7,%edi
jmp    1030 <ttputc@plt>

LLVM IR (-O0):
define void @tcapbeep() {
%1 = call i32 @ttputc(i32 7)
ret void
}

LLVM IR (-O2):
define void @tcapbeep() {
%1 = tail call i32 @ttputc(i32 7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void PrintFinal(FILE *F) {
  fprintf(F, "</g>\n</svg>");
  fclose(F);
}


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

x86 assembly (clang, -O2):
<PrintFinal>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"</g>\0A</svg>\00"
define void @PrintFinal(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"</g>\0A</svg>\00"
define void @PrintFinal(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %0)
%3 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: mycal\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Usage: mycal\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"Usage: mycal\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int add5(int param1) { return param1 + 5; }


x86 assembly (clang, -O0):
<add5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add5>:
lea    0x5(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @add5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 5
ret i32 %4
}

LLVM IR (-O2):
define i32 @add5(i32 %0) {
%2 = add nsw i32 %0, 5
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg) {
  fprintf(stderr, "error: %s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
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    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(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 ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

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

/* Variables and functions */
void USBOTGMode(uint32_t ui32Base) {
  ;
  (*((volatile unsigned char *)(ui32Base + 0x0000041C))) = 0;
}


x86 assembly (clang, -O0):
<USBOTGMode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,0x41c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBOTGMode>:
movb   $0x0,0x41c(%rdi)
ret

LLVM IR (-O0):
define void @USBOTGMode(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1052
%5 = inttoptr i64 %4 to i8*
store volatile i8 0, i8* %5
ret void
}

LLVM IR (-O2):
define void @USBOTGMode(i64 %0) {
%2 = add nsw i64 %0, 1052
%3 = inttoptr i64 %2 to i8*
store volatile i8 0, i8* %3
ret void
}
/* Variables and functions */
int rand();
int RandomInt(int low, int high) { return rand() % (high - low + 1) + low; }


x86 assembly (clang, -O0):
<RandomInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomInt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @RandomInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @RandomInt(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
unsigned uDivTest7(unsigned X, unsigned Y) {
  return (X != Y ? Y : ((unsigned)0));
}


x86 assembly (clang, -O0):
<uDivTest7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1121 <uDivTest7+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112b <uDivTest7+0x2b>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <uDivTest7+0x2b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDivTest7>:
xor    %eax,%eax
cmp    %esi,%edi
cmovne %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @uDivTest7(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = select i1 %3, i32 0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  while (1) {
    printf("p3_hello");
    sleep(3);
  }
  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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [9 x i8] c"p3_hello\00"
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
br label %6
6: ; preds = %2, %6
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @sleep(i32 3)
br label %6
}

LLVM IR (-O2):
@.str = [9 x i8] c"p3_hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 3)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ SseqR(int *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void SubseqLex2(int n) {
  int *s;
  s = (int *)malloc((n + 1) * sizeof(int));
  SseqR(s, 0, 1, n);
  free(s);
}


x86 assembly (clang, -O0):
<SubseqLex2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <SseqR@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SubseqLex2>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
lea    0x4(,%r14,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    %r14d,%ecx
call   1050 <SseqR@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @SubseqLex2(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 4
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %3
%11 = load i32*, i32** %3
%12 = load i32, i32* %2
%13 = call i32 @SseqR(i32* %11, i32 0, i32 1, i32 %12)
%14 = load i32*, i32** %3
%15 = call i32 @free(i32* %14)
ret void
}

LLVM IR (-O2):
define void @SubseqLex2(i32 %0) {
%2 = shl i32 %0, 2
%3 = add i32 %2, 4
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @SseqR(i32* %5, i32 0, i32 1, i32 %0)
%7 = tail call i32 @free(i32* %5)
ret void
}
void prefetchw(void *a) { __asm volatile("prefetchw (%0)" : : "r"(a)); }


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

x86 assembly (clang, -O2):
<prefetchw>:
prefetchw (%rdi)
ret

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

LLVM IR (-O2):
define void @prefetchw(i8* %0) {
tail call void asm sideeffect "prefetchw ($0)", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

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


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

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

LLVM IR (-O2):
%struct.node = type { i32 }
define void @LinkedList_Destroy(%struct.node* nocapture %0) {
%2 = tail call i32 @free(%struct.node* %0)
ret void
}
int test11(int fd, __attribute__((__unused__)) int argc,
           const __attribute__((__unused__)) char **argv) {
  return 0;
}


x86 assembly (clang, -O0):
<test11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test11(i32 %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @test11(i32 %0, i32 %1, i8** nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GL_QUADS;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex2i(int, int);
void drawRect(int x1, int y1, int x2, int y2) {
  glBegin(GL_QUADS);
  glVertex2i(x1, y1);
  glVertex2i(x1, y2);
  glVertex2i(x2, y2);
  glVertex2i(x2, y1);
  glEnd();
}


x86 assembly (clang, -O0):
<drawRect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <glVertex2i@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <glVertex2i@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <glVertex2i@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <glVertex2i@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawRect>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%r15d
mov    %esi,%r14d
mov    %edi,%ebp
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <glVertex2i@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <glVertex2i@plt>
mov    %r15d,%edi
mov    %ebx,%esi
call   1030 <glVertex2i@plt>
mov    %r15d,%edi
mov    %r14d,%esi
call   1030 <glVertex2i@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@GL_QUADS = global i32 0
define void @drawRect(i32 %0, i32 %1, i32 %2, i32 %3) {
%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 %3, i32* %8
%9 = load i32, i32* @GL_QUADS
%10 = call i32 @glBegin(i32 %9)
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @glVertex2i(i32 %11, i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %8
%16 = call i32 @glVertex2i(i32 %14, i32 %15)
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = call i32 @glVertex2i(i32 %17, i32 %18)
%20 = load i32, i32* %7
%21 = load i32, i32* %6
%22 = call i32 @glVertex2i(i32 %20, i32 %21)
%23 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_QUADS = global i32 0
define void @drawRect(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @GL_QUADS
%6 = tail call i32 @glBegin(i32 %5)
%7 = tail call i32 @glVertex2i(i32 %0, i32 %1)
%8 = tail call i32 @glVertex2i(i32 %0, i32 %3)
%9 = tail call i32 @glVertex2i(i32 %2, i32 %3)
%10 = tail call i32 @glVertex2i(i32 %2, i32 %1)
%11 = tail call i32 (...) @glEnd()
ret void
}
int f(int s, int c, int i) {
  int a1, a3, x1, x3, x;
  a1 = i * s;
  x1 = c + a1;
  if (x1 > 6)
    i = i + 2;
  i = i + 2;
  a3 = i * s;
  x3 = c + a3;
  x = x1 + x3;
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x6,-0x18(%rbp)
jle    1133 <f+0x33>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edx,%eax
imul   %edi,%eax
add    %esi,%eax
lea    0x2(%rdx),%ecx
cmp    $0x7,%eax
cmovl  %edx,%ecx
add    $0x2,%ecx
imul   %edi,%ecx
add    %esi,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = add nsw i32 %4, %1
%6 = icmp sgt i32 %5, 6
%7 = add nsw i32 %2, 2
%8 = select i1 %6, i32 %7, i32 %2
%9 = add nsw i32 %8, 2
%10 = mul nsw i32 %9, %0
%11 = add i32 %5, %1
%12 = add i32 %11, %10
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
void *scheduler6(void *variables6) {
  int vars;
  int *p_vars = (int *)variables6;
  vars = *p_vars;
  while (1) {
    system("netstat -anp | grep sshd | for k in 'cat "
           "/etc/vpn-helper-allow.conf' ; do grep -v $k ; done ;  | awk "
           "'{print $7}' | cut -d / -f1 | xargs kill");
    sleep(vars);
  }
}


x86 assembly (clang, -O0):
<scheduler6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <system@plt>
mov    -0xc(%rbp),%edi
call   1040 <sleep@plt>
jmp    113d <scheduler6+0x1d>

x86 assembly (clang, -O2):
<scheduler6>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
call   1030 <system@plt>
mov    %ebx,%edi
call   1040 <sleep@plt>
jmp    1130 <scheduler6+0x10>

LLVM IR (-O0):
@.str = [142 x i8] c"netstat -anp | grep sshd | for k in 'cat /etc/vpn-helper-allow.conf' ; do grep -v $k ; done ; | awk '{print $7}' | cut -d / -f1 | xargs kill\00"
define i8* @scheduler6(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
store i32 %8, i32* %3
br label %9
9: ; preds = %1, %9
%10 = call i32 @system(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = call i32 @sleep(i32 %11)
br label %9
}

LLVM IR (-O2):
@.str = [142 x i8] c"netstat -anp | grep sshd | for k in 'cat /etc/vpn-helper-allow.conf' ; do grep -v $k ; done ; | awk '{print $7}' | cut -d / -f1 | xargs kill\00"
define noalias i8* @scheduler6(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @system(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 %3)
br label %4
}
cbuf39(f, n) { return (cbuf(f, n, 39)); }


x86 assembly (clang, -O0):
<cbuf39>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x27,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf39>:
mov    $0x27,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf39(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 39)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf39(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 39)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void swap(char *n1, char *n2) {
  char tmp[15];
  strcpy(tmp, n1);
  strcpy(n1, n2);
  strcpy(n2, tmp);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1f(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    -0x1f(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x1(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [15 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%14 = call i32 @strcpy(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1) {
%3 = alloca [15 x i8]
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i32 @strcpy(i8* %0, i8* %1)
%7 = call i32 @strcpy(i8* %1, i8* %4)
ret void
}
double smoothstep(double x, double edge0, double edge1) {
  (void)(!isnan(x));
  (void)((edge1) > (edge0));
  x = clamp((x - edge0) / (edge1 - edge0), 0, 1);
  return (((x) * (x)) * (3 - 2 * x));
}


x86 assembly (clang, -O0):
<smoothstep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1040 <isnan@plt>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1030 <clamp@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
addsd  %xmm2,%xmm2
movsd  0xe73(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smoothstep>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    $0x1,%al
call   1040 <isnan@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1030 <clamp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm1,%xmm1
movsd  0xe7e(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @smoothstep(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = call i32 (double, ...) bitcast (i32 (...)* @isnan to i32 (double, ...)*)(double %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = load double, double* %6
%13 = load double, double* %5
%14 = fcmp ogt double %12, %13
%15 = zext i1 %14 to i32
%16 = load double, double* %4
%17 = load double, double* %5
%18 = fsub double %16, %17
%19 = load double, double* %6
%20 = load double, double* %5
%21 = fsub double %19, %20
%22 = fdiv double %18, %21
%23 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @clamp to i32 (double, i32, i32, ...)*)(double %22, i32 0, i32 1)
%24 = sitofp i32 %23 to double
store double %24, double* %4
%25 = load double, double* %4
%26 = load double, double* %4
%27 = fmul double %25, %26
%28 = load double, double* %4
%29 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %28, double 3.000000e+00)
%30 = fmul double %27, %29
ret double %30
}

LLVM IR (-O2):
define double @smoothstep(double %0, double %1, double %2) {
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @isnan to i32 (double, ...)*)(double %0)
%5 = fsub double %0, %1
%6 = fsub double %2, %1
%7 = fdiv double %5, %6
%8 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @clamp to i32 (double, i32, i32, ...)*)(double %7, i32 0, i32 1)
%9 = sitofp i32 %8 to double
%10 = fmul double %9, %9
%11 = tail call double @llvm.fmuladd.f64(double %9, double -2.000000e+00, double 3.000000e+00)
%12 = fmul double %10, %11
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void exit(int code) {
  _exit(code);
  while (1) {
  }
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @_exit(i32 %0)
unreachable
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t rotl(uint32_t x, unsigned n) { return (x << n) | (x >> (32 - n)); }


x86 assembly (clang, -O0):
<rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rotl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__0__IO__set();
void LedsP__Led2__set(void) { HplAtm128GeneralIOPinP__0__IO__set(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led2__set() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__0__IO__set()
ret void
}
/* Variables and functions */
char tolower(char const);
char lily_tolower(const char c) { return (tolower(c)); }


x86 assembly (clang, -O0):
<lily_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <tolower@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lily_tolower>:
jmp    1030 <tolower@plt>

LLVM IR (-O0):
define signext i8 @lily_tolower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i8 @tolower(i8 signext %3)
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @lily_tolower(i8 signext %0) {
%2 = tail call signext i8 @tolower(i8 signext %0)
ret i8 %2
}