xunge/DecIR huggingface dataset:
/* Type definitions */
struct linked_list_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct linked_list_t *);
int /*<<< orphan*/ linked_list_clear(struct linked_list_t *);
void linked_list_free(struct linked_list_t *list) {
  linked_list_clear(list);
  free(list);
}


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

x86 assembly (clang, -O2):
<linked_list_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <linked_list_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.linked_list_t = type { i32 }
define void @linked_list_free(%struct.linked_list_t* %0) {
%2 = tail call i32 @linked_list_clear(%struct.linked_list_t* %0)
%3 = tail call i32 @free(%struct.linked_list_t* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Redirect(char const *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ STDOUT_FILENO;
void RedirectStdout(const char *stdout_path) {
  Redirect(stdout_path, STDOUT_FILENO, "stdout");
}


x86 assembly (clang, -O0):
<RedirectStdout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdx
call   1030 <Redirect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RedirectStdout>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdx
jmp    1030 <Redirect@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [7 x i8] c"stdout\00"
define void @RedirectStdout(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @STDOUT_FILENO
%5 = call i32 @Redirect(i8* %3, i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [7 x i8] c"stdout\00"
define void @RedirectStdout(i8* %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @Redirect(i8* %0, i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MyPrintf(char *, char, int /*<<< orphan*/);
int /*<<< orphan*/ summate(int, int, int /*<<< orphan*/ *, int, int);
int main(void) {
  MyPrintf("teste: %c, %i", 'a', summate(4, 1, NULL, 3, 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x3,%ecx
mov    $0x2,%r8d
call   1040 <summate@plt>
mov    %eax,%edx
lea    0xeaa(%rip),%rdi
mov    $0x61,%esi
call   1030 <MyPrintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x3,%ecx
mov    $0x2,%r8d
call   1040 <summate@plt>
lea    0xebc(%rip),%rdi
mov    $0x61,%esi
mov    %eax,%edx
call   1030 <MyPrintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"teste: %c, %i\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @summate(i32 4, i32 1, i32* null, i32 3, i32 2)
%3 = call i32 @MyPrintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext 97, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"teste: %c, %i\00"
define i32 @main() {
%1 = tail call i32 @summate(i32 4, i32 1, i32* null, i32 3, i32 2)
%2 = tail call i32 @MyPrintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext 97, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ readFileAt(int, size_t, unsigned char *, int);
unsigned long readFileDWORD(int fileIndex, size_t offset) {
  unsigned char buf[4];
  readFileAt(fileIndex, offset, buf, 4);
  return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24);
}


x86 assembly (clang, -O0):
<readFileDWORD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <readFileAt@plt>
movzbl -0x14(%rbp),%eax
movzbl -0x13(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x12(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x11(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readFileDWORD>:
push   %rax
lea    0x4(%rsp),%rdx
mov    $0x4,%ecx
call   1030 <readFileAt@plt>
movslq 0x4(%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @readFileDWORD(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca [4 x i8]
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = load i64, i64* %4
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%9 = call i32 @readFileAt(i32 %6, i64 %7, i8* %8, i32 4)
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = shl i32 %15, 8
%17 = or i32 %12, %16
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 2
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = shl i32 %20, 16
%22 = or i32 %17, %21
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 3
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = shl i32 %25, 24
%27 = or i32 %22, %26
%28 = sext i32 %27 to i64
ret i64 %28
}

LLVM IR (-O2):
define i64 @readFileDWORD(i32 %0, i64 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = call i32 @readFileAt(i32 %0, i64 %1, i8* %4, i32 4)
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl nuw nsw i32 %10, 8
%12 = or i32 %11, %7
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = shl nuw nsw i32 %15, 16
%17 = or i32 %12, %16
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = shl nuw i32 %20, 24
%22 = or i32 %17, %21
%23 = sext i32 %22 to i64
ret i64 %23
}
void lookAtMatrix() { return; }


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

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

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

LLVM IR (-O2):
define void @lookAtMatrix() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ q(int);
int t(int a) {
  if (a > 12) {
    q(a + 5);
    q(a + 5);
  } else
    q(a + 10);
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
jle    1140 <t+0x30>
mov    -0x8(%rbp),%edi
add    $0x5,%edi
call   1030 <q@plt>
mov    -0x8(%rbp),%edi
add    $0x5,%edi
call   1030 <q@plt>
jmp    114b <t+0x3b>
mov    -0x8(%rbp),%edi
add    $0xa,%edi
call   1030 <q@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
push   %rbx
mov    %edi,%ebx
cmp    $0xd,%edi
jl     1124 <t+0x14>
add    $0x5,%ebx
mov    %ebx,%edi
call   1030 <q@plt>
jmp    1127 <t+0x17>
add    $0xa,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <q@plt>

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

LLVM IR (-O2):
define i32 @t(i32 %0) {
%2 = icmp sgt i32 %0, 12
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = add nuw nsw i32 %0, 5
%5 = tail call i32 @q(i32 %4)
br label %8
6: ; preds = %1
%7 = add nsw i32 %0, 10
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %7, %6 ], [ %4, %3 ]
%10 = tail call i32 @q(i32 %9)
ret i32 undef
}
void SCE_Quit_NullFS(void) {}


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

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

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

LLVM IR (-O2):
define void @SCE_Quit_NullFS() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void test_f() { puts("test_f()"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"test_f()\00"
define void @test_f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void SerialClose(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<SerialClose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @SerialClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int gl_fx_dummy_function_ddtex(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gl_fx_dummy_function_ddtex() {
ret i32 0
}
/* Variables and functions */
int arrangeCoins(int);
int /*<<< orphan*/ printf(char *, int, int);
void test(int n) { printf("arrange(%d) = %d\n", n, arrangeCoins(n)); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <arrangeCoins@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
call   1040 <arrangeCoins@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"arrange(%d) = %d\0A\00"
define void @test(i32 %0) {
%2 = tail call i32 @arrangeCoins(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
void RTFileAioGetLimits(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileAioGetLimits() {
ret void
}
int QSShowNodes(const void *v1, const void *v2) {
  unsigned int i1, i2;
  i1 = *((unsigned int *)v1);
  i2 = *((unsigned int *)v2);
  if (i1 < i2)
    return -1;
  if (i1 > i2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<QSShowNodes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jae    1136 <QSShowNodes+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <QSShowNodes+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jbe    114e <QSShowNodes+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <QSShowNodes+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QSShowNodes>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @QSShowNodes(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp ult i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = icmp ugt i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @QSShowNodes(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ult i32 %4, %6
%8 = icmp ugt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
unsigned int x(unsigned int);
unsigned int h(unsigned int a, unsigned int b) { return x(a) >> b; }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <x@plt>
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rbx
mov    %esi,%ebx
call   1030 <x@plt>
mov    %ebx,%ecx
shr    %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @h(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 = call i32 @x(i32 %5)
%7 = load i32, i32* %4
%8 = lshr i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @h(i32 %0, i32 %1) {
%3 = tail call i32 @x(i32 %0)
%4 = lshr i32 %3, %1
ret i32 %4
}
unsigned int i2u32(unsigned int *src) {
  unsigned char *a = ((unsigned char *)src);
  unsigned char *b = ((unsigned char *)src) + 1;
  unsigned char *c = ((unsigned char *)src) + 2;
  unsigned char *d = ((unsigned char *)src) + 3;
  return ((unsigned int)(*a)) + (((unsigned int)(*b)) << 8) +
         (((unsigned int)(*c)) << 16) + (((unsigned int)(*d)) << 24);
}


x86 assembly (clang, -O0):
<i2u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x20(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x28(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2u32>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @i2u32(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %2
%7 = load i32*, i32** %2
%8 = bitcast i32* %7 to i8*
store i8* %8, i8** %3
%9 = load i32*, i32** %2
%10 = bitcast i32* %9 to i8*
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %4
%12 = load i32*, i32** %2
%13 = bitcast i32* %12 to i8*
%14 = getelementptr inbounds i8, i8* %13, i64 2
store i8* %14, i8** %5
%15 = load i32*, i32** %2
%16 = bitcast i32* %15 to i8*
%17 = getelementptr inbounds i8, i8* %16, i64 3
store i8* %17, i8** %6
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = shl i32 %23, 8
%25 = add i32 %20, %24
%26 = load i8*, i8** %5
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = shl i32 %28, 16
%30 = add i32 %25, %29
%31 = load i8*, i8** %6
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = shl i32 %33, 24
%35 = add i32 %30, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @i2u32(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = getelementptr inbounds i8, i8* %2, i64 2
%5 = getelementptr inbounds i8, i8* %2, i64 3
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = shl nuw nsw i32 %9, 8
%11 = or i32 %10, %7
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 16
%15 = or i32 %11, %14
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = shl nuw i32 %17, 24
%19 = or i32 %15, %18
ret i32 %19
}
__attribute__((always_)) unsigned int hw_bitWrite(unsigned int n, int bit,
                                                  int value) {
  if (value)
    return (n | 1U << bit);
  else
    return (n & ~(1U << bit));
}


x86 assembly (clang, -O0):
<hw_bitWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1130 <hw_bitWrite+0x30>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <hw_bitWrite+0x47>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hw_bitWrite>:
mov    %edi,%eax
bts    %esi,%eax
btr    %esi,%edi
test   %edx,%edx
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @hw_bitWrite(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = shl nuw i32 1, %1
%6 = or i32 %5, %0
%7 = xor i32 %5, -1
%8 = and i32 %7, %0
%9 = select i1 %4, i32 %8, i32 %6
ret i32 %9
}
unsigned int pad32(unsigned int count) { return (count + 0x1f) & ~0x1f; }


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

x86 assembly (clang, -O2):
<pad32>:
lea    0x1f(%rdi),%eax
and    $0xffffffe0,%eax
ret

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

LLVM IR (-O2):
define i32 @pad32(i32 %0) {
%2 = add i32 %0, 31
%3 = and i32 %2, -32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ h264nal_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ h264nal_set_type(int /*<<< orphan*/ *, int);
void h264endseq_init(uint8_t *p_h264endseq) {
  h264nal_init(p_h264endseq);
  h264nal_set_type(p_h264endseq, 10);
}


x86 assembly (clang, -O0):
<h264endseq_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <h264nal_init@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <h264nal_set_type@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264endseq_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <h264nal_init@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
pop    %rbx
jmp    1030 <h264nal_set_type@plt>

LLVM IR (-O0):
define void @h264endseq_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @h264nal_init(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @h264nal_set_type(i32* %5, i32 10)
ret void
}

LLVM IR (-O2):
define void @h264endseq_init(i32* %0) {
%2 = tail call i32 @h264nal_init(i32* %0)
%3 = tail call i32 @h264nal_set_type(i32* %0, i32 10)
ret void
}
/* Type definitions */
struct cfbuf_obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ cfbuf__close(struct cfbuf_obj *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void handle_fill_fail(struct cfbuf_obj *f) {
  perror("Error filling the buffer");
  cfbuf__close(f);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<handle_fill_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    -0x8(%rbp),%rdi
call   1030 <cfbuf__close@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<handle_fill_fail>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <perror@plt>
mov    %rbx,%rdi
call   1030 <cfbuf__close@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.cfbuf_obj = type { i32 }
@.str = [25 x i8] c"Error filling the buffer\00"
@EXIT_FAILURE = global i32 0
define void @handle_fill_fail(%struct.cfbuf_obj* %0) {
%2 = alloca %struct.cfbuf_obj*
store %struct.cfbuf_obj* %0, %struct.cfbuf_obj** %2
%3 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.cfbuf_obj*, %struct.cfbuf_obj** %2
%5 = call i32 @cfbuf__close(%struct.cfbuf_obj* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
%struct.cfbuf_obj = type { i32 }
@.str = [25 x i8] c"Error filling the buffer\00"
@EXIT_FAILURE = global i32 0
define void @handle_fill_fail(%struct.cfbuf_obj* %0) {
%2 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @cfbuf__close(%struct.cfbuf_obj* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void prnt_rslt_arith(char *mcode, char *regd, char *regs2, char *regs1,
                     int rslt) {
  printf("print results here...");
}


x86 assembly (clang, -O0):
<prnt_rslt_arith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"print results here...\00"
define void @prnt_rslt_arith(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"print results here...\00"
define void @prnt_rslt_arith(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i32 %4) {
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int factorial(int);
int nCr(int n, int r) {
  if (r >= 0 && n >= r)
    return factorial(n) / (factorial(r) * factorial(n - r));
  else
    return 0;
}


x86 assembly (clang, -O0):
<nCr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     116b <nCr+0x5b>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     116b <nCr+0x5b>
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <factorial@plt>
mov    -0x14(%rbp),%ecx
mov    %eax,%edx
mov    -0x10(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1172 <nCr+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nCr>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
test   %esi,%esi
js     1145 <nCr+0x35>
mov    %esi,%ebx
mov    %edi,%ebp
sub    %esi,%ebp
jl     1145 <nCr+0x35>
call   1030 <factorial@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <factorial@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
imul   %ebx,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nCr(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* %5
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = icmp sge i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i32, i32* %4
%14 = call i32 @factorial(i32 %13)
%15 = load i32, i32* %5
%16 = call i32 @factorial(i32 %15)
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = sub nsw i32 %17, %18
%20 = call i32 @factorial(i32 %19)
%21 = mul nsw i32 %16, %20
%22 = sdiv i32 %14, %21
store i32 %22, i32* %3
br label %24
23: ; preds = %8, %2
store i32 0, i32* %3
br label %24
24: ; preds = %23, %12
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @nCr(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
%4 = icmp slt i32 %0, %1
%5 = or i1 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = tail call i32 @factorial(i32 %0)
%8 = tail call i32 @factorial(i32 %1)
%9 = sub nsw i32 %0, %1
%10 = tail call i32 @factorial(i32 %9)
%11 = mul nsw i32 %10, %8
%12 = sdiv i32 %7, %11
br label %13
13: ; preds = %2, %6
%14 = phi i32 [ %12, %6 ], [ 0, %2 ]
ret i32 %14
}
fle(int x, int y) {
  if (x <= y)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<fle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1122 <fle+0x22>
movl   $0xd,-0x4(%rbp)
jmp    1129 <fle+0x29>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fle>:
cmp    %esi,%edi
mov    $0x8c,%ecx
mov    $0xd,%eax
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fle(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* %4
%7 = load i32, i32* %5
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 13, i32* %3
br label %11
10: ; preds = %2
store i32 140, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @fle(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 140, i32 13
ret i32 %4
}
int ft_isdigit(int c) { return ((c >= '0' && c <= '9') ? 1 : 0); }


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ doit();
int main() {
  doit();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @doit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void setl_reg8(unsigned int reg8) {
  put8(0x40);
  put8(0x0F);
  put8(0x9C);
  put8(0xC0 | reg8);
}


x86 assembly (clang, -O0):
<setl_reg8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x40,%edi
call   1030 <put8@plt>
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x9c,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setl_reg8>:
push   %rbx
mov    %edi,%ebx
mov    $0x40,%edi
call   1030 <put8@plt>
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x9c,%edi
call   1030 <put8@plt>
or     $0xc0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @setl_reg8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 64)
%4 = call i32 @put8(i32 15)
%5 = call i32 @put8(i32 156)
%6 = load i32, i32* %2
%7 = or i32 192, %6
%8 = call i32 @put8(i32 %7)
ret void
}

LLVM IR (-O2):
define void @setl_reg8(i32 %0) {
%2 = tail call i32 @put8(i32 64)
%3 = tail call i32 @put8(i32 15)
%4 = tail call i32 @put8(i32 156)
%5 = or i32 %0, 192
%6 = tail call i32 @put8(i32 %5)
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add(struct list_head *, struct list_head *);
int /*<<< orphan*/ list_del(struct list_head *);
void list_move(struct list_head *entry, struct list_head *head) {
  list_del(entry);
  list_add(entry, head);
}


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

x86 assembly (clang, -O2):
<list_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <list_del@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_add@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @list_del(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_add(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_del(%struct.list_head* %0)
%4 = tail call i32 @list_add(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Rect_deleter(void *item) { free(item); }


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

x86 assembly (clang, -O2):
<Rect_deleter>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @Rect_deleter(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int yylex(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @yylex() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void fs_error(char *prefix) {
  char fmt[256];
  sprintf(fmt, "fs: %s: error", prefix);
  perror(fmt);
}


x86 assembly (clang, -O0):
<fs_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <perror@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_error>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <perror@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"fs: %s: error\00"
define void @fs_error(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i32 @perror(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"fs: %s: error\00"
define void @fs_error(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @perror(i8* %3)
ret void
}
int test_imm_03uint32_mem(unsigned int *val) {
  return ((*val) & (0x03 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_03uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_03uint32_mem>:
testb  $0x3,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_03uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 3
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_03uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 3
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int fileCompString(long const, void const *);
int descending(const long pos, const void *a2) {
  return -fileCompString(pos, a2);
}


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

x86 assembly (clang, -O2):
<descending>:
push   %rax
call   1030 <fileCompString@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @descending(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = load i8*, i8** %4
%7 = call i32 @fileCompString(i64 %5, i8* %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @descending(i64 %0, i8* %1) {
%3 = tail call i32 @fileCompString(i64 %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
int test_imm_FDint64_lowword_mem(long long *val) {
  return ((*val) & (0xFD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FDint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xfd,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FDint64_lowword_mem>:
testb  $0xfd,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FDint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 253
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_FDint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 253
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double gsw_sp_from_sk(double sk) {
  double gsw_sp_from_sk_value;
  gsw_sp_from_sk_value = (sk - 0.03e0) * (1.80655e0 / 1.805e0);
  if (gsw_sp_from_sk_value < 0e0)
    gsw_sp_from_sk_value = 9e15;
  return (gsw_sp_from_sk_value);
}


x86 assembly (clang, -O0):
<gsw_sp_from_sk>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1146 <gsw_sp_from_sk+0x46>
movsd  0xecf(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_sp_from_sk>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm1
cmpltsd %xmm2,%xmm1
movsd  0xeeb(%rip),%xmm2
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @gsw_sp_from_sk(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 3.000000e-02
%6 = fmul double %5, 0x3FF003847071023E
store double %6, double* %3
%7 = load double, double* %3
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %1
store double 9.000000e+15, double* %3
br label %10
10: ; preds = %9, %1
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
define double @gsw_sp_from_sk(double %0) {
%2 = fadd double %0, -3.000000e-02
%3 = fmul double %2, 0x3FF003847071023E
%4 = fcmp olt double %3, 0.000000e+00
%5 = select i1 %4, double 9.000000e+15, double %3
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int c = 0;
  while (c <= 256) {
    c++;
    printf("%c %d\n", c, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %3)
%5 = icmp eq i32 %3, 257
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
double texstrwidth(char *);
float texfntwidth(char *str) { return texstrwidth(str) * 12.5 / 6.; }


x86 assembly (clang, -O0):
<texfntwidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <texstrwidth@plt>
movsd  0xedb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<texfntwidth>:
push   %rax
call   1030 <texstrwidth@plt>
mulsd  0xee2(%rip),%xmm0
divsd  0xee2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @texfntwidth(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @texstrwidth(i8* %3)
%5 = fmul double %4, 1.250000e+01
%6 = fdiv double %5, 6.000000e+00
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @texfntwidth(i8* %0) {
%2 = tail call double @texstrwidth(i8* %0)
%3 = fmul double %2, 1.250000e+01
%4 = fdiv double %3, 6.000000e+00
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
float exponential_out(float, float, float);
float exponential_f_out(float step, float max_steps, float max_val) {
  return exponential_out(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<exponential_f_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <exponential_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponential_f_out>:
jmp    1030 <exponential_out@plt>

LLVM IR (-O0):
define float @exponential_f_out(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @exponential_out(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @exponential_f_out(float %0, float %1, float %2) {
%4 = tail call float @exponential_out(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("usage: %s MONO.DSP [-s MONO2.DSP] STEREO.DSP [DKHEADER.DSP]\n", name);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [61 x i8] c"usage: %s MONO.DSP [-s MONO2.DSP] STEREO.DSP [DKHEADER.DSP]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int arith(int x, int y) { return x / y == 0 || y / x == 0; }


x86 assembly (clang, -O0):
<arith>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1131 <arith+0x31>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arith>:
mov    %edi,%eax
cltd
idiv   %esi
test   %eax,%eax
je     1118 <arith+0x18>
mov    %esi,%eax
cltd
idiv   %edi
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @arith(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 = sdiv i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sdiv i32 %10, %11
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ true, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @arith(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = sdiv i32 %1, %0
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
float cosf(float);
float sinf(float);
float internal_cot_f(float value) { return cosf(value) / sinf(value); }


x86 assembly (clang, -O0):
<internal_cot_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_cot_f>:
push   %rax
movss  %xmm0,(%rsp)
call   1040 <cosf@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1030 <sinf@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @internal_cot_f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @cosf(float %3)
%5 = load float, float* %2
%6 = call float @sinf(float %5)
%7 = fdiv float %4, %6
ret float %7
}

LLVM IR (-O2):
define float @internal_cot_f(float %0) {
%2 = tail call float @cosf(float %0)
%3 = tail call float @sinf(float %0)
%4 = fdiv float %2, %3
ret float %4
}
char *get_tempfile(void) {}


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

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

LLVM IR (-O0):
define i8* @get_tempfile() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @get_tempfile() {
ret i8* undef
}