xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_line(char *);
int /*<<< orphan*/ output_with_tab(char *);
int /*<<< orphan*/ print_label(int);
void gen_test_jump(int label, int ft) {
  output_line("cmpd #0");
  if (ft)
    output_with_tab("lbne ");
  else
    output_with_tab("lbeq ");
  print_label(label);
  newline();
}


x86 assembly (clang, -O0):
<gen_test_jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xeab(%rip),%rdi
call   1060 <output_line@plt>
cmpl   $0x0,-0x8(%rbp)
je     1175 <gen_test_jump+0x35>
lea    0xe9d(%rip),%rdi
call   1050 <output_with_tab@plt>
jmp    1181 <gen_test_jump+0x41>
lea    0xe92(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_label@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_test_jump>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xeb2(%rip),%rdi
call   1060 <output_line@plt>
test   %ebx,%ebx
lea    0xeb2(%rip),%rax
lea    0xea5(%rip),%rdi
cmove  %rax,%rdi
call   1050 <output_with_tab@plt>
mov    %ebp,%edi
call   1040 <print_label@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"cmpd\00"
@.str.1 = [6 x i8] c"lbne \00"
@.str.2 = [6 x i8] c"lbeq \00"
define void @gen_test_jump(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @output_line(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %3
%14 = call i32 @print_label(i32 %13)
%15 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"cmpd\00"
@.str.1 = [6 x i8] c"lbne \00"
@.str.2 = [6 x i8] c"lbeq \00"
define void @gen_test_jump(i32 %0, i32 %1) {
%3 = tail call i32 @output_line(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @output_with_tab(i8* %5)
%7 = tail call i32 @print_label(i32 %0)
%8 = tail call i32 (...) @newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_byte(char);
int /*<<< orphan*/ output_decimal(int);
void output_number_signed(int num) {
  if (num >= 0)
    output_byte('+');
  output_decimal(num);
}


x86 assembly (clang, -O0):
<output_number_signed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     113f <output_number_signed+0x1f>
mov    $0x2b,%edi
call   1040 <output_byte@plt>
mov    -0x4(%rbp),%edi
call   1030 <output_decimal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_number_signed>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
js     1131 <output_number_signed+0x11>
mov    $0x2b,%edi
call   1040 <output_byte@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <output_decimal@plt>

LLVM IR (-O0):
define void @output_number_signed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @output_byte(i8 signext 43)
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = call i32 @output_decimal(i32 %8)
ret void
}

LLVM IR (-O2):
define void @output_number_signed(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @output_byte(i8 signext 43)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @output_decimal(i32 %0)
ret void
}
void set_defaults() {}


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

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

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

LLVM IR (-O2):
define void @set_defaults() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *mstrdup(char *s) {
  char *p;
  p = (char *)malloc(strlen(s) + 1);
  if (p != NULL)
    strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<mstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <mstrdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <mstrdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
br label %15
15: ; preds = %11, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @mstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int __uportsys_shutdown(int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
int shutdown(int sd, int how) { return __uportsys_shutdown(sd, how, &errno); }


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

x86 assembly (clang, -O2):
<shutdown>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <__uportsys_shutdown@plt>

LLVM IR (-O0):
@errno = global i32 0
define i32 @shutdown(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 @__uportsys_shutdown(i32 %5, i32 %6, i32* @errno)
ret i32 %7
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @shutdown(i32 %0, i32 %1) {
%3 = tail call i32 @__uportsys_shutdown(i32 %0, i32 %1, i32* @errno)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
size_t u8_charlen(uint32_t ch) {
  if (ch < 0x80)
    return 1;
  else if (ch < 0x800)
    return 2;
  else if (ch < 0x10000)
    return 3;
  else if (ch < 0x110000)
    return 4;
  return 0;
}


x86 assembly (clang, -O0):
<u8_charlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    1121 <u8_charlen+0x21>
movq   $0x1,-0x8(%rbp)
jmp    1186 <u8_charlen+0x86>
cmpl   $0x800,-0xc(%rbp)
jge    113b <u8_charlen+0x3b>
movq   $0x2,-0x8(%rbp)
jmp    1186 <u8_charlen+0x86>
cmpl   $0x10000,-0xc(%rbp)
jge    1155 <u8_charlen+0x55>
movq   $0x3,-0x8(%rbp)
jmp    1186 <u8_charlen+0x86>
cmpl   $0x110000,-0xc(%rbp)
jge    116f <u8_charlen+0x6f>
movq   $0x4,-0x8(%rbp)
jmp    1186 <u8_charlen+0x86>
jmp    1174 <u8_charlen+0x74>
jmp    1179 <u8_charlen+0x79>
jmp    117e <u8_charlen+0x7e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8_charlen>:
mov    $0x1,%eax
cmp    $0x80,%edi
jl     1136 <u8_charlen+0x36>
mov    $0x2,%eax
cmp    $0x800,%edi
jb     1136 <u8_charlen+0x36>
mov    $0x3,%eax
cmp    $0x10000,%edi
jb     1136 <u8_charlen+0x36>
xor    %eax,%eax
cmp    $0x110000,%edi
setb   %al
shl    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @u8_charlen(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %23
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 2048
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 2, i64* %2
br label %23
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 65536
br i1 %13, label %14, label %15
14: ; preds = %11
store i64 3, i64* %2
br label %23
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 1114112
br i1 %17, label %18, label %19
18: ; preds = %15
store i64 4, i64* %2
br label %23
19: ; preds = %15
br label %20
20: ; preds = %19
br label %21
21: ; preds = %20
br label %22
22: ; preds = %21
store i64 0, i64* %2
br label %23
23: ; preds = %22, %18, %14, %10, %6
%24 = load i64, i64* %2
ret i64 %24
}

LLVM IR (-O2):
define i64 @u8_charlen(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2048
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 65536
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 1114112
%9 = select i1 %8, i64 4, i64 0
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i64 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i64 %11
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void putu32(uint8_t *buffer, uint32_t data) {
  buffer[0] = (uint8_t)(data & 0xff);
  buffer[1] = (uint8_t)((data >> 8) & 0xff);
  buffer[2] = (uint8_t)((data >> 16) & 0xff);
  buffer[3] = (uint8_t)((data >> 24) & 0xff);
}


x86 assembly (clang, -O0):
<putu32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putu32>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %rcx,(%rdi)
movzbl %ah,%ecx
mov    %rcx,0x8(%rdi)
mov    %esi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %rcx,0x10(%rdi)
shr    $0x18,%eax
mov    %rax,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @putu32(i64* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
%4 = zext i32 %3 to i64
store i64 %4, i64* %0
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %7, i64* %8
%9 = lshr i32 %1, 16
%10 = and i32 %9, 255
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %11, i64* %12
%13 = lshr i32 %1, 24
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %14, i64* %15
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t SDLGui_Init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SDLGui_Init() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ write_to_file(int, char *, int, scalar_t__ *);
void add_padding(int fd, uint32_t *start, uint32_t end) {
  char c = 0;
  while (*start < end) {
    write_to_file(fd, &c, 1, start);
  }
}


x86 assembly (clang, -O0):
<add_padding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0x0,-0x19(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jge    1152 <add_padding+0x42>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
lea    -0x19(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write_to_file@plt>
jmp    1127 <add_padding+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_padding>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movb   $0x0,0x7(%rsp)
cmp    %rdx,(%rsi)
jge    1147 <add_padding+0x37>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x7(%rsp),%r15
xchg   %ax,%ax
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <write_to_file@plt>
cmp    %r14,(%rbx)
jl     1130 <add_padding+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @add_padding(i32 %0, i64* %1, i64 %2) {
%4 = alloca i8
store i8 0, i8* %4
%5 = load i64, i64* %1
%6 = icmp slt i64 %5, %2
br i1 %6, label %7, label %11
7: ; preds = %3, %7
%8 = call i32 @write_to_file(i32 %0, i8* %4, i32 1, i64* %1)
%9 = load i64, i64* %1
%10 = icmp slt i64 %9, %2
br i1 %10, label %7, label %11
11: ; preds = %7, %3
ret void
}
unsigned char clip(int c) {
  if (c > 255)
    c = 255;
  return (unsigned char)c;
}


x86 assembly (clang, -O0):
<clip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    111b <clip+0x1b>
movl   $0xff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip>:
cmp    $0xff,%edi
mov    $0xff,%eax
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @clip(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 255
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 255, i32* %2
br label %6
6: ; preds = %5, %1
%7 = load i32, i32* %2
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @clip(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = trunc i32 %3 to i8
ret i8 %4
}
void CHECK_PICK(void) { (void)0; }


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

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

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

LLVM IR (-O2):
define void @CHECK_PICK() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, void *);
void CheckAlignment(void *pointer) {
  printf("Variable address: %p\n", pointer);
  assert((uintptr_t)pointer % 16 == 0);
}


x86 assembly (clang, -O0):
<CheckAlignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
and    $0xf,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckAlignment>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
test   $0xf,%bl
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Variable address: %p\0A\00"
define void @CheckAlignment(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i64
%7 = urem i64 %6, 16
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Variable address: %p\0A\00"
define void @CheckAlignment(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = ptrtoint i8* %0 to i64
%4 = and i64 %3, 15
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret void
}
/* Variables and functions */
unsigned char UART1_Read();
unsigned char get() { return UART1_Read(); }


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

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

LLVM IR (-O0):
define zeroext i8 @get() {
%1 = call zeroext i8 (...) @UART1_Read()
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @get() {
%1 = tail call zeroext i8 (...) @UART1_Read()
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ printg(char *);
void test16() { printg("Hello, world!\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
define void @test16() {
%1 = call i32 @printg(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, world!\0A\00"
define void @test16() {
%1 = tail call i32 @printg(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ socket_printf(struct session *, int, char *, int, int, int);
int /*<<< orphan*/ telopt_debug(struct session *, char *);
int send_dont_mccp2(struct session *ses, int cplen, unsigned char *cpsrc) {
  socket_printf(ses, 3, "%c%c%c", 255, 254, 86);
  telopt_debug(ses, "SENT DONT MCCP2");
  return 3;
}


x86 assembly (clang, -O0):
<send_dont_mccp2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
lea    0xebd(%rip),%rdx
mov    $0xff,%ecx
mov    $0xfe,%r8d
mov    $0x56,%r9d
call   1040 <socket_printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1030 <telopt_debug@plt>
mov    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_dont_mccp2>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdx
mov    $0x3,%esi
mov    $0xff,%ecx
mov    $0xfe,%r8d
mov    $0x56,%r9d
call   1040 <socket_printf@plt>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
call   1030 <telopt_debug@plt>
mov    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.session = type { i32 }
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [16 x i8] c"SENT DONT MCCP2\00"
define i32 @send_dont_mccp2(%struct.session* %0, i32 %1, i8* %2) {
%4 = alloca %struct.session*
%5 = alloca i32
%6 = alloca i8*
store %struct.session* %0, %struct.session** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.session*, %struct.session** %4
%8 = call i32 @socket_printf(%struct.session* %7, i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 255, i32 254, i32 86)
%9 = load %struct.session*, %struct.session** %4
%10 = call i32 @telopt_debug(%struct.session* %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 3
}

LLVM IR (-O2):
%struct.session = type { i32 }
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [16 x i8] c"SENT DONT MCCP2\00"
define i32 @send_dont_mccp2(%struct.session* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @socket_printf(%struct.session* %0, i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 255, i32 254, i32 86)
%5 = tail call i32 @telopt_debug(%struct.session* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage: yasp FILE\n"
         "\tavailable format: S98(S98V1/S98V3), VGM(YM2608+ADPCM/YM2151)\n");
}


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

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

LLVM IR (-O0):
@.str = [80 x i8] c"usage: yasp FILE\0A\09available format: S98(S98V1/S98V3), VGM(YM2608+ADPCM/YM2151)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [79 x i8] c"usage: yasp FILE\0A\09available format: S98(S98V1/S98V3), VGM(YM2608+ADPCM/YM2151)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int INT_MAX;
int uint2int(unsigned n) {
  int r;
  if (n < INT_MAX + 1u) {
    r = n;
  } else {
    n = n - INT_MAX - 1;
    r = n;
    r = r - INT_MAX - 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<uint2int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jae    1129 <uint2int+0x29>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <uint2int+0x53>
mov    -0x4(%rbp),%eax
mov    0x2eb5(%rip),%rcx
sub    (%rcx),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e9d(%rip),%rcx
sub    (%rcx),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint2int>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%ecx
lea    0x1(%rcx),%edx
not    %ecx
add    %ecx,%ecx
xor    %eax,%eax
cmp    %edi,%edx
cmovbe %ecx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @uint2int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @INT_MAX
%6 = add i32 %5, 1
%7 = icmp ult i32 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %2
store i32 %9, i32* %3
br label %20
10: ; preds = %1
%11 = load i32, i32* %2
%12 = load i32, i32* @INT_MAX
%13 = sub i32 %11, %12
%14 = sub i32 %13, 1
store i32 %14, i32* %2
%15 = load i32, i32* %2
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = load i32, i32* @INT_MAX
%18 = sub i32 %16, %17
%19 = sub i32 %18, 1
store i32 %19, i32* %3
br label %20
20: ; preds = %10, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @uint2int(i32 %0) {
%2 = load i32, i32* @INT_MAX
%3 = add i32 %2, 1
%4 = icmp ugt i32 %3, %0
%5 = xor i32 %2, -1
%6 = shl i32 %5, 1
%7 = select i1 %4, i32 0, i32 %6
%8 = add i32 %7, %0
ret i32 %8
}
int *getNull() { return 0; }


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

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

LLVM IR (-O0):
define i32* @getNull() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @getNull() {
ret i32* null
}
int ft_isprint(int c) {
  if (c >= 32 && c < 127)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     1127 <ft_isprint+0x27>
cmpl   $0x7f,-0x8(%rbp)
jge    1127 <ft_isprint+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isprint+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 127
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t get_motor_position(uint8_t number) {}


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

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

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

LLVM IR (-O2):
define i32 @get_motor_position(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int inb(int);
void kbd_wait() {
  while (inb(0x64) & 2)
    ;
}


x86 assembly (clang, -O0):
<kbd_wait>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <kbd_wait+0x9>
mov    $0x64,%edi
call   1030 <inb@plt>
and    $0x2,%eax
cmp    $0x0,%eax
je     1134 <kbd_wait+0x24>
jmp    1119 <kbd_wait+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kbd_wait>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <inb@plt>
test   $0x2,%al
jne    1120 <kbd_wait+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @kbd_wait() {
br label %1
1: ; preds = %5, %0
%2 = call i32 @inb(i32 100)
%3 = and i32 %2, 2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @kbd_wait() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @inb(i32 100)
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Die(char *);
void *malloc(size_t);
void *Smalloc(size_t size) {
  void *ptr = NULL;
  if ((ptr = malloc(size)) == NULL)
    Die("memory allocation failure");
  return ptr;
}


x86 assembly (clang, -O0):
<Smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1157 <Smalloc+0x37>
lea    0xeae(%rip),%rdi
call   1040 <Die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Smalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <Smalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <Die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"memory allocation failure\00"
define i8* @Smalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* null, i8** %3
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @Die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [26 x i8] c"memory allocation failure\00"
define noalias i8* @Smalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @Die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void foo475() {}


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

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

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

LLVM IR (-O2):
define void @foo475() {
ret void
}
cbuf33(f, n) int f, n;
{ cbuf(f, n, 33); }


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

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

LLVM IR (-O0):
define i32 @cbuf33(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 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 33)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf33(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 33)
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
int get_XKeyPressedEvent_send_event(void *_p) {
  return (int)((XKeyPressedEvent *)_p)->send_event;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XKeyPressedEvent_send_event(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
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XKeyPressedEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ clock();
clock_t getClock(void) {
  return clock();
  ;
}


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

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

LLVM IR (-O0):
define i32 @getClock() {
%1 = call i32 (...) @clock()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getClock() {
%1 = tail call i32 (...) @clock()
ret i32 %1
}
/* Variables and functions */
unsigned int htonl(unsigned int);
int /*<<< orphan*/ memcpy(char *, unsigned int *, int);
void writeInt(unsigned int value, char *out) {
  unsigned int v = htonl(value);
  memcpy(out, &value, 4);
}


x86 assembly (clang, -O0):
<writeInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeInt>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
call   1030 <htonl@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @writeInt(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = call i32 @htonl(i32 %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %4
%9 = call i32 @memcpy(i8* %8, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
define void @writeInt(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = tail call i32 @htonl(i32 %0)
%5 = call i32 @memcpy(i8* %1, i32* %3, i32 4)
ret void
}
void I2STxRxDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000C00))) &=
      ~(0x00000001 | 0x00000002);
}


x86 assembly (clang, -O0):
<I2STxRxDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc00(%rax),%rcx
and    $0xfffffffffffffffc,%rcx
mov    %rcx,0xc00(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2STxRxDisable>:
andq   $0xfffffffffffffffc,0xc00(%rdi)
fc
ret

LLVM IR (-O0):
define void @I2STxRxDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 3072
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -4
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2STxRxDisable(i64 %0) {
%2 = add i64 %0, 3072
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -4
store volatile i64 %5, i64* %3
ret void
}
int cmpTipVal(void *v1, void *v2) {
  int i1, i2;
  i1 = *((int *)v1);
  i2 = *((int *)v2);
  return (i1 < i2) ? -1 : ((i1 == i2) ? 0 : 1);
}


x86 assembly (clang, -O0):
<cmpTipVal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1137 <cmpTipVal+0x37>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <cmpTipVal+0x4c>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cmpTipVal(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 slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
scalar_t__ ceil(float);
float ceilf(float x) { return (float)ceil(x); }


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

x86 assembly (clang, -O2):
<ceilf>:
push   %rax
call   1030 <ceil@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ceilf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @ceil(float %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @ceilf(float %0) {
%2 = tail call i64 @ceil(float %0)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dll_fclose(int /*<<< orphan*/ *);
int __wrap_fclose(FILE *fp) { return dll_fclose(fp); }


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

x86 assembly (clang, -O2):
<__wrap_fclose>:
jmp    1030 <dll_fclose@plt>

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

LLVM IR (-O2):
define i32 @__wrap_fclose(i32* %0) {
%2 = tail call i32 @dll_fclose(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int str_cmp(char *str1, char *str2) { printf("%s, %s\n", str1, str2); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s, %s\0A\00"
define i32 @str_cmp(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert('a' == 97);
  assert('z' == 122);
  assert('A' == 65);
  assert('Z' == 90);
  assert('\n' == 10);
  assert('\r' == 13);
  assert('\0' == 0);
  assert('\'' == 39);
  assert('\01' == 1);
  assert('\013' == 013);
  assert('\x12' == 0x12);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @assert(i32 1)
%3 = call i32 @assert(i32 1)
%4 = call i32 @assert(i32 1)
%5 = call i32 @assert(i32 1)
%6 = call i32 @assert(i32 1)
%7 = call i32 @assert(i32 1)
%8 = call i32 @assert(i32 1)
%9 = call i32 @assert(i32 1)
%10 = call i32 @assert(i32 1)
%11 = call i32 @assert(i32 1)
%12 = call i32 @assert(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
%5 = tail call i32 @assert(i32 1)
%6 = tail call i32 @assert(i32 1)
%7 = tail call i32 @assert(i32 1)
%8 = tail call i32 @assert(i32 1)
%9 = tail call i32 @assert(i32 1)
%10 = tail call i32 @assert(i32 1)
%11 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
unsigned char CheckId_SIV100A(void) {
  unsigned char temp1;
  unsigned char temp2;
  VIM_SIF_I2cReadByte(0x01, &temp1);
  VIM_SIF_I2cReadByte(0x02, &temp2);
  if ((temp1 == 0x0C) && (temp2 == 0x10))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    $0x2,%edi
lea    -0x3(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
cmp    $0xc,%eax
jne    1157 <CheckId_SIV100A+0x47>
movzbl -0x3(%rbp),%eax
cmp    $0x10,%eax
jne    1157 <CheckId_SIV100A+0x47>
movb   $0x1,-0x1(%rbp)
jmp    115b <CheckId_SIV100A+0x4b>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
lea    0x6(%rsp),%rsi
mov    $0x2,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    0x7(%rsp),%al
xor    $0xc,%al
mov    0x6(%rsp),%cl
xor    $0x10,%cl
or     %al,%cl
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define zeroext i8 @CheckId_SIV100A() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 1, i8* %1)
%4 = call i32 @VIM_SIF_I2cReadByte(i32 2, i8* %2)
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 12
%7 = load i8, i8* %2
%8 = icmp eq i8 %7, 16
%9 = select i1 %6, i1 %8, i1 false
%10 = zext i1 %9 to i8
ret i8 %10
}
/* Type definitions */
struct quat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ quat_negative(float *, float *);
__attribute__((always_)) struct quat *psquat_negative(struct quat *result,
                                                      struct quat *a) {
  quat_negative((float *)result, (float *)a);
  return result;
}


x86 assembly (clang, -O0):
<psquat_negative>:
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 <quat_negative@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psquat_negative>:
push   %rbx
mov    %rdi,%rbx
call   1030 <quat_negative@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.quat = type { i32 }
define %struct.quat* @psquat_negative(%struct.quat* %0, %struct.quat* %1) {
%3 = alloca %struct.quat*
%4 = alloca %struct.quat*
store %struct.quat* %0, %struct.quat** %3
store %struct.quat* %1, %struct.quat** %4
%5 = load %struct.quat*, %struct.quat** %3
%6 = bitcast %struct.quat* %5 to float*
%7 = load %struct.quat*, %struct.quat** %4
%8 = bitcast %struct.quat* %7 to float*
%9 = call i32 @quat_negative(float* %6, float* %8)
%10 = load %struct.quat*, %struct.quat** %3
ret %struct.quat* %10
}

LLVM IR (-O2):
%struct.quat = type { i32 }
define %struct.quat* @psquat_negative(%struct.quat* returned %0, %struct.quat* %1) {
%3 = bitcast %struct.quat* %0 to float*
%4 = bitcast %struct.quat* %1 to float*
%5 = tail call i32 @quat_negative(float* %3, float* %4)
ret %struct.quat* %0
}
void f(char *cp) {
#pragma acc parallel pcopyout(cp [5:7])
  ;
}


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

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

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

LLVM IR (-O2):
define void @f(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ m36_setParams41X1(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m36_setParams42XX(int /*<<< orphan*/, int /*<<< orphan*/);
void m36_setParams41X1_42XX(uint16_t addr, uint8_t val) {
  m36_setParams41X1(addr, val);
  m36_setParams42XX(addr, val);
}


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

x86 assembly (clang, -O2):
<m36_setParams41X1_42XX>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <m36_setParams41X1@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <m36_setParams42XX@plt>

LLVM IR (-O0):
define void @m36_setParams41X1_42XX(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 @m36_setParams41X1(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @m36_setParams42XX(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @m36_setParams41X1_42XX(i32 %0, i32 %1) {
%3 = tail call i32 @m36_setParams41X1(i32 %0, i32 %1)
%4 = tail call i32 @m36_setParams42XX(i32 %0, i32 %1)
ret void
}
/* Type definitions */
struct mloop_signal {
  int dummy;
};

/* Variables and functions */
int mloop__unref_any(struct mloop_signal *);
__attribute__((visibility("default"))) int
mloop_signal_unref(struct mloop_signal *self) {
  return mloop__unref_any(self);
}


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

x86 assembly (clang, -O2):
<mloop_signal_unref>:
jmp    1030 <mloop__unref_any@plt>

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

LLVM IR (-O2):
%struct.mloop_signal = type { i32 }
define i32 @mloop_signal_unref(%struct.mloop_signal* %0) {
%2 = tail call i32 @mloop__unref_any(%struct.mloop_signal* %0)
ret i32 %2
}