xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void UARTModemControlSet(uint32_t ui32Base, uint32_t ui32Control) {
  uint32_t ui32Temp;
  ;
  ;
  ui32Temp = (*((volatile uint32_t *)(ui32Base + 0x00000030)));
  ui32Temp |= (ui32Control & (0x00000800 | 0x00000400));
  (*((volatile uint32_t *)(ui32Base + 0x00000030))) = ui32Temp;
}


x86 assembly (clang, -O0):
<UARTModemControlSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xc00,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemControlSet>:
movslq %edi,%rax
and    $0xc00,%esi
or     %esi,0x30(%rax)
ret

LLVM IR (-O0):
define void @UARTModemControlSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 48
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = and i32 %11, 3072
%13 = load i32, i32* %5
%14 = or i32 %13, %12
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 48
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
store volatile i32 %15, i32* %19
ret void
}

LLVM IR (-O2):
define void @UARTModemControlSet(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 48
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %1, 3072
%8 = or i32 %6, %7
store volatile i32 %8, i32* %5
ret void
}
int test_imm_BDint8_mem(signed char *val) {
  return ((*val) & (-0xBD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BDint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff43,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BDint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -189
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
void main() {
  int x, y;
  x = 0;
  y = 0;
  while (1) {
    if (x < 50) {
      y++;
    } else {
      y--;
    }
    if (y < 0)
      break;
    x++;
  }
  __VERIFIER_assert(x == 100);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    113e <main+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <main+0x37>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1156 <main+0x46>
jmp    1164 <main+0x54>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <main+0x16>
cmpl   $0x64,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %edx,%edx
cmp    $0x32,%eax
setb   %dl
lea    (%rcx,%rdx,2),%ecx
add    $0x1,%eax
add    $0xffffffff,%ecx
jns    1120 <main+0x10>
xor    %edi,%edi
cmp    $0x65,%eax
sete   %dil
jmp    1030 <__VERIFIER_assert@plt>

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

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %6, %1 ]
%4 = icmp ult i32 %2, 50
%5 = select i1 %4, i32 1, i32 -1
%6 = add nsw i32 %5, %3
%7 = icmp slt i32 %6, 0
%8 = add nuw nsw i32 %2, 1
br i1 %7, label %9, label %1
9: ; preds = %1
%10 = icmp eq i32 %2, 100
%11 = zext i1 %10 to i32
%12 = tail call i32 @__VERIFIER_assert(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outop1str(char *);
void outtest() { outop1str("TST"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"TST\00"
define void @outtest() {
%1 = tail call i32 @outop1str(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ colormap;
};
typedef TYPE_1__ XColormapEvent;

/* Variables and functions */
unsigned long get_XColormapEvent_colormap(void *_p) {
  return (unsigned long)((XColormapEvent *)_p)->colormap;
}


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

x86 assembly (clang, -O2):
<get_XColormapEvent_colormap>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @get_XColormapEvent_colormap(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
double pow(double, double);
double libm_pow(double x, double y) { return pow(x, y); }


x86 assembly (clang, -O0):
<libm_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libm_pow>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @libm_pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @libm_pow(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int syncfs(int /*<<< orphan*/);
int main(int argc, char *argv[]) { return syncfs(STDIN_FILENO); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1030 <syncfs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syncfs@plt>

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

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @STDIN_FILENO
%4 = tail call i32 @syncfs(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cgiMakeTextAreaDisableable(char *, char *, int, int,
                                              int /*<<< orphan*/);
void cgiMakeTextArea(char *varName, char *initialVal, int rowCount,
                     int columnCount) {
  cgiMakeTextAreaDisableable(varName, initialVal, rowCount, columnCount, 0);
}


x86 assembly (clang, -O0):
<cgiMakeTextArea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <cgiMakeTextAreaDisableable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiMakeTextArea>:
xor    %r8d,%r8d
jmp    1030 <cgiMakeTextAreaDisableable@plt>

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

LLVM IR (-O2):
define void @cgiMakeTextArea(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @cgiMakeTextAreaDisableable(i8* %0, i8* %1, i32 %2, i32 %3, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ move_pos(int);
int /*<<< orphan*/ update();
void goto_pos(int pos) {
  if (move_pos(pos)) {
    update();
  }
}


x86 assembly (clang, -O0):
<goto_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <move_pos@plt>
cmp    $0x0,%rax
je     1144 <goto_pos+0x24>
mov    $0x0,%al
call   1030 <update@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<goto_pos>:
push   %rax
call   1040 <move_pos@plt>
test   %rax,%rax
je     1133 <goto_pos+0x13>
xor    %eax,%eax
pop    %rcx
jmp    1030 <update@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @goto_pos(i32 %0) {
%2 = tail call i64 @move_pos(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @update()
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *, char const *);
void __func_and_uint(struct Var *avar, const char *areg, const char *lreg,
                     const char *rreg) {
  pA("%s = %s & %s;", areg, lreg, rreg);
}


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

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

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s & %s;\00"
define void @__func_and_uint(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s & %s;\00"
define void @__func_and_uint(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret void
}
void foo536(int p) {}


x86 assembly (clang, -O0):
<foo536>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo536(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aes_cbc(unsigned char *, unsigned char *, unsigned char *,
                           size_t, unsigned char *, int, int);
void openssl_AES_enc256_CBC(unsigned char *in, unsigned char *out,
                            unsigned char *key, size_t num_blocks,
                            unsigned char *iv) {
  aes_cbc(in, out, key, num_blocks, iv, 256, 1);
}


x86 assembly (clang, -O0):
<openssl_AES_enc256_CBC>:
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    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x100,%r9d
movl   $0x1,(%rsp)
call   1030 <aes_cbc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openssl_AES_enc256_CBC>:
push   %rax
movl   $0x1,(%rsp)
mov    $0x100,%r9d
call   1030 <aes_cbc@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @openssl_AES_enc256_CBC(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = load i8*, i8** %10
%16 = call i32 @aes_cbc(i8* %11, i8* %12, i8* %13, i64 %14, i8* %15, i32 256, i32 1)
ret void
}

LLVM IR (-O2):
define void @openssl_AES_enc256_CBC(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = tail call i32 @aes_cbc(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4, i32 256, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bpf_error(char *);
int pfaction_to_num(const char *action) {
  bpf_error("libpcap was compiled on a machine without pf support");
  return -1;
}


x86 assembly (clang, -O0):
<pfaction_to_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <bpf_error@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [53 x i8] c"libpcap was compiled on a machine without pf support\00"
define i32 @pfaction_to_num(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @bpf_error(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [53 x i8] c"libpcap was compiled on a machine without pf support\00"
define i32 @pfaction_to_num(i8* nocapture readnone %0) {
%2 = tail call i32 @bpf_error(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void aks_display_header() {
  printf("  Projekt II. Zadanie 2-1205.\n");
  printf("  Biblioteka filmowa 0.1.0.\n");
  printf("  (c) 2015 Adrian Kashivskyy.\n");
}


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

x86 assembly (clang, -O2):
<aks_display_header>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c" Projekt II. Zadanie 2-1205.\0A\00"
@.str.1 = [29 x i8] c" Biblioteka filmowa 0.1.0.\0A\00"
@.str.2 = [31 x i8] c" (c) 2015 Adrian Kashivskyy.\0A\00"
define void @aks_display_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c" Projekt II. Zadanie 2-1205.\00"
@str.3 = [28 x i8] c" Biblioteka filmowa 0.1.0.\00"
@str.4 = [30 x i8] c" (c) 2015 Adrian Kashivskyy.\00"
define void @aks_display_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
struct net_device {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int ltalk_change_mtu(struct net_device *dev, int mtu) { return -EINVAL; }


x86 assembly (clang, -O0):
<ltalk_change_mtu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltalk_change_mtu>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.net_device = type { i32 }
@EINVAL = global i32 0
define i32 @ltalk_change_mtu(%struct.net_device* %0, i32 %1) {
%3 = alloca %struct.net_device*
%4 = alloca i32
store %struct.net_device* %0, %struct.net_device** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.net_device = type { i32 }
@EINVAL = global i32 0
define i32 @ltalk_change_mtu(%struct.net_device* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
size_t strlen(char *);
void rstrip(char *buffer) {
  size_t len = strlen(buffer);
  if (len > 0 && buffer[len - 1] == '\n')
    buffer[len - 1] = '\0';
}


x86 assembly (clang, -O0):
<rstrip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    115d <rstrip+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    115d <rstrip+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rstrip>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     112a <rstrip+0x1a>
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    112a <rstrip+0x1a>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @rstrip(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %4
store i8 0, i8* %6
br label %10
10: ; preds = %9, %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glRectdv(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void Rectdv(GLdouble v1[2], GLdouble v2[2]) { glRectdv(v1, v2); }


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

x86 assembly (clang, -O2):
<Rectdv>:
jmp    1030 <glRectdv@plt>

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

LLVM IR (-O2):
define void @Rectdv(i32* %0, i32* %1) {
%3 = tail call i32 @glRectdv(i32* %0, i32* %1)
ret void
}
float absolute(float x) { return x >= 0 ? x : -x; }


x86 assembly (clang, -O0):
<absolute>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <absolute+0x29>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1140 <absolute+0x40>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absolute>:
movaps 0xef9(%rip),%xmm1
xorps  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpless %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @absolute(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load float, float* %2
br label %10
7: ; preds = %1
%8 = load float, float* %2
%9 = fneg float %8
br label %10
10: ; preds = %7, %5
%11 = phi float [ %6, %5 ], [ %9, %7 ]
ret float %11
}

LLVM IR (-O2):
define float @absolute(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %0, float %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ g();
int *malloc(int);
void f() {
  int *b = malloc(sizeof(double) * 1024);
  g();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0x2000,%edi
call   1030 <malloc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <g@plt>

LLVM IR (-O0):
define void @f() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 8192)
store i32* %2, i32** %1
%3 = call i32 (...) @g()
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = tail call i32* @malloc(i32 8192)
%2 = tail call i32 (...) @g()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char *);
void programHeader4(int assignmentNumber, char studentName[],
                    char studentEmail[]) {
  printf("Student Assignment Number %d\n"
         "Student: %s %s\n\n",
         assignmentNumber, studentName, studentEmail);
}


x86 assembly (clang, -O0):
<programHeader4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<programHeader4>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Student Assignment Number %d\0AStudent: %s %s\0A\0A\00"
define void @programHeader4(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Student Assignment Number %d\0AStudent: %s %s\0A\0A\00"
define void @programHeader4(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %2)
ret void
}
void ff_hevc_put_hevc_uni_pel_pixels6_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_pel_pixels6_10_sse4() {
ret void
}
/* Variables and functions */
unsigned long gfx_get_video_upscale();
unsigned long sc1200_get_video_scale(void) { return gfx_get_video_upscale(); }


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

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

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

LLVM IR (-O2):
define i64 @sc1200_get_video_scale() {
%1 = tail call i64 (...) @gfx_get_video_upscale()
ret i64 %1
}
void foo261() {}


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

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

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

LLVM IR (-O2):
define void @foo261() {
ret void
}
/* Variables and functions */
int cos(float);
float sine_easeInOut(float t, float b, float c, float d) {
  return -c / 2 * (cos(3.14159265f * t / d) - 1) + b;
}


x86 assembly (clang, -O0):
<sine_easeInOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xebe(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xea9(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
call   1030 <cos@plt>
movss  -0x14(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2ss %eax,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine_easeInOut>:
push   %rax
mulss  0xee7(%rip),%xmm2
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
mulss  0xed8(%rip),%xmm0
divss  %xmm3,%xmm0
call   1030 <cos@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sine_easeInOut(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = fneg float %9
%11 = fdiv float %10, 2.000000e+00
%12 = load float, float* %5
%13 = fmul float 0x400921FB60000000, %12
%14 = load float, float* %8
%15 = fdiv float %13, %14
%16 = call i32 @cos(float %15)
%17 = sub nsw i32 %16, 1
%18 = sitofp i32 %17 to float
%19 = load float, float* %6
%20 = call float @llvm.fmuladd.f32(float %11, float %18, float %19)
ret float %20
}

LLVM IR (-O2):
define float @sine_easeInOut(float %0, float %1, float %2, float %3) {
%5 = fmul float %2, -5.000000e-01
%6 = fmul float %0, 0x400921FB60000000
%7 = fdiv float %6, %3
%8 = tail call i32 @cos(float %7)
%9 = add nsw i32 %8, -1
%10 = sitofp i32 %9 to float
%11 = tail call float @llvm.fmuladd.f32(float %5, float %10, float %1)
ret float %11
}
int test_imm_C5int8_reg(signed char val) {
  return ((val) & (-0xC5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C5int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff3b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C5int8_reg>:
test   $0xffffff3b,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C5int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -197
%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_C5int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -197
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
void write_double(u_int8_t *d, FILE *f) { fwrite(d, sizeof(double), 1, f); }


x86 assembly (clang, -O0):
<write_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_double>:
mov    %rsi,%rcx
mov    $0x8,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define void @write_double(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 @fwrite(i32* %5, i32 8, i32 1, i32* %6)
ret void
}

LLVM IR (-O2):
define void @write_double(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fwrite(i32* %0, i32 8, i32 1, i32* %1)
ret void
}
void disable_servos() {}


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

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

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

LLVM IR (-O2):
define void @disable_servos() {
ret void
}
int reg_zero_bounds(double *xpos, double *ypos) {
  int retval = 1;
  xpos[0] = 0.0;
  xpos[1] = 0.0;
  ypos[0] = 0.0;
  ypos[1] = 0.0;
  return retval;
}


x86 assembly (clang, -O0):
<reg_zero_bounds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_zero_bounds>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
movups %xmm0,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @reg_zero_bounds(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store i32 1, i32* %5
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
store double 0.000000e+00, double* %7
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 1
store double 0.000000e+00, double* %9
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 0
store double 0.000000e+00, double* %11
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
store double 0.000000e+00, double* %13
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @reg_zero_bounds(double* nocapture writeonly %0, double* nocapture writeonly %1) {
%3 = bitcast double* %0 to i8*
%4 = bitcast double* %1 to i8*
ret i32 1
}
void vnum_test2(int *data) { data[0] = data[1] * data[3] - data[3] * data[1]; }


x86 assembly (clang, -O0):
<vnum_test2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
imul   0xc(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    -0x8(%rbp),%rdx
imul   0x4(%rdx),%eax
sub    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnum_test2>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @vnum_test2(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add(int, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello\n");
  add(1, 2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @add(i32 1, i32 2)
ret i32 0
}
long *get_msg_entry(struct Msg *msgpt) {
  long entry;
  entry = (long)msgpt;
  entry = (entry & 0xFFFFF000) + 0x1000;
  return (long *)entry;
}


x86 assembly (clang, -O0):
<get_msg_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movabs $0xfffff000,%rax
and    -0x10(%rbp),%rax
add    $0x1000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_msg_entry>:
and    $0xfffff000,%edi
lea    0x1000(%rdi),%rax
ret

LLVM IR (-O0):
%struct.Msg = type opaque
define i64* @get_msg_entry(%struct.Msg* %0) {
%2 = alloca %struct.Msg*
%3 = alloca i64
store %struct.Msg* %0, %struct.Msg** %2
%4 = load %struct.Msg*, %struct.Msg** %2
%5 = ptrtoint %struct.Msg* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = and i64 %6, 4294963200
%8 = add nsw i64 %7, 4096
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = inttoptr i64 %9 to i64*
ret i64* %10
}

LLVM IR (-O2):
%struct.Msg = type opaque
define i64* @get_msg_entry(%struct.Msg* %0) {
%2 = ptrtoint %struct.Msg* %0 to i64
%3 = and i64 %2, 4294963200
%4 = add nuw nsw i64 %3, 4096
%5 = inttoptr i64 %4 to i64*
ret i64* %5
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void I2CMasterGlitchFilterConfigSet(uint32_t ui32Base, uint32_t ui32Config) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000000C))) |= ui32Config;
}


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

x86 assembly (clang, -O2):
<I2CMasterGlitchFilterConfigSet>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0xc(%rcx)
ret

LLVM IR (-O0):
define void @I2CMasterGlitchFilterConfigSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 12
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterGlitchFilterConfigSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 12
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(const char *prg) {
  fprintf(stderr, "# Usage: %s [-c] [-g] [-l] <ctime>\n", prg);
  fprintf(stderr, "#  -c  show the ctime value\n"
                  "#  -g  show the time in GMT\n"
                  "#  -l  show the localtime which is the default so this is "
                  "only relevant to add to -g\n");
  exit(EINVAL);
}


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
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"# Usage: %s [-c] [-g] [-l] <ctime>\0A\00"
@.str.1 = [142 x i8] c"# -c show the ctime value\0A# -g show the time in GMT\0A# -l show the localtime which is the default so this is only relevant to add to -g\0A\00"
@EINVAL = global i32 0
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 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EINVAL
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"# Usage: %s [-c] [-g] [-l] <ctime>\0A\00"
@.str.1 = [142 x i8] c"# -c show the ctime value\0A# -g show the time in GMT\0A# -l show the localtime which is the default so this is only relevant to add to -g\0A\00"
@EINVAL = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EINVAL
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_string(char *);
int /*<<< orphan*/ output_with_tab(char *);
void gen_call(char *sname) {
  output_with_tab("call\t");
  output_string(sname);
  newline();
}


x86 assembly (clang, -O0):
<gen_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    -0x8(%rbp),%rdi
call   1040 <output_string@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_call>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    %rbx,%rdi
call   1040 <output_string@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"call\09\00"
define void @gen_call(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @output_string(i8* %4)
%6 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"call\09\00"
define void @gen_call(i8* %0) {
%2 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @output_string(i8* %0)
%4 = tail call i32 (...) @newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_GLOBAL_LOCALE;
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ malloc(int);
int /*<<< orphan*/ strerror_l(int /*<<< orphan*/, int /*<<< orphan*/);
void *thread_func(void *arg) {
  uintptr_t i = (uintptr_t)arg;
  if ((i & 1) == 0)
    free(malloc(16));
  strerror_l(0, LC_GLOBAL_LOCALE);
  return 0;
}


x86 assembly (clang, -O0):
<thread_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    1167 <thread_func+0x37>
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %eax,%edi
call   1030 <free@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1050 <strerror_l@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_func>:
push   %rax
test   $0x1,%dil
jne    1148 <thread_func+0x18>
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %eax,%edi
call   1030 <free@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1050 <strerror_l@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_GLOBAL_LOCALE = global i32 0
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = and i64 %6, 1
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @malloc(i32 16)
%11 = call i32 @free(i32 %10)
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* @LC_GLOBAL_LOCALE
%14 = call i32 @strerror_l(i32 0, i32 %13)
ret i8* null
}

LLVM IR (-O2):
@LC_GLOBAL_LOCALE = global i32 0
define noalias i8* @thread_func(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @malloc(i32 16)
%7 = tail call i32 @free(i32 %6)
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* @LC_GLOBAL_LOCALE
%10 = tail call i32 @strerror_l(i32 0, i32 %9)
ret i8* null
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 0xffffffffff660b45UL;
    local1 = 0UL;
    while (local1 < 0UL) {
      state[local1] *= state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] * 809088178UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xffffffffff660b45,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1159 <RandomFunc+0x59>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rcx
mov    -0x20(%rbp),%rax
imul   -0x18(%rbp,%rax,8),%rcx
mov    %rcx,-0x18(%rbp,%rax,8)
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
jmp    1125 <RandomFunc+0x25>
imul   $0x3039b4b2,-0x18(%rbp),%rcx
30
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
imul   $0x3039b4b2,(%rdi),%rax
movabs $0xffe2ff68c73d59fa,%rcx
ff e2 ff
add    %rax,%rcx
mov    %rcx,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, -10089659
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
store i64 0, i64* %6
br label %12
12: ; preds = %15, %2
%13 = load i64, i64* %6
%14 = icmp ult i64 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = load i64, i64* %6
%17 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %16
%18 = load i64, i64* %17
%19 = load i64, i64* %6
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %19
%21 = load i64, i64* %20
%22 = mul i64 %21, %18
store i64 %22, i64* %20
%23 = load i64, i64* %6
%24 = add i64 %23, 2
store i64 %24, i64* %6
br label %12
25: ; preds = %12
%26 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%27 = load i64, i64* %26
%28 = mul i64 %27, 809088178
%29 = load i64*, i64** %4
%30 = getelementptr inbounds i64, i64* %29, i64 0
store i64 %28, i64* %30
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = mul i64 %3, 809088178
%5 = add i64 %4, -8163423816951302
store i64 %5, i64* %1
ret void
}
/* Variables and functions */
int abs(int);
int main(int argc, const char *argv[]) {
  int a = 25;
  int b = -a;
  int c = abs(a);
  int d = abs(b);
  float e = d;
  int f = (a < b) ? a : b;
  int g = (a > b) ? a : b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x19,-0x14(%rbp)
xor    %eax,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x20(%rbp)
cvtsi2ssl -0x20(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    116c <main+0x5c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    1172 <main+0x62>
mov    -0x18(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    118f <main+0x7f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1195 <main+0x85>
mov    -0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 25, i32* %6
%13 = load i32, i32* %6
%14 = sub nsw i32 0, %13
store i32 %14, i32* %7
%15 = load i32, i32* %6
%16 = call i32 @abs(i32 %15)
store i32 %16, i32* %8
%17 = load i32, i32* %7
%18 = call i32 @abs(i32 %17)
store i32 %18, i32* %9
%19 = load i32, i32* %9
%20 = sitofp i32 %19 to float
store float %20, float* %10
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %2
%25 = load i32, i32* %6
br label %28
26: ; preds = %2
%27 = load i32, i32* %7
br label %28
28: ; preds = %26, %24
%29 = phi i32 [ %25, %24 ], [ %27, %26 ]
store i32 %29, i32* %11
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = icmp sgt i32 %30, %31
br i1 %32, label %33, label %35
33: ; preds = %28
%34 = load i32, i32* %6
br label %37
35: ; preds = %28
%36 = load i32, i32* %7
br label %37
37: ; preds = %35, %33
%38 = phi i32 [ %34, %33 ], [ %36, %35 ]
store i32 %38, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}