xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isRotation(char *, char *);
int /*<<< orphan*/ printf(char *);
void main() {
  if (isRotation("waterbottle", "bottlewater")) {
    printf("Yes\n");
  } else
    printf("No\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <isRotation@plt>
cmp    $0x0,%rax
je     1152 <main+0x32>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
jmp    115e <main+0x3e>
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedd(%rip),%rsi
call   1040 <isRotation@plt>
test   %rax,%rax
lea    0xeda(%rip),%rax
lea    0xed6(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"waterbottle\00"
@.str.1 = [12 x i8] c"bottlewater\00"
@.str.2 = [5 x i8] c"Yes\0A\00"
@.str.3 = [4 x i8] c"No\0A\00"
define void @main() {
%1 = call i64 @isRotation(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"waterbottle\00"
@.str.1 = [12 x i8] c"bottlewater\00"
@str = [3 x i8] c"No\00"
@str.4 = [4 x i8] c"Yes\00"
define void @main() {
%1 = tail call i64 @isRotation(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rtp_set_type(uint8_t *p_rtp, uint8_t i_type) { p_rtp[1] = i_type & 0x7f; }


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

x86 assembly (clang, -O2):
<rtp_set_type>:
and    $0x7f,%esi
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @rtp_set_type(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 127
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @rtp_set_type(i32* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 127
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
int link(char const *, char const *);
int fb_lfs_link(const char *existing, const char *new) {
  return (link(existing, new));
}


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

x86 assembly (clang, -O2):
<fb_lfs_link>:
jmp    1030 <link@plt>

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

LLVM IR (-O2):
define i32 @fb_lfs_link(i8* %0, i8* %1) {
%3 = tail call i32 @link(i8* %0, i8* %1)
ret i32 %3
}
void osalOsTimerHandlerI(void) { ; }


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

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

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

LLVM IR (-O2):
define void @osalOsTimerHandlerI() {
ret void
}
int ply_type_check(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @ply_type_check() {
ret i32 1
}

LLVM IR (-O2):
define i32 @ply_type_check() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_eq_int64(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void mpz_check_eq(mpz_t z, int64_t x) {
  if (!mpz_eq_int64(z, x)) {
    printf("*** BUG check_eq failed ***\n");
    fflush(stdout);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<mpz_check_eq>:
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 <mpz_eq_int64@plt>
cmp    $0x0,%eax
jne    1186 <mpz_check_eq+0x46>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpz_check_eq>:
push   %rax
call   1040 <mpz_eq_int64@plt>
test   %eax,%eax
je     114c <mpz_check_eq+0xc>
pop    %rax
ret
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"*** BUG check_eq failed ***\0A\00"
@stdout = global i32 0
define void @mpz_check_eq(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 @mpz_eq_int64(i32 %5, i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [28 x i8] c"*** BUG check_eq failed ***\00"
define void @mpz_check_eq(i32 %0, i32 %1) {
%3 = tail call i32 @mpz_eq_int64(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, unsigned int);
void f2(int size) {
  char src[12] = "helloworld";
  char dest[12];
  strncpy(dest, src, (unsigned)size);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
sub    $0x18,%rsp
mov    %edi,%edx
movabs $0x726f776f6c6c6568,%rax
77 6f 72
mov    %rax,(%rsp)
movl   $0x646c,0x8(%rsp)
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <strncpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.f2.src = [12 x i8] c"helloworld\00\00"
define void @f2(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i8]
%4 = alloca [12 x i8]
store i32 %0, i32* %2
%5 = bitcast [12 x i8]* %3 to i8*
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @strncpy(i8* %6, i8* %7, i32 %8)
ret void
}

LLVM IR (-O2):
@__const.f2.src = [12 x i8] c"helloworld\00\00"
define void @f2(i32 %0) {
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = call i32 @strncpy(i8* %5, i8* %4, i32 %0)
ret void
}
int cairo_code_draw_casBLabel_get_height() { return 10; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casBLabel_get_height() {
ret i32 10
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casBLabel_get_height() {
ret i32 10
}
/* Variables and functions */
int ECONNREFUSED;
int ECONNRESET;
int ENOTCONN;
int EPIPE;
int is_lost_conn(int e) {
  return e == ECONNREFUSED || e == ECONNRESET || e == ENOTCONN || e == EPIPE;
}


x86 assembly (clang, -O0):
<is_lost_conn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
mov    0x2ed5(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     115e <is_lost_conn+0x5e>
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
mov    0x2ea6(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     115e <is_lost_conn+0x5e>
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
mov    0x2e9f(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     115e <is_lost_conn+0x5e>
mov    -0x4(%rbp),%eax
mov    0x2e72(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_lost_conn>:
mov    0x2ee1(%rip),%rax
cmp    %edi,(%rax)
sete   %al
mov    0x2ebd(%rip),%rcx
cmp    %edi,(%rcx)
sete   %cl
or     %al,%cl
mov    0x2ebf(%rip),%rax
cmp    %edi,(%rax)
sete   %al
mov    0x2e9b(%rip),%rdx
cmp    %edi,(%rdx)
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
@ECONNREFUSED = global i32 0
@ECONNRESET = global i32 0
@ENOTCONN = global i32 0
@EPIPE = global i32 0
define i32 @is_lost_conn(i32 %0) {
%2 = load i32, i32* @ECONNREFUSED
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @ECONNRESET
%5 = icmp eq i32 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = load i32, i32* @ENOTCONN
%8 = icmp eq i32 %7, %0
%9 = select i1 %6, i1 true, i1 %8
%10 = load i32, i32* @EPIPE
%11 = icmp eq i32 %10, %0
%12 = select i1 %9, i1 true, i1 %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int sendto(int const, char const *, size_t, int /*<<< orphan*/,
           int /*<<< orphan*/ *, int /*<<< orphan*/);
int lin_rsk_sendto(const char *buffer, size_t buffer_size, const int sockfd) {
  if (((buffer[14] & 0xf0) >> 4) != 4) {
    return -1;
  }
  if (buffer_size < 34) {
    return -1;
  }
  return sendto(sockfd, buffer, buffer_size, 0, NULL, 0);
}


x86 assembly (clang, -O0):
<lin_rsk_sendto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0xe(%rax),%eax
and    $0xf0,%eax
sar    $0x4,%eax
cmp    $0x4,%eax
je     1148 <lin_rsk_sendto+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <lin_rsk_sendto+0x6d>
cmpq   $0x22,-0x18(%rbp)
jae    115f <lin_rsk_sendto+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <lin_rsk_sendto+0x6d>
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %r9d,%r9d
xor    %eax,%eax
mov    %eax,%r8d
mov    %r9d,%ecx
call   1030 <sendto@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lin_rsk_sendto>:
mov    %rsi,%rax
cmp    $0x22,%rsi
jb     1139 <lin_rsk_sendto+0x29>
mov    %rdi,%rsi
mov    0xe(%rdi),%cl
and    $0xf0,%cl
cmp    $0x40,%cl
jne    1139 <lin_rsk_sendto+0x29>
mov    %edx,%edi
mov    %rax,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <sendto@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @lin_rsk_sendto(i8* %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 14
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = and i32 %11, 240
%13 = ashr i32 %12, 4
%14 = icmp ne i32 %13, 4
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 -1, i32* %4
br label %25
16: ; preds = %3
%17 = load i64, i64* %6
%18 = icmp ult i64 %17, 34
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 -1, i32* %4
br label %25
20: ; preds = %16
%21 = load i32, i32* %7
%22 = load i8*, i8** %5
%23 = load i64, i64* %6
%24 = call i32 @sendto(i32 %21, i8* %22, i64 %23, i32 0, i32* null, i32 0)
store i32 %24, i32* %4
br label %25
25: ; preds = %20, %19, %15
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @lin_rsk_sendto(i8* %0, i64 %1, i32 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 14
%5 = load i8, i8* %4
%6 = and i8 %5, -16
%7 = icmp ne i8 %6, 64
%8 = icmp ult i64 %1, 34
%9 = or i1 %8, %7
br i1 %9, label %12, label %10
10: ; preds = %3
%11 = tail call i32 @sendto(i32 %2, i8* %0, i64 %1, i32 0, i32* null, i32 0)
br label %12
12: ; preds = %3, %10
%13 = phi i32 [ %11, %10 ], [ -1, %3 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timespec {
  long tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
struct timespec __evConsTime(time_t sec, long nsec) {
  struct timespec x;
  x.tv_sec = sec;
  x.tv_nsec = nsec;
  return (x);
}


x86 assembly (clang, -O0):
<__evConsTime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%edx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__evConsTime>:
mov    %rsi,%rax
mov    %edi,%edx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i32 }
define { i64, i32 } @__evConsTime(i32 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
%6 = load i32, i32* %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %6, i32* %7
%8 = load i64, i64* %5
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = bitcast %struct.timespec* %3 to { i64, i32 }*
%11 = load { i64, i32 }, { i64, i32 }* %10
ret { i64, i32 } %11
}

LLVM IR (-O2):
define { i64, i32 } @__evConsTime(i32 %0, i64 %1) {
%3 = insertvalue { i64, i32 } poison, i64 %1, 0
%4 = insertvalue { i64, i32 } %3, i32 %0, 1
ret { i64, i32 } %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int count[6] = {}, i, j;
  char a[6] = "Hello.";
  while (a[i] != '\0') {
    count[i] = a[i];
    i++;
  }
  for (j = 0; j < i - 1; j++) {
    printf("%d ", count[j]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
mov    0xebb(%rip),%eax
mov    %eax,-0x2e(%rbp)
mov    0xeb5(%rip),%ax
mov    %ax,-0x2a(%rbp)
movslq -0x24(%rbp),%rax
movsbl -0x2e(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1184 <main+0x64>
movslq -0x24(%rbp),%rax
movsbl -0x2e(%rbp,%rax,1),%ecx
movslq -0x24(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1153 <main+0x33>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11be <main+0x9e>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    118b <main+0x6b>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@__const.main.a = [6 x i8] c"Hello."
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca [6 x i8]
store i32 0, i32* %1
%6 = bitcast [6 x i32]* %2 to i8*
%7 = bitcast [6 x i8]* %5 to i8*
br label %8
8: ; preds = %15, %0
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %8
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %22
store i32 %20, i32* %23
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %8
26: ; preds = %8
store i32 0, i32* %4
br label %27
27: ; preds = %38, %26
%28 = load i32, i32* %4
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 1
%31 = icmp slt i32 %28, %30
br i1 %31, label %32, label %41
32: ; preds = %27
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %32
%39 = load i32, i32* %4
%40 = add nsw i32 %39, 1
store i32 %40, i32* %4
br label %27
41: ; preds = %27
ret i32 0
}

LLVM IR (-O2):
int test_fun(int x, int y, int z) {
  int c = 0;
  while ((x == y) && (x > z)) {
    while (y > z) {
      x = x - 1;
      y = y - 1;
      c = c + 1;
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x11(%rbp)
jne    1131 <test_fun+0x31>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1141 <test_fun+0x41>
jmp    1177 <test_fun+0x77>
jmp    1146 <test_fun+0x46>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1172 <test_fun+0x72>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <test_fun+0x46>
jmp    1114 <test_fun+0x14>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
xor    %ecx,%ecx
mov    %edi,%eax
sub    %edx,%eax
cmovle %ecx,%eax
cmp    %esi,%edi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_fun(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %30, %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ false, %8 ], [ %15, %12 ]
br i1 %17, label %18, label %31
18: ; preds = %16
br label %19
19: ; preds = %23, %18
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %30
23: ; preds = %19
%24 = load i32, i32* %4
%25 = sub nsw i32 %24, 1
store i32 %25, i32* %4
%26 = load i32, i32* %5
%27 = sub nsw i32 %26, 1
store i32 %27, i32* %5
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %19
30: ; preds = %19
br label %8
31: ; preds = %16
%32 = load i32, i32* %7
ret i32 %32
}

LLVM IR (-O2):
define i32 @test_fun(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = and i1 %4, %5
%7 = sub i32 %0, %2
%8 = select i1 %6, i32 %7, i32 0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ rtvOEM_ConfigureInterrupt();
int /*<<< orphan*/ tdmb_InitFEC();
int /*<<< orphan*/ tdmb_InitHOST();
int /*<<< orphan*/ tdmb_InitOFDM();
void tdmb_InitDemod(void) {
  tdmb_InitHOST();
  tdmb_InitOFDM();
  tdmb_InitFEC();
  rtvOEM_ConfigureInterrupt();
}


x86 assembly (clang, -O0):
<tdmb_InitDemod>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <tdmb_InitHOST@plt>
mov    $0x0,%al
call   1050 <tdmb_InitOFDM@plt>
mov    $0x0,%al
call   1040 <tdmb_InitFEC@plt>
mov    $0x0,%al
call   1060 <rtvOEM_ConfigureInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdmb_InitDemod>:
push   %rax
xor    %eax,%eax
call   1030 <tdmb_InitHOST@plt>
xor    %eax,%eax
call   1050 <tdmb_InitOFDM@plt>
xor    %eax,%eax
call   1040 <tdmb_InitFEC@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <rtvOEM_ConfigureInterrupt@plt>

LLVM IR (-O0):
define void @tdmb_InitDemod() {
%1 = call i32 (...) @tdmb_InitHOST()
%2 = call i32 (...) @tdmb_InitOFDM()
%3 = call i32 (...) @tdmb_InitFEC()
%4 = call i32 (...) @rtvOEM_ConfigureInterrupt()
ret void
}

LLVM IR (-O2):
define void @tdmb_InitDemod() {
%1 = tail call i32 (...) @tdmb_InitHOST()
%2 = tail call i32 (...) @tdmb_InitOFDM()
%3 = tail call i32 (...) @tdmb_InitFEC()
%4 = tail call i32 (...) @rtvOEM_ConfigureInterrupt()
ret void
}
void sound_close(void) {}


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

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

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

LLVM IR (-O2):
define void @sound_close() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD4Bit_commandWrite(int);
int /*<<< orphan*/ LCD4Bit_delay(int);
void LCD4Bit_rightScroll(int num_chars, int delay_time) {
  for (int i = 0; i < num_chars; i++) {
    LCD4Bit_commandWrite(0x18);
    LCD4Bit_delay(delay_time);
  }
}


x86 assembly (clang, -O0):
<LCD4Bit_rightScroll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1161 <LCD4Bit_rightScroll+0x41>
mov    $0x18,%edi
call   1030 <LCD4Bit_commandWrite@plt>
mov    -0x8(%rbp),%edi
call   1040 <LCD4Bit_delay@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <LCD4Bit_rightScroll+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD4Bit_rightScroll>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1146 <LCD4Bit_rightScroll+0x26>
mov    %esi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x18,%edi
call   1030 <LCD4Bit_commandWrite@plt>
mov    %ebx,%edi
call   1040 <LCD4Bit_delay@plt>
add    $0xffffffff,%ebp
jne    1130 <LCD4Bit_rightScroll+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @LCD4Bit_rightScroll(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 0, %2 ]
%7 = tail call i32 @LCD4Bit_commandWrite(i32 24)
%8 = tail call i32 @LCD4Bit_delay(i32 %1)
%9 = add nuw nsw i32 %6, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ b1_put_byte(unsigned int, int);
int /*<<< orphan*/ b1_put_word(unsigned int, unsigned int);
void b1_wr_reg(unsigned int base, unsigned int reg, unsigned int value) {
  b1_put_byte(base, 0x00);
  b1_put_word(base, reg);
  b1_put_word(base, value);
}


x86 assembly (clang, -O0):
<b1_wr_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <b1_put_byte@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <b1_put_word@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <b1_put_word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b1_wr_reg>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %esi,%esi
call   1040 <b1_put_byte@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <b1_put_word@plt>
mov    %ebx,%edi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <b1_put_word@plt>

LLVM IR (-O0):
define void @b1_wr_reg(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @b1_put_byte(i32 %7, i32 0)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @b1_put_word(i32 %9, i32 %10)
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = call i32 @b1_put_word(i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @b1_wr_reg(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @b1_put_byte(i32 %0, i32 0)
%5 = tail call i32 @b1_put_word(i32 %0, i32 %1)
%6 = tail call i32 @b1_put_word(i32 %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t bootloader_common_get_chip_ver_pkg(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bootloader_common_get_chip_ver_pkg() {
ret i32 0
}
unsigned long bintol(char *str) {
  unsigned long sum = 0L;
  char chh;
  while ((chh = *str) == '1' || chh == '0') {
    sum *= 2;
    if (chh == '1')
      sum++;
    str++;
  }
  return (sum);
}


x86 assembly (clang, -O0):
<bintol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%ecx
mov    $0x1,%al
cmp    $0x31,%ecx
mov    %al,-0x12(%rbp)
je     1137 <bintol+0x37>
movsbl -0x11(%rbp),%eax
cmp    $0x30,%eax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1147 <bintol+0x47>
jmp    117d <bintol+0x7d>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x31,%eax
jne    116c <bintol+0x6c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <bintol+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bintol>:
mov    (%rdi),%cl
mov    %ecx,%eax
and    $0xfe,%al
cmp    $0x30,%al
jne    112e <bintol+0x2e>
add    $0x1,%rdi
xor    %eax,%eax
xor    %edx,%edx
cmp    $0x31,%cl
sete   %dl
lea    (%rdx,%rax,2),%rax
movzbl (%rdi),%ecx
mov    %ecx,%edx
and    $0xfe,%dl
add    $0x1,%rdi
cmp    $0x30,%dl
je     1110 <bintol+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @bintol(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8
store i8* %0, i8** %2
store i64 0, i64* %3
br label %5
5: ; preds = %25, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
store i8 %7, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 49
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 48
br label %14
14: ; preds = %10, %5
%15 = phi i1 [ true, %5 ], [ %13, %10 ]
br i1 %15, label %16, label %28
16: ; preds = %14
%17 = load i64, i64* %3
%18 = mul i64 %17, 2
store i64 %18, i64* %3
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 49
br i1 %21, label %22, label %25
22: ; preds = %16
%23 = load i64, i64* %3
%24 = add i64 %23, 1
store i64 %24, i64* %3
br label %25
25: ; preds = %22, %16
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %2
br label %5
28: ; preds = %14
%29 = load i64, i64* %3
ret i64 %29
}

LLVM IR (-O2):
define i64 @bintol(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -2
%4 = icmp eq i8 %3, 48
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i8* [ %13, %5 ], [ %0, %1 ]
%8 = phi i64 [ %12, %5 ], [ 0, %1 ]
%9 = icmp eq i8 %6, 49
%10 = shl i64 %8, 1
%11 = zext i1 %9 to i64
%12 = or i64 %10, %11
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = and i8 %14, -2
%16 = icmp eq i8 %15, 48
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i64 [ 0, %1 ], [ %12, %5 ]
ret i64 %18
}
double aa_fsq(double a) { return a * a; }


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

x86 assembly (clang, -O2):
<aa_fsq>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @aa_fsq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
void matrix_double_free(double **Matrix, const int dimension1) {
  int i;
  for (i = 0; i < dimension1; i++) {
    free(Matrix[i]);
  }
  free(Matrix);
}


x86 assembly (clang, -O0):
<matrix_double_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <matrix_double_free+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <matrix_double_free+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_double_free>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <matrix_double_free+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <matrix_double_free+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @matrix_double_free(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
void putcha(c) char c;
{ putchar(c); }


x86 assembly (clang, -O0):
<putcha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putcha>:
movsbl %dil,%edi
xor    %eax,%eax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @putcha(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %5)
ret void
}

LLVM IR (-O2):
define void @putcha(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %3)
ret void
}
int twice_sum(int sum) { return sum + sum; }


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

x86 assembly (clang, -O2):
<twice_sum>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @twice_sum(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
int main() {
  int n = 5;
  int x[3 * n++];
  int i;
  for (i = 0; i < 15; i++) {
    x[i] = i;
  }
  int sum = 0;
  for (i = 0; i < 15; i++) {
    sum += x[i];
  }
  return sum + n;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %ecx,%eax
lea    (%rax,%rax,2),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xf,-0x1c(%rbp)
jge    1177 <main+0x77>
mov    -0x28(%rbp),%rax
mov    -0x1c(%rbp),%edx
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1151 <main+0x51>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xf,-0x1c(%rbp)
jge    11ae <main+0xae>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1185 <main+0x85>
mov    -0x20(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = mul nsw i32 3, %7
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %3
%12 = alloca i32, i64 %10
store i64 %10, i64* %4
store i32 0, i32* %5
br label %13
13: ; preds = %21, %0
%14 = load i32, i32* %5
%15 = icmp slt i32 %14, 15
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i32, i32* %5
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %12, i64 %19
store i32 %17, i32* %20
br label %21
21: ; preds = %16
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %13
24: ; preds = %13
store i32 0, i32* %6
store i32 0, i32* %5
br label %25
25: ; preds = %35, %24
%26 = load i32, i32* %5
%27 = icmp slt i32 %26, 15
br i1 %27, label %28, label %38
28: ; preds = %25
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %12, i64 %30
%32 = load i32, i32* %31
%33 = load i32, i32* %6
%34 = add nsw i32 %33, %32
store i32 %34, i32* %6
br label %35
35: ; preds = %28
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
store i32 %37, i32* %5
br label %25
38: ; preds = %25
%39 = load i32, i32* %6
%40 = load i32, i32* %2
%41 = add nsw i32 %39, %40
store i32 %41, i32* %1
%42 = load i8*, i8** %3
%43 = load i32, i32* %1
ret i32 %43
}

LLVM IR (-O2):
define i32 @main() {
ret i32 111
}
void alloca_region(int a) {
  if (a == 5) {
    char *x = __builtin_alloca(a);
    x[4] = 4;
    x[5] = 5;
  }
}


x86 assembly (clang, -O0):
<alloca_region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    113e <alloca_region+0x3e>
movslq -0x4(%rbp),%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
sub    %rcx,%rax
mov    %rax,%rsp
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x4,0x4(%rax)
mov    -0x10(%rbp),%rax
movb   $0x5,0x5(%rax)
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @alloca_region(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 5
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = alloca i8, i64 %8
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 4
store i8 4, i8* %11
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 5
store i8 5, i8* %13
br label %14
14: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @alloca_region(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t crc_reflect(uint32_t input) {
  uint32_t reflected = 0;
  for (int i = 0; i < 32; i++) {
    reflected <<= 1;
    reflected |= input & 1;
    input >>= 1;
  }
  return reflected;
}


x86 assembly (clang, -O0):
<crc_reflect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    114b <crc_reflect+0x4b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <crc_reflect+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_reflect>:
xor    %eax,%eax
mov    $0x20,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
shl    $0x2,%edx
lea    (%rdx,%rax,8),%eax
mov    %edi,%edx
and    $0x2,%edx
or     %eax,%edx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
or     %edx,%eax
mov    %edi,%edx
shr    $0x3,%edx
and    $0x1,%edx
lea    (%rdx,%rax,2),%eax
sar    $0x4,%edi
add    $0xfffffffc,%ecx
jne    1110 <crc_reflect+0x10>
ret

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

LLVM IR (-O2):
define i32 @crc_reflect(i32 %0) {
br label %3
2: ; preds = %3
ret i32 %19
3: ; preds = %3, %1
%4 = phi i32 [ 0, %1 ], [ %21, %3 ]
%5 = phi i32 [ 0, %1 ], [ %19, %3 ]
%6 = phi i32 [ %0, %1 ], [ %20, %3 ]
%7 = shl i32 %5, 3
%8 = shl i32 %6, 2
%9 = and i32 %8, 4
%10 = or i32 %7, %9
%11 = and i32 %6, 2
%12 = or i32 %10, %11
%13 = lshr i32 %6, 2
%14 = and i32 %13, 1
%15 = or i32 %12, %14
%16 = lshr i32 %6, 3
%17 = shl i32 %15, 1
%18 = and i32 %16, 1
%19 = or i32 %17, %18
%20 = ashr i32 %6, 4
%21 = add nuw nsw i32 %4, 4
%22 = icmp eq i32 %21, 32
br i1 %22, label %2, label %3
}
int cd(char *pathname) {
  int retval;
  __asm__("int $0x80      \n\t"
          "mov %%eax, %0"
          : "=m"(retval)
          : "a"(11), "b"(pathname)
          : "memory");
  return retval;
}


x86 assembly (clang, -O0):
<cd>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx
mov    $0xb,%eax
int    $0x80
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd>:
push   %rbx
mov    %rdi,%rbx
mov    $0xb,%eax
int    $0x80
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cd(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  float a = 2.5;
  float b = 2.5;
  __VERIFIER_assert(a < b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 2.500000e+00, float* %2
store float 2.500000e+00, float* %3
%4 = load float, float* %2
%5 = load float, float* %3
%6 = fcmp olt float %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 0)
ret i32 0
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int queue_init(struct node **pp_queue_header, struct node **pp_queue_tail) {
  (*pp_queue_header) = NULL;
  (*pp_queue_tail) = NULL;
  return 1;
}


x86 assembly (clang, -O0):
<queue_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_init>:
movq   $0x0,(%rdi)
movq   $0x0,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @queue_init(%struct.node** %0, %struct.node** %1) {
%3 = alloca %struct.node**
%4 = alloca %struct.node**
store %struct.node** %0, %struct.node*** %3
store %struct.node** %1, %struct.node*** %4
%5 = load %struct.node**, %struct.node*** %3
store %struct.node* null, %struct.node** %5
%6 = load %struct.node**, %struct.node*** %4
store %struct.node* null, %struct.node** %6
ret i32 1
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @queue_init(%struct.node** nocapture writeonly %0, %struct.node** nocapture writeonly %1) {
store %struct.node* null, %struct.node** %0
store %struct.node* null, %struct.node** %1
ret i32 1
}
void printRanges(int arr[], int n) {}


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

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

LLVM IR (-O0):
define void @printRanges(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @printRanges(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int expect(char *, char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, long);
bool expect_int(char *expr, char *opts, long expected) {
  char value[512];
  snprintf(value, 512, "%ld", expected);
  return expect(expr, opts, value);
}


x86 assembly (clang, -O0):
<expect_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x200,%esi
lea    0xeb2(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x220(%rbp),%rdx
call   1030 <expect@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_int>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %rdx,%rcx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec4(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x200,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <expect@plt>
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i32 @expect_int(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca [512 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%9 = load i64, i64* %6
%10 = call i32 @snprintf(i8* %8, i32 512, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%14 = call i32 @expect(i8* %11, i8* %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @expect_int(i8* %0, i8* %1, i64 %2) {
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 512, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %2)
%7 = call i32 @expect(i8* %0, i8* %1, i8* %5)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ clearerr(int /*<<< orphan*/ *);
void uninitvar_clearerr(void) {
  FILE *stream;
  clearerr(stream);
}


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

x86 assembly (clang, -O2):
<uninitvar_clearerr>:
jmp    1030 <clearerr@plt>

LLVM IR (-O0):
define void @uninitvar_clearerr() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @clearerr(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_clearerr() {
%1 = tail call i32 @clearerr(i32* undef)
ret void
}
/* Variables and functions */
int solve_degree_4(double const *, double *);
int polynomial_solve_degree_4(const double *c, double *x) {
  return solve_degree_4(c, x);
}


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

x86 assembly (clang, -O2):
<polynomial_solve_degree_4>:
jmp    1030 <solve_degree_4@plt>

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

LLVM IR (-O2):
define i32 @polynomial_solve_degree_4(double* %0, double* %1) {
%3 = tail call i32 @solve_degree_4(double* %0, double* %1)
ret i32 %3
}