xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UART9BitAddrSet(unsigned long ulBase, unsigned char ucAddr,
                     unsigned char ucMask) {
  DEBUG_ASSERT(UARTBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x000000A4))) = ucAddr << 0;
  (*((volatile unsigned long *)(ulBase + 0x000000A8))) = ucMask << 0;
}


x86 assembly (clang, -O0):
<UART9BitAddrSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
movzbl -0x9(%rbp),%eax
shl    $0x0,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xa4(%rax)
movzbl -0xa(%rbp),%eax
shl    $0x0,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xa8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART9BitAddrSet>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    %ebp,%eax
mov    %rax,0xa4(%rbx)
mov    %r14d,%eax
mov    %rax,0xa8(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @UART9BitAddrSet(i64 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i64
%5 = alloca i8
%6 = alloca i8
store i64 %0, i64* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i64, i64* %4
%8 = call i32 @UARTBaseValid(i64 %7)
%9 = call i32 @DEBUG_ASSERT(i32 %8)
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 0
%13 = sext i32 %12 to i64
%14 = load i64, i64* %4
%15 = add i64 %14, 164
%16 = inttoptr i64 %15 to i64*
store volatile i64 %13, i64* %16
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 0
%20 = sext i32 %19 to i64
%21 = load i64, i64* %4
%22 = add i64 %21, 168
%23 = inttoptr i64 %22 to i64*
store volatile i64 %20, i64* %23
ret void
}

LLVM IR (-O2):
define void @UART9BitAddrSet(i64 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @UARTBaseValid(i64 %0)
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = zext i8 %1 to i64
%7 = add i64 %0, 164
%8 = inttoptr i64 %7 to i64*
store volatile i64 %6, i64* %8
%9 = zext i8 %2 to i64
%10 = add i64 %0, 168
%11 = inttoptr i64 %10 to i64*
store volatile i64 %9, i64* %11
ret void
}
OP(ed, f0) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
int x(void) {
  int a = ({
    int b = 3;
    b;
  });
  int b = 1;
  return a;
}


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @x() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 3, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
%6 = load i32, i32* %3
store i32 %6, i32* %1
store i32 1, i32* %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @x() {
ret i32 3
}
int main() {
  int n, k;
  while (~scanf(" %d %d", &n, &k)) {
    printf("%d\n", gao(n, k));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
xor    $0xffffffff,%eax
cmp    $0x0,%eax
je     1183 <main+0x53>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1040 <gao@plt>
mov    %eax,%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    $0xffffffff,%eax
je     119f <main+0x6f>
lea    0xead(%rip),%r14
lea    0xe9f(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
nopl   0x0(%rax)
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
xor    %eax,%eax
call   1040 <gao@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    $0xffffffff,%eax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c" %d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %14, label %7
7: ; preds = %0, %7
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gao to i32 (i32, i32, ...)*)(i32 %8, i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %7
14: ; preds = %7, %0
ret i32 0
}
void context_tracking_task_switch(struct task_struct *prev,
                                  struct task_struct *next) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @context_tracking_task_switch(%struct.task_struct* %0, %struct.task_struct* %1) {
%3 = alloca %struct.task_struct*
%4 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @context_tracking_task_switch(%struct.task_struct* nocapture %0, %struct.task_struct* nocapture %1) {
ret void
}
/* Variables and functions */
long double rint(double);
__attribute__((weak)) long double rintl(long double x) {
  return rint((double)x);
}


x86 assembly (clang, -O0):
<rintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <rint@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rintl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <rint@plt>

LLVM IR (-O0):
define weak x86_fp80 @rintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @rint(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @rintl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @rint(double %2)
ret x86_fp80 %3
}
void f() {
  int size = 40;
  char *memory = __builtin_alloca(size);
  __builtin___clear_cache(memory, memory + size);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x28,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
sub    %rcx,%rax
mov    %rax,%rsp
mov    %rax,-0x10(%rbp)
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
%2 = alloca i8*
store i32 40, i32* %1
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = alloca i8, i64 %4
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 40
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a = 0, b = 0;
  scanf("%d%d", &a, &b);
  printf("%d\n", (a - b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xec9(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
sub    (%rsp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ disconnect();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void handler_termination() {
  disconnect();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<handler_termination>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <disconnect@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<handler_termination>:
push   %rax
xor    %eax,%eax
call   1040 <disconnect@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @handler_termination() {
%1 = call i32 (...) @disconnect()
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @handler_termination() {
%1 = tail call i32 (...) @disconnect()
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ write(int /*<<< orphan*/, int *, int);
void test_write() {
  int n = 0;
  write(0, &n, sizeof(int));
  assert(n == 0);
}


x86 assembly (clang, -O0):
<test_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_write>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
xor    %edi,%edi
mov    $0x4,%edx
call   1030 <write@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @test_write() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 0, i32* %1, i32 4)
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
define void @test_write() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @write(i32 0, i32* %1, i32 4)
%4 = tail call i32 @assert(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLuint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glNewList(int /*<<< orphan*/, int /*<<< orphan*/);
void NewList(GLuint list, GLenum mode) { glNewList(list, mode); }


x86 assembly (clang, -O0):
<NewList>:
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 <glNewList@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NewList>:
jmp    1030 <glNewList@plt>

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

LLVM IR (-O2):
define void @NewList(i32 %0, i32 %1) {
%3 = tail call i32 @glNewList(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void nmstermio_print_string(char *s) { printf("%s", s); }


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

x86 assembly (clang, -O2):
<nmstermio_print_string>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @nmstermio_print_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @nmstermio_print_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void remove_files(char **files) {
  size_t i = 0;
  while (files[i]) {
    unlink(files[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<remove_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1159 <remove_files+0x49>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <unlink@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <remove_files+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_files>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1131 <remove_files+0x21>
add    $0x8,%rbx
call   1030 <unlink@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <remove_files+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @remove_files(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %10, %4 ], [ %2, %1 ]
%6 = phi i64 [ %8, %4 ], [ 0, %1 ]
%7 = tail call i32 @unlink(i8* %5)
%8 = add i64 %6, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int NAND(int A, int B) {}


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

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

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

LLVM IR (-O2):
define i32 @NAND(i32 %0, i32 %1) {
ret i32 undef
}
short test_48_2(short *mem) { return __atomic_and_fetch(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_48_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    0x8(%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x24(%rbp)
and    %esi,%edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    1165 <test_48_2+0x65>
jmp    112d <test_48_2+0x2d>
mov    -0x10(%rbp),%cx
mov    -0x1a(%rbp),%ax
and    %cx,%ax
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_48_2>:
movzwl 0x8(%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%ecx
and    $0x1,%ecx
lock cmpxchg %cx,0x8(%rdi)
jne    1110 <test_48_2+0x10>
and    $0x1,%eax
ret

LLVM IR (-O0):
define signext i16 @test_48_2(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 4
store i16 1, i16* %3
%7 = load i16, i16* %3
%8 = atomicrmw and i16* %6, i16 %7 acq_rel
%9 = and i16 %8, %7
store i16 %9, i16* %4
%10 = load i16, i16* %4
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @test_48_2(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 4
%3 = atomicrmw and i16* %2, i16 1 acq_rel
%4 = and i16 %3, 1
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ binler(int);
int /*<<< orphan*/ birler(int);
int /*<<< orphan*/ onlar(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ yuzler(int);
int main() {
  int n;
  printf("Bir sayi giriniz.\n");
  scanf("%d", &n);
  binler(n);
  yuzler(n);
  onlar(n);
  birler(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe91(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <binler@plt>
mov    -0x8(%rbp),%edi
call   1050 <yuzler@plt>
mov    -0x8(%rbp),%edi
call   1070 <onlar@plt>
mov    -0x8(%rbp),%edi
call   1080 <birler@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <binler@plt>
mov    0x4(%rsp),%edi
call   1050 <yuzler@plt>
mov    0x4(%rsp),%edi
call   1070 <onlar@plt>
mov    0x4(%rsp),%edi
call   1080 <birler@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Bir sayi giriniz.\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @binler(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @yuzler(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @onlar(i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @birler(i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [18 x i8] c"Bir sayi giriniz.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @binler(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @yuzler(i32 %7)
%9 = load i32, i32* %1
%10 = call i32 @onlar(i32 %9)
%11 = load i32, i32* %1
%12 = call i32 @birler(i32 %11)
ret i32 0
}
double sqrt_d(double x) {
  double s;
  __asm__ __volatile__("sqrtsd %1, %0" : "=x"(s) : "x"(x));
  return s;
}


x86 assembly (clang, -O0):
<sqrt_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
sqrtsd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt_d>:
sqrtsd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @sqrt_d(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double asm sideeffect "sqrtsd $1, $0", "=x,x,~{dirflag},~{fpsr},~{flags}"(double %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @sqrt_d(double %0) {
%2 = tail call double asm sideeffect "sqrtsd $1, $0", "=x,x,~{dirflag},~{fpsr},~{flags}"(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *sprog) {
  fprintf(stderr, "usage: %s <malloc_trace_file> > <output_file>\n", sprog);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"usage: %s <malloc_trace_file> > <output_file>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void deallocate(void *mem) {
  if (mem != 0) {
    free(mem);
  }
}


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

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

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

LLVM IR (-O2):
define void @deallocate(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
unsigned char *VIM_HAPI_GetOneFrame(unsigned char *, unsigned long,
                                    unsigned char, unsigned long *);
unsigned char *V5H_Capture_GetMultishotFrame(unsigned char *framebuf,
                                             unsigned long buflength,
                                             unsigned char framenumber,
                                             unsigned long *pframelength) {
  return VIM_HAPI_GetOneFrame(framebuf, buflength, framenumber, pframelength);
}


x86 assembly (clang, -O0):
<V5H_Capture_GetMultishotFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x11(%rbp),%al
mov    -0x20(%rbp),%rcx
movzbl %al,%edx
call   1030 <VIM_HAPI_GetOneFrame@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V5H_Capture_GetMultishotFrame>:
jmp    1030 <VIM_HAPI_GetOneFrame@plt>

LLVM IR (-O0):
define i8* @V5H_Capture_GetMultishotFrame(i8* %0, i64 %1, i8 zeroext %2, i64* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8
%8 = alloca i64*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8 %2, i8* %7
store i64* %3, i64** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8, i8* %7
%12 = load i64*, i64** %8
%13 = call i8* @VIM_HAPI_GetOneFrame(i8* %9, i64 %10, i8 zeroext %11, i64* %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @V5H_Capture_GetMultishotFrame(i8* %0, i64 %1, i8 zeroext %2, i64* %3) {
%5 = tail call i8* @VIM_HAPI_GetOneFrame(i8* %0, i64 %1, i8 zeroext %2, i64* %3)
ret i8* %5
}
/* Variables and functions */
int dup2(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ my_strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void my_dup2(int fd1, int fd2) {
  if (dup2(fd1, fd2) == -1) {
    write(1, "Error dup2", my_strlen("Error dup2"));
    exit(0);
  }
}


x86 assembly (clang, -O0):
<my_dup2>:
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   1050 <dup2@plt>
cmp    $0xffffffff,%eax
jne    1188 <my_dup2+0x48>
lea    0xe97(%rip),%rdi
call   1030 <my_strlen@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe84(%rip),%rsi
call   1040 <write@plt>
xor    %edi,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_dup2>:
push   %rbx
call   1050 <dup2@plt>
cmp    $0xffffffff,%eax
je     114d <my_dup2+0xd>
pop    %rbx
ret
lea    0xeac(%rip),%rbx
mov    %rbx,%rdi
call   1030 <my_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Error dup2\00"
define void @my_dup2(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 @dup2(i32 %5, i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 @my_strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @write(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Error dup2\00"
define void @my_dup2(i32 %0, i32 %1) {
%3 = tail call i32 @dup2(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @my_strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int kill(int /*<<< orphan*/, int);
int raise(int s) { return kill(getpid(), s); }


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <kill@plt>

LLVM IR (-O0):
define i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = call i32 @kill(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @raise(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @kill(i32 %2, i32 %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t getline(char **, size_t *, int /*<<< orphan*/ *);
size_t loadline(FILE *fstream, char **contents, size_t *contents_size) {
  return getline(contents, contents_size, fstream);
}


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

x86 assembly (clang, -O2):
<loadline>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <getline@plt>

LLVM IR (-O0):
define i64 @loadline(i32* %0, i8** %1, i64* %2) {
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i64*
store i32* %0, i32** %4
store i8** %1, i8*** %5
store i64* %2, i64** %6
%7 = load i8**, i8*** %5
%8 = load i64*, i64** %6
%9 = load i32*, i32** %4
%10 = call i64 @getline(i8** %7, i64* %8, i32* %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @loadline(i32* %0, i8** %1, i64* %2) {
%4 = tail call i64 @getline(i8** %1, i64* %2, i32* %0)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void s_hook_memory_print(const char *msg) { fprintf(stderr, "%s", msg); }


x86 assembly (clang, -O0):
<s_hook_memory_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_hook_memory_print>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @s_hook_memory_print(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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @s_hook_memory_print(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int sdeco_get();
int sdeco_d_get_int16(void) {
  int h, val;
  h = sdeco_get();
  if (h < 0)
    return h;
  val = (h << 8);
  h = sdeco_get();
  if (h < 0)
    return h;
  return val + h;
}


x86 assembly (clang, -O0):
<sdeco_d_get_int16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <sdeco_get@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1137 <sdeco_d_get_int16+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <sdeco_d_get_int16+0x58>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <sdeco_get@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    115f <sdeco_d_get_int16+0x4f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <sdeco_d_get_int16+0x58>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdeco_d_get_int16>:
push   %rbx
xor    %eax,%eax
call   1030 <sdeco_get@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1132 <sdeco_d_get_int16+0x22>
xor    %eax,%eax
call   1030 <sdeco_get@plt>
test   %eax,%eax
js     1130 <sdeco_d_get_int16+0x20>
shl    $0x8,%ebx
add    %eax,%ebx
jmp    1132 <sdeco_d_get_int16+0x22>
mov    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

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

/* Variables and functions */
bool mp2vpicx_get_chroma420(const uint8_t *p_mp2vpicx) {
  return !!(p_mp2vpicx[7] & 0x1);
}


x86 assembly (clang, -O0):
<mp2vpicx_get_chroma420>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_get_chroma420>:
mov    0x1c(%rdi),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mp2vpicx_get_chroma420(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mp2vpicx_get_chroma420(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = and i32 %3, 1
ret i32 %4
}
int pRec1(int argc) { return (argc == 1); }


x86 assembly (clang, -O0):
<pRec1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pRec1>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @pRec1(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ rislower(int);
scalar_t__ risupper(int);
int risalpha(int c) { return (rislower(c) || risupper(c)); }


x86 assembly (clang, -O0):
<risalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <rislower@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <risalpha+0x37>
mov    -0x4(%rbp),%edi
call   1030 <risupper@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<risalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <rislower@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <risalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <risupper@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @risalpha(i32 %0) {
%2 = tail call i64 @rislower(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @risupper(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
double angle_difference(double alpha, double beta) {
  double d = alpha - beta;
  if (d < -1.0)
    d += 2.0;
  else if (d > 1.0)
    d -= 2.0;
  return d;
}


x86 assembly (clang, -O0):
<angle_difference>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1147 <angle_difference+0x47>
movsd  0xed8(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1179 <angle_difference+0x79>
movsd  -0x18(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1174 <angle_difference+0x74>
movsd  -0x18(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1179 <angle_difference+0x79>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<angle_difference>:
subsd  %xmm1,%xmm0
movsd  0xef4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    111b <angle_difference+0x1b>
addsd  0xefe(%rip),%xmm0
ret
ucomisd 0xee5(%rip),%xmm0
jbe    112d <angle_difference+0x2d>
addsd  0xee3(%rip),%xmm0
ret

LLVM IR (-O0):
define double @angle_difference(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fsub double %6, %7
store double %8, double* %5
%9 = load double, double* %5
%10 = fcmp olt double %9, -1.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load double, double* %5
%13 = fadd double %12, 2.000000e+00
store double %13, double* %5
br label %21
14: ; preds = %2
%15 = load double, double* %5
%16 = fcmp ogt double %15, 1.000000e+00
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load double, double* %5
%19 = fsub double %18, 2.000000e+00
store double %19, double* %5
br label %20
20: ; preds = %17, %14
br label %21
21: ; preds = %20, %11
%22 = load double, double* %5
ret double %22
}

LLVM IR (-O2):
define double @angle_difference(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fcmp olt double %3, -1.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = fadd double %3, 2.000000e+00
br label %11
7: ; preds = %2
%8 = fcmp ogt double %3, 1.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = fadd double %3, -2.000000e+00
br label %11
11: ; preds = %7, %9, %5
%12 = phi double [ %6, %5 ], [ %10, %9 ], [ %3, %7 ]
ret double %12
}
/* Variables and functions */
float rint(float);
void Sys_SnapVector(float *vector) {
  vector[0] = rint(vector[0]);
  vector[1] = rint(vector[1]);
  vector[2] = rint(vector[2]);
}


x86 assembly (clang, -O0):
<Sys_SnapVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <rint@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
call   1030 <rint@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
call   1030 <rint@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_SnapVector>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  %xmm1,0xc(%rsp)
call   1030 <rintf@plt>
movss  %xmm0,(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <rintf@plt>
movss  %xmm0,0x4(%rbx)
movss  0x8(%rbx),%xmm0
call   1030 <rintf@plt>
movss  %xmm0,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @Sys_SnapVector(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = call float @rint(float %5)
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = call float @rint(float %11)
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = call float @rint(float %17)
%19 = load float*, float** %2
%20 = getelementptr inbounds float, float* %19, i64 2
store float %18, float* %20
ret void
}

LLVM IR (-O2):
define void @Sys_SnapVector(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @llvm.rint.f32(float %2)
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = tail call float @llvm.rint.f32(float %5)
store float %6, float* %4
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.rint.f32(float %8)
store float %9, float* %7
ret void
}
/* Type definitions */
struct sembuf {
  int member_0;
  int member_1;
  int /*<<< orphan*/ member_2;
};

/* Variables and functions */
int /*<<< orphan*/ exception(char *);
int semop(int, struct sembuf *, int);
void V(int semid, int semchoice) {
  struct sembuf op = {semchoice, 1, 0};
  if (semop(semid, &op, 1) == -1)
    exception("ERROR while signaling semaphore!");
}


x86 assembly (clang, -O0):
<V>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1040 <semop@plt>
cmp    $0xffffffff,%eax
jne    1168 <V+0x48>
lea    0xe9d(%rip),%rdi
call   1030 <exception@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movq   $0x1,0xc(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1040 <semop@plt>
cmp    $0xffffffff,%eax
je     114a <V+0x2a>
add    $0x18,%rsp
ret
lea    0xeaf(%rip),%rdi
call   1030 <exception@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@.str = [33 x i8] c"ERROR while signaling semaphore!\00"
define void @V(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sembuf
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i32 1, i32* %8
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 2
store i32 0, i32* %9
%10 = load i32, i32* %3
%11 = call i32 @semop(i32 %10, %struct.sembuf* %5, i32 1)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @exception(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@.str = [33 x i8] c"ERROR while signaling semaphore!\00"
define void @V(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i32 0, i32* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @exception(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}
void rho_ruby_releaseValue(unsigned long val) {}


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

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

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

LLVM IR (-O2):
define void @rho_ruby_releaseValue(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_int_to_srv(int);
void set_mixer(int val) {
  if (val < 0)
    val = 0;
  else if (val > 100)
    val = 100;
  send_int_to_srv(0x1b);
  send_int_to_srv(val);
}


x86 assembly (clang, -O0):
<set_mixer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1131 <set_mixer+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1147 <set_mixer+0x37>
cmpl   $0x64,-0x4(%rbp)
jle    1142 <set_mixer+0x32>
movl   $0x64,-0x4(%rbp)
jmp    1147 <set_mixer+0x37>
mov    $0x1b,%edi
call   1030 <send_int_to_srv@plt>
mov    -0x4(%rbp),%edi
call   1030 <send_int_to_srv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mixer>:
push   %rbx
mov    %edi,%ebx
cmp    $0x64,%edi
mov    $0x64,%eax
cmovge %eax,%ebx
xor    %eax,%eax
test   %ebx,%ebx
cmovs  %eax,%ebx
mov    $0x1b,%edi
call   1030 <send_int_to_srv@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <send_int_to_srv@plt>

LLVM IR (-O0):
define void @set_mixer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 0, i32* %2
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 100
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 100, i32* %2
br label %10
10: ; preds = %9, %6
br label %11
11: ; preds = %10, %5
%12 = call i32 @send_int_to_srv(i32 27)
%13 = load i32, i32* %2
%14 = call i32 @send_int_to_srv(i32 %13)
ret void
}

LLVM IR (-O2):
define void @set_mixer(i32 %0) {
%2 = icmp slt i32 %0, 100
%3 = select i1 %2, i32 %0, i32 100
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
%6 = tail call i32 @send_int_to_srv(i32 27)
%7 = tail call i32 @send_int_to_srv(i32 %5)
ret void
}
/* Variables and functions */
size_t base64_estimate_decode_size(size_t base64_in_size) {
  return (((base64_in_size + 3) / 4) * 3);
}


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

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

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

LLVM IR (-O2):
define i64 @base64_estimate_decode_size(i64 %0) {
%2 = add i64 %0, 3
%3 = lshr i64 %2, 2
%4 = mul nuw i64 %3, 3
ret i64 %4
}
void playlist_shutdown(void) {}


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

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

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

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