xunge/DecIR huggingface dataset:
/* Variables and functions */
int ioCanListenOnPort(int, int);
int secCanListenOnPort(int socket, int port) {
  return ioCanListenOnPort(socket, port);
}


x86 assembly (clang, -O0):
<secCanListenOnPort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ioCanListenOnPort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secCanListenOnPort>:
jmp    1030 <ioCanListenOnPort@plt>

LLVM IR (-O0):
define i32 @secCanListenOnPort(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 @ioCanListenOnPort(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @secCanListenOnPort(i32 %0, i32 %1) {
%3 = tail call i32 @ioCanListenOnPort(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ v;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ wrs_mem(int /*<<< orphan*/ *, int);
void wrs_int64(int64_t v) { wrs_mem(&v, sizeof(v)); }


x86 assembly (clang, -O0):
<wrs_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <wrs_mem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrs_int64>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <wrs_mem@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @wrs_int64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @wrs_mem(i32* %2, i32 4)
ret void
}
void main(void) {
  int x;
  int y;
  int z;
  int m;
  while (x + 3 * y > 5) {
    x = y + m / z;
    m = x - y + z * m / z;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
imul   $0x3,-0x8(%rbp),%ecx
add    %ecx,%eax
cmp    $0x5,%eax
jle    1150 <main+0x50>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1104 <main+0x4>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  int i = 3;
  for (i = 0; i < 1;)
    ;
  printf("here");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1135 <main+0x25>
jmp    1126 <main+0x16>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int ffs(int);
int ink_ffs(int n) { return ffs(n); }


x86 assembly (clang, -O0):
<ink_ffs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ffs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ink_ffs>:
bsf    %edi,%ecx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ink_ffs(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%3 = add nuw nsw i32 %2, 1
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ execvp(char *, char **);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int spawn(char *program, char **arg_list) {
  pid_t child_pid;
  child_pid = fork();
  if (child_pid != 0)
    return child_pid;
  else {
    execvp(program, arg_list);
    fprintf(stderr, "an error occurred in execvp\n");
    abort();
  }
}


x86 assembly (clang, -O0):
<spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1170 <spawn+0x30>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <execvp@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
lea    0xe73(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<spawn>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     115e <spawn+0x1e>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <execvp@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"an error occurred in execvp\0A\00"
define i32 @spawn(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i64
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = call i64 (...) @fork()
store i64 %6, i64* %5
%7 = load i64, i64* %5
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i64, i64* %5
%11 = trunc i64 %10 to i32
ret i32 %11
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i8**, i8*** %4
%15 = call i32 @execvp(i8* %13, i8** %14)
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%18 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"an error occurred in execvp\0A\00"
define i32 @spawn(i8* %0, i8** %1) {
%3 = tail call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = trunc i64 %3 to i32
ret i32 %6
7: ; preds = %2
%8 = tail call i32 @execvp(i8* %0, i8** %1)
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char);
void imprime_tabela_ascii() {
  unsigned char i;
  for (i = 0; i < 255; i++)
    printf("%d\t%c\n", i, i);
}


x86 assembly (clang, -O0):
<imprime_tabela_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jge    114e <imprime_tabela_ascii+0x3e>
mov    -0x1(%rbp),%al
lea    0xecb(%rip),%rdi
movzbl %al,%esi
movzbl -0x1(%rbp),%edx
call   1030 <printf@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    111c <imprime_tabela_ascii+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprime_tabela_ascii>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
movzbl %bl,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%bl
cmp    $0xff,%bl
jne    1120 <imprime_tabela_ascii+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d\09%c\0A\00"
define void @imprime_tabela_ascii() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %10, %0
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = icmp slt i32 %4, 255
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = load i8, i8* %1
%8 = load i8, i8* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext %7, i8 zeroext %8)
br label %10
10: ; preds = %6
%11 = load i8, i8* %1
%12 = add i8 %11, 1
store i8 %12, i8* %1
br label %2
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d\09%c\0A\00"
define void @imprime_tabela_ascii() {
br label %1
1: ; preds = %0, %1
%2 = phi i8 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext %2, i8 zeroext %2)
%4 = add nuw i8 %2, 1
%5 = icmp eq i8 %4, -1
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
int main(int argc, char **argv) {
  unsigned char a = 0x11223344;
  unsigned char b = 0x11223344;
  __builtin_bzero(&a, sizeof(a));
  __builtin_memset(&a, 0, sizeof(a));
  __builtin_memcpy(&a, &b, sizeof(a));
  __builtin_memmove(&a, &b, sizeof(a));
  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)
movb   $0x44,-0x11(%rbp)
movb   $0x44,-0x12(%rbp)
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_command(int);
void test_read_local_supported_commands(const void *test_data) {
  test_command(0x1002);
}


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

x86 assembly (clang, -O2):
<test_read_local_supported_commands>:
mov    $0x1002,%edi
jmp    1030 <test_command@plt>

LLVM IR (-O0):
define void @test_read_local_supported_commands(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @test_command(i32 4098)
ret void
}

LLVM IR (-O2):
define void @test_read_local_supported_commands(i8* nocapture readnone %0) {
%2 = tail call i32 @test_command(i32 4098)
ret void
}
void ff_hevc_put_hevc_bi_epel_hv4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv4_8_sse4() {
ret void
}
char GetEncoding1() { return 0x76; }


x86 assembly (clang, -O0):
<GetEncoding1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x76,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetEncoding1>:
mov    $0x76,%al
ret

LLVM IR (-O0):
define signext i8 @GetEncoding1() {
ret i8 118
}

LLVM IR (-O2):
define signext i8 @GetEncoding1() {
ret i8 118
}
void autonomous11() {}


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

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

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

LLVM IR (-O2):
define void @autonomous11() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XNoExposeEvent;

/* Variables and functions */
void set_XNoExposeEvent_type(void *_p, int _v) {
  ((XNoExposeEvent *)_p)->type = (int)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XNoExposeEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XNoExposeEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void ft_striter(char *s, void (*f)(char *)) {
  while (s && *s) {
    if (f)
      f(s++);
    else
      return;
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1130 <ft_striter+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1140 <ft_striter+0x40>
jmp    116f <ft_striter+0x6f>
cmpq   $0x0,-0x10(%rbp)
je     1165 <ft_striter+0x65>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    %rdi,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
call   *%rax
jmp    116a <ft_striter+0x6a>
jmp    116f <ft_striter+0x6f>
jmp    1110 <ft_striter+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1133 <ft_striter+0x33>
mov    %rsi,%r14
test   %rsi,%rsi
je     1133 <ft_striter+0x33>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1133 <ft_striter+0x33>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%r15
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
mov    %r15,%rbx
jne    1120 <ft_striter+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %11, %9 ], [ %0, %6 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
tail call void %1(i8* %10)
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %9
14: ; preds = %9, %6, %2
ret void
}
/* Type definitions */
struct ring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ring_write(struct ring *, char *, int);
void ring_putch(struct ring *rb, char c) { ring_write(rb, &c, 1); }


x86 assembly (clang, -O0):
<ring_putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <ring_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ring_putch>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <ring_write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
%struct.ring = type { i32 }
define void @ring_putch(%struct.ring* %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @ring_write(%struct.ring* %0, i8* %3, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t pack_get_16(uint8_t *buffer, int byteNr) {
  int16_t retVal;
  uint8_t *ptr;
  ptr = (uint8_t *)&retVal;
  *(ptr + 1) = *(buffer + byteNr + 1);
  *(ptr + 0) = *(buffer + byteNr + 0);
  return (retVal);
}


x86 assembly (clang, -O0):
<pack_get_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    0x4(%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_get_16>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @pack_get_16(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ prussdrv_pru_clear_event(unsigned int, unsigned int);
int /*<<< orphan*/ prussdrv_pru_send_event(unsigned int);
int /*<<< orphan*/ prussdrv_pru_wait_event(unsigned int, int /*<<< orphan*/);
int prussdrv_pru_send_wait_clear_event(unsigned int send_eventnum,
                                       unsigned int host_interrupt,
                                       unsigned int ack_eventnum) {
  prussdrv_pru_send_event(send_eventnum);
  prussdrv_pru_wait_event(host_interrupt, 0);
  prussdrv_pru_clear_event(host_interrupt, ack_eventnum);
  return 0;
}


x86 assembly (clang, -O0):
<prussdrv_pru_send_wait_clear_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <prussdrv_pru_send_event@plt>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1040 <prussdrv_pru_wait_event@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <prussdrv_pru_clear_event@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prussdrv_pru_send_wait_clear_event>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <prussdrv_pru_send_event@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1040 <prussdrv_pru_wait_event@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <prussdrv_pru_clear_event@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @prussdrv_pru_send_wait_clear_event(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @prussdrv_pru_send_event(i32 %7)
%9 = load i32, i32* %5
%10 = call i32 @prussdrv_pru_wait_event(i32 %9, i32 0)
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @prussdrv_pru_clear_event(i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @prussdrv_pru_send_wait_clear_event(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @prussdrv_pru_send_event(i32 %0)
%5 = tail call i32 @prussdrv_pru_wait_event(i32 %1, i32 0)
%6 = tail call i32 @prussdrv_pru_clear_event(i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
double cos(double);
double cosZ(double zenith) {
  return cos(zenith * 0.017453292519943295769236907684886);
}


x86 assembly (clang, -O0):
<cosZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosZ>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <cos@plt>

LLVM IR (-O0):
define double @cosZ(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3F91DF46A2529D39
%5 = call double @cos(double %4)
ret double %5
}

LLVM IR (-O2):
define double @cosZ(double %0) {
%2 = fmul double %0, 0x3F91DF46A2529D39
%3 = tail call double @cos(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ GetPalette();
int /*<<< orphan*/ LoadPalette(int /*<<< orphan*/);
void LoadMapPalette(void) { LoadPalette(GetPalette()); }


x86 assembly (clang, -O0):
<LoadMapPalette>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GetPalette@plt>
mov    %eax,%edi
call   1030 <LoadPalette@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoadMapPalette>:
push   %rax
xor    %eax,%eax
call   1040 <GetPalette@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <LoadPalette@plt>

LLVM IR (-O0):
define void @LoadMapPalette() {
%1 = call i32 (...) @GetPalette()
%2 = call i32 @LoadPalette(i32 %1)
ret void
}

LLVM IR (-O2):
define void @LoadMapPalette() {
%1 = tail call i32 (...) @GetPalette()
%2 = tail call i32 @LoadPalette(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void handler(int signo __attribute__((unused))) {
  printf("Should not have caught signal\n");
  exit(1);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Should not have caught signal\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [30 x i8] c"Should not have caught signal\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int EXIT_SUCCESS;
int INT_MAX;
int INT_MIN;
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int max_int = 2147483647;
  int min_int = max_int + 1;
  printf("max_int = %d\tmin_int = %d\n", max_int, min_int);
  printf("INT_MAX = %d\tINT_MIN = %d\n", INT_MAX, INT_MIN);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7fffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x7fffffff,%esi
mov    $0x80000000,%edx
call   1030 <printf@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"max_int = %d\09min_int = %d\0A\00"
@.str.1 = [27 x i8] c"INT_MAX = %d\09INT_MIN = %d\0A\00"
@INT_MAX = global i32 0
@INT_MIN = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2147483647, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* @INT_MAX
%10 = load i32, i32* @INT_MIN
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@.str = [27 x i8] c"max_int = %d\09min_int = %d\0A\00"
@.str.1 = [27 x i8] c"INT_MAX = %d\09INT_MIN = %d\0A\00"
@INT_MAX = global i32 0
@INT_MIN = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2147483647, i32 -2147483648)
%2 = load i32, i32* @INT_MAX
%3 = load i32, i32* @INT_MIN
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
char *strrchr(register const char *s, int c) {
  register const char *p;
  p = NULL;
  do {
    if (*s == (char)c) {
      p = s;
    }
  } while (*s++);
  return (char *)p;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    1130 <strrchr+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1135 <strrchr+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
movsbl %sil,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movsbl (%rdi),%edx
cmp    %edx,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %edx,%edx
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %5, %2
%6 = phi i8* [ %0, %2 ], [ %12, %5 ]
%7 = phi i8* [ null, %2 ], [ %11, %5 ]
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %4, %9
%11 = select i1 %10, i8* %6, i8* %7
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = icmp eq i8 %8, 0
br i1 %13, label %14, label %5
14: ; preds = %5
ret i8* %11
}
/* Type definitions */
struct ss7 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ss7_message(struct ss7 *, char *, unsigned char);
int((range_and_status_dump))(struct ss7 *ss7, int messagetype,
                             unsigned char *parm, int len) {
  ss7_message(ss7, "\t\t\tRange: %d\n", parm[0] & 0xff);
  return len;
}


x86 assembly (clang, -O0):
<range_and_status_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
lea    0xec3(%rip),%rsi
movzbl %al,%edx
call   1030 <ss7_message@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_and_status_dump>:
push   %rbx
mov    %ecx,%ebx
movzbl (%rdx),%edx
lea    0xee3(%rip),%rsi
call   1030 <ss7_message@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ss7 = type { i32 }
@.str = [14 x i8] c"\09\09\09Range: %d\0A\00"
define i32 @range_and_status_dump(%struct.ss7* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.ss7*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.ss7* %0, %struct.ss7** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.ss7*, %struct.ss7** %5
%10 = load i8*, i8** %7
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = call i32 @ss7_message(%struct.ss7* %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
%17 = load i32, i32* %8
ret i32 %17
}

LLVM IR (-O2):
%struct.ss7 = type { i32 }
@.str = [14 x i8] c"\09\09\09Range: %d\0A\00"
define i32 @range_and_status_dump(%struct.ss7* %0, i32 %1, i8* nocapture %2, i32 returned %3) {
%5 = load i8, i8* %2
%6 = tail call i32 @ss7_message(%struct.ss7* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 zeroext %5)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void SzFreeTemp(void *p, void *address) {
  p = p;
  free(address);
}


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

x86 assembly (clang, -O2):
<SzFreeTemp>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @SzFreeTemp(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
store i8* %5, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @SzFreeTemp(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
void glUseProgram(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUseProgram() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void sigint_received(int sig) {
  fprintf(stderr, "\n\nInterrupted...\n\n");
  cleanup();
  exit(sig);
}


x86 assembly (clang, -O0):
<sigint_received>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sigint_received>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"\0A\0AInterrupted...\0A\0A\00"
define void @sigint_received(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @cleanup()
%5 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
bool is_leap_year(int year) {
  return (year % 4 == 0) && (!(year % 100 == 0) || (year % 400 == 0));
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <is_leap_year+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <is_leap_year+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <is_leap_year+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @is_leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
int foo(unsigned int x) { return __builtin_isnan((double)x); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
ucomisd %xmm0,%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = uitofp i32 %3 to double
%5 = fcmp uno double %4, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
void XSetWindowBorderPixmap() {}


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

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

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

LLVM IR (-O2):
define void @XSetWindowBorderPixmap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ init_clr();
int /*<<< orphan*/ refresh();
void handle_winch(int sig) {
  endwin();
  refresh();
  clear();
  init_clr();
}


x86 assembly (clang, -O0):
<handle_winch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <endwin@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1060 <clear@plt>
mov    $0x0,%al
call   1050 <init_clr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_winch>:
push   %rax
xor    %eax,%eax
call   1040 <endwin@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
call   1060 <clear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <init_clr@plt>

LLVM IR (-O0):
define void @handle_winch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @endwin()
%4 = call i32 (...) @refresh()
%5 = call i32 (...) @clear()
%6 = call i32 (...) @init_clr()
ret void
}

LLVM IR (-O2):
define void @handle_winch(i32 %0) {
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 (...) @refresh()
%4 = tail call i32 (...) @clear()
%5 = tail call i32 (...) @init_clr()
ret void
}
void donothing() {}


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

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

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

LLVM IR (-O2):
define void @donothing() {
ret void
}
int do_853() { return 853; }


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

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

LLVM IR (-O0):
define i32 @do_853() {
ret i32 853
}

LLVM IR (-O2):
define i32 @do_853() {
ret i32 853
}
double strtod(const char *nptr, char **endptr) { return 4; }


x86 assembly (clang, -O0):
<strtod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeec(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @strtod(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @strtod(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret double 4.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ stdlib_strided_dnanvarianceyc(int /*<<< orphan*/ const,
                                                 double const, double const *,
                                                 int /*<<< orphan*/ const);
double stdlib_strided_dnanstdevyc(const int64_t N, const double correction,
                                  const double *X, const int64_t stride) {
  return sqrt(stdlib_strided_dnanvarianceyc(N, correction, X, stride));
}


x86 assembly (clang, -O0):
<stdlib_strided_dnanstdevyc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <stdlib_strided_dnanvarianceyc@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dnanstdevyc>:
push   %rax
call   1030 <stdlib_strided_dnanvarianceyc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @stdlib_strided_dnanstdevyc(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load double, double* %6
%11 = load double*, double** %7
%12 = load i32, i32* %8
%13 = call i32 @stdlib_strided_dnanvarianceyc(i32 %9, double %10, double* %11, i32 %12)
%14 = call double @sqrt(i32 %13)
ret double %14
}

LLVM IR (-O2):
define double @stdlib_strided_dnanstdevyc(i32 %0, double %1, double* %2, i32 %3) {
%5 = tail call i32 @stdlib_strided_dnanvarianceyc(i32 %0, double %1, double* %2, i32 %3)
%6 = tail call double @sqrt(i32 %5)
ret double %6
}
long makeNumber(long n) { return (long)((unsigned long)n << 16); }


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

x86 assembly (clang, -O2):
<makeNumber>:
mov    %rdi,%rax
shl    $0x10,%rax
ret

LLVM IR (-O0):
define i64 @makeNumber(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 16
ret i64 %4
}

LLVM IR (-O2):
define i64 @makeNumber(i64 %0) {
%2 = shl i64 %0, 16
ret i64 %2
}
/* Variables and functions */
scalar_t__ genrand_int32();
double genrand_real2(void) {
  return (double)genrand_int32() * (1.0 / 4294967296.0);
}


x86 assembly (clang, -O0):
<genrand_real2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand_int32@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_real2>:
push   %rax
xor    %eax,%eax
call   1030 <genrand_int32@plt>
cvtsi2sd %rax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genrand_real2() {
%1 = call i64 (...) @genrand_int32()
%2 = sitofp i64 %1 to double
%3 = fmul double %2, 0x3DF0000000000000
ret double %3
}

LLVM IR (-O2):
define double @genrand_real2() {
%1 = tail call i64 (...) @genrand_int32()
%2 = sitofp i64 %1 to double
%3 = fmul double %2, 0x3DF0000000000000
ret double %3
}
unsigned long hash_string(const char *s) {
  unsigned long h;
  h = 0;
  while (*s != 0) {
    h = ((h << 8) | (h >> 24)) ^ (*s);
    s++;
  }
  return h;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1153 <hash_string+0x53>
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x10(%rbp),%rcx
shr    $0x18,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movsbq (%rcx),%rcx
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <hash_string+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1131 <hash_string+0x31>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %rax,%rdx
shl    $0x8,%rdx
shr    $0x18,%rax
or     %rdx,%rax
movsbq %cl,%rcx
xor    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i64 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %13, %4 ], [ %0, %1 ]
%8 = shl i64 %6, 8
%9 = lshr i64 %6, 24
%10 = or i64 %8, %9
%11 = sext i8 %5 to i64
%12 = xor i64 %10, %11
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i64 [ 0, %1 ], [ %12, %4 ]
ret i64 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XMapWindow(Display *display, Window w) {
  printf("Window Mapping Blocked\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Window Mapping Blocked\0A\00"
define i32 @XMapWindow(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Window Mapping Blocked\00"
define i32 @XMapWindow(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void gdbserv_input_detach(struct gdbserv *gdbserv) {}


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

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

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

LLVM IR (-O2):
%struct.gdbserv = type opaque
define void @gdbserv_input_detach(%struct.gdbserv* nocapture %0) {
ret void
}
void BIO_new_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_new_fp() {
ret void
}