xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ main_menu();
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("Welcome in BSQ!\n");
  main_menu();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <main_menu@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [16 x i8] c"Welcome in BSQ!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @main_menu()
ret i32 0
}
void XtIsApplicationShell() {}


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

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

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

LLVM IR (-O2):
define void @XtIsApplicationShell() {
ret void
}
int somma(int x) {
  if (x < 10)
    return x;
  return (x % 10) + somma(x / 10);
}


x86 assembly (clang, -O0):
<somma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1130 <somma+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <somma+0x48>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <somma@plt>
mov    -0xc(%rbp),%edx
add    %eax,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<somma>:
xor    %eax,%eax
cmp    $0xa,%edi
jge    110c <somma+0xc>
mov    %edi,%edx
add    %edx,%eax
ret
xor    %eax,%eax
mov    $0xcccccccd,%r8d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
add    %ecx,%eax
cmp    $0x63,%edi
mov    %edx,%edi
ja     1120 <somma+0x20>
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @somma(i32 %0) {
%2 = icmp slt i32 %0, 10
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = urem i32 %4, 10
%7 = udiv i32 %4, 10
%8 = add nuw nsw i32 %6, %5
%9 = icmp ult i32 %4, 100
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
%12 = phi i32 [ %0, %1 ], [ %7, %3 ]
%13 = add nsw i32 %12, %11
ret i32 %13
}
/* Variables and functions */
int frame3();
int frame2(void) { return frame3() - 1; }


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

x86 assembly (clang, -O2):
<frame2>:
push   %rax
xor    %eax,%eax
call   1030 <frame3@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @frame2() {
%1 = call i32 (...) @frame3()
%2 = sub nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @frame2() {
%1 = tail call i32 (...) @frame3()
%2 = add nsw i32 %1, -1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bitw_bit_scan_forward_64_bsf(int /*<<< orphan*/);
__attribute__((always_)) uint8_t
bitw_bit_scan_forward_64(uint64_t bit_sequence) {
  return bitw_bit_scan_forward_64_bsf(bit_sequence);
}


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

x86 assembly (clang, -O2):
<bitw_bit_scan_forward_64>:
jmp    1030 <bitw_bit_scan_forward_64_bsf@plt>

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

LLVM IR (-O2):
define i32 @bitw_bit_scan_forward_64(i32 %0) {
%2 = tail call i32 @bitw_bit_scan_forward_64_bsf(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, unsigned int);
void f4(int size) {
  char src[12] = "helloworld";
  char dest[12];
  if (size > 0)
    memcpy(dest, src, (unsigned)size);
}


x86 assembly (clang, -O0):
<f4>:
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)
cmpl   $0x0,-0x4(%rbp)
jle    1149 <f4+0x39>
lea    -0x1c(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.f4.src = [12 x i8] c"helloworld\00\00"
define void @f4(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 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%11 = load i32, i32* %2
%12 = call i32 @memcpy(i8* %9, i8* %10, i32 %11)
br label %13
13: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@__const.f4.src = [12 x i8] c"helloworld\00\00"
define void @f4(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 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @memcpy(i8* %5, i8* %4, i32 %0)
br label %9
9: ; preds = %7, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ cmgr_write(int, void const *, size_t);
ssize_t write(int fd, const void *buf, size_t count) {
  ssize_t ret;
  ret = cmgr_write(fd, buf, count);
  ;
  return ret;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <cmgr_write@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
jmp    1030 <cmgr_write@plt>

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @cmgr_write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int tp_exit(int fd) { close(fd); }


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

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

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

LLVM IR (-O2):
define i32 @tp_exit(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ aes_128_dec(unsigned char *, unsigned char *);
int main(int argc, char *argv[]) {
  unsigned char key[] = "YELLOW SUBMARINE";
  unsigned char input[] = {0x09, 0x12, 0x30, 0xAA, 0xDE, 0x3E, 0xB3, 0x30,
                           0xDB, 0xAA, 0x43, 0x58, 0xF8, 0x8D, 0x2A, 0x6C};
  aes_128_dec(input, key);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xece(%rip),%al
mov    %al,-0x20(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <aes_128_dec@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <aes_128_dec@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.key = [17 x i8] c"YELLOW SUBMARINE\00"
@__const.main.input = [16 x i8] c"\09\120\AA\DE>\B30\DB\AACX\F8\8D*l"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [17 x i8]
%7 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [17 x i8]* %6 to i8*
%9 = bitcast [16 x i8]* %7 to i8*
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%11 = getelementptr inbounds [17 x i8], [17 x i8]* %6, i64 0, i64 0
%12 = call i32 @aes_128_dec(i8* %10, i8* %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.key = [17 x i8] c"YELLOW SUBMARINE\00"
@__const.main.input = [16 x i8] c"\09\120\AA\DE>\B30\DB\AACX\F8\8D*l"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [17 x i8]
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%7 = call i32 @aes_128_dec(i8* %6, i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
void aocSocketSetAsync(int s) {
  int flags = 0;
  flags = fcntl(s, F_GETFL);
  flags |= O_NONBLOCK;
  fcntl(s, F_SETFL, flags);
  return;
}


x86 assembly (clang, -O0):
<aocSocketSetAsync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aocSocketSetAsync>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @aocSocketSetAsync(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* @O_NONBLOCK
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %3
%13 = call i32 (i32, i32, ...) @fcntl(i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @aocSocketSetAsync(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = load i32, i32* @O_NONBLOCK
%5 = or i32 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
void contrivedOverflow() {
  printf("\n..I like to read ^_^ <==  ");
  char buf[24];
  read(0, buf, 48);
  char lolz[24];
  strcpy(lolz, buf);
  printf(lolz);
  return;
}


x86 assembly (clang, -O0):
<contrivedOverflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
xor    %edi,%edi
mov    $0x30,%edx
call   1050 <read@plt>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rdi
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<contrivedOverflow>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
lea    0x20(%rsp),%r14
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x30,%edx
call   1050 <read@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\0A..I like to read ^_^ <== \00"
define void @contrivedOverflow() {
%1 = alloca [24 x i8]
%2 = alloca [24 x i8]
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%5 = call i32 @read(i32 0, i8* %4, i32 48)
%6 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0A..I like to read ^_^ <== \00"
define void @contrivedOverflow() {
%1 = alloca [24 x i8]
%2 = alloca [24 x i8]
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%5 = call i32 @read(i32 0, i8* %4, i32 48)
%6 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* %4)
%8 = call i32 @printf(i8* %6)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
uint32_t __int16_t_encoded_array_size(const int16_t *p, uint32_t elements) {
  (void)p;
  return (2) * elements;
}


x86 assembly (clang, -O0):
<__int16_t_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__int16_t_encoded_array_size(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 = mul nsw i32 2, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @__int16_t_encoded_array_size(i32* nocapture readnone %0, i32 %1) {
%3 = shl nsw i32 %1, 1
ret i32 %3
}
void removeLeftWall(int (*maze)[13], int startRow, int startCol) {
  int removeRow, removeCol;
  removeCol = ((startCol - 1) + 1) * 2;
  removeRow = (startRow)*2 - 1 + 2;
  maze[removeRow][removeCol] = 0;
}


x86 assembly (clang, -O0):
<removeLeftWall>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
add    $0x1,%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x34,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeLeftWall>:
add    %edx,%edx
lea    (%rsi,%rsi,1),%eax
add    $0x1,%eax
cltq
movslq %edx,%rcx
imul   $0x34,%rax,%rax
add    %rdi,%rax
movl   $0x0,(%rax,%rcx,4)
ret

LLVM IR (-O0):
define void @removeLeftWall([13 x i32]* %0, i32 %1, i32 %2) {
%4 = alloca [13 x i32]*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store [13 x i32]* %0, [13 x i32]** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = sub nsw i32 %9, 1
%11 = add nsw i32 %10, 1
%12 = mul nsw i32 %11, 2
store i32 %12, i32* %8
%13 = load i32, i32* %5
%14 = mul nsw i32 %13, 2
%15 = sub nsw i32 %14, 1
%16 = add nsw i32 %15, 2
store i32 %16, i32* %7
%17 = load [13 x i32]*, [13 x i32]** %4
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [13 x i32], [13 x i32]* %17, i64 %19
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [13 x i32], [13 x i32]* %20, i64 0, i64 %22
store i32 0, i32* %23
ret void
}

LLVM IR (-O2):
define void @removeLeftWall([13 x i32]* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %2, 1
%5 = shl nsw i32 %1, 1
%6 = or i32 %5, 1
%7 = sext i32 %6 to i64
%8 = sext i32 %4 to i64
%9 = getelementptr inbounds [13 x i32], [13 x i32]* %0, i64 %7, i64 %8
store i32 0, i32* %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void mmio_write_8(uintptr_t addr, uint8_t value) {
  *(volatile uint8_t *)addr = value;
}


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

x86 assembly (clang, -O2):
<mmio_write_8>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @mmio_write_8(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 = load i64, i64* %3
%7 = inttoptr i64 %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @mmio_write_8(i64 %0, i32 %1) {
%3 = inttoptr i64 %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
int test_imm_0Cuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x0C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Cuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 786432
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int round(float number) { return number > 0 ? number + 0.5f : number - 0.5f; }


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1131 <round+0x31>
movss  0xede(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1147 <round+0x47>
movss  -0x4(%rbp),%xmm0
movss  0xec2(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
lea    0xeee(%rip),%rcx
addss  (%rcx,%rax,4),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @round(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fadd float %6, 5.000000e-01
br label %11
8: ; preds = %1
%9 = load float, float* %2
%10 = fsub float %9, 5.000000e-01
br label %11
11: ; preds = %8, %5
%12 = phi float [ %7, %5 ], [ %10, %8 ]
%13 = fptosi float %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @round(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = select i1 %2, float 5.000000e-01, float -5.000000e-01
%4 = fadd float %3, %0
%5 = fptosi float %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, int);
main() {
  char *x = "main () {\n char *x  = \ %c %s %c;\n printf(x,34,x,34);";
  printf(x, 34, x, 34);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x22,%ecx
mov    %ecx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x22,%esi
mov    %rdi,%rdx
mov    $0x22,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [53 x i8] c"main () {\0A char *x = %c %s %c;\0A printf(x,34,x,34);\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 34, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 34)
ret i32 0
}
/* Type definitions */
struct cymkd_parser {
  int dummy;
};

/* Variables and functions */
int lookahead(struct cymkd_parser *, int /*<<< orphan*/);
int next(struct cymkd_parser *parser) { return lookahead(parser, 0); }


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

x86 assembly (clang, -O2):
<next>:
xor    %esi,%esi
jmp    1030 <lookahead@plt>

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

LLVM IR (-O2):
%struct.cymkd_parser = type { i32 }
define i32 @next(%struct.cymkd_parser* %0) {
%2 = tail call i32 @lookahead(%struct.cymkd_parser* %0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void build_overrun_file(char *file_prefix) {
  char filename[255];
  strcpy(filename, file_prefix);
  strcat(filename, "_ovf.db");
  FILE *f = fopen(filename, "r+");
}


x86 assembly (clang, -O0):
<build_overrun_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x110(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x118(%rbp)
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_overrun_file>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
call   1040 <fopen@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"_ovf.db\00"
@.str.1 = [3 x i8] c"r+\00"
define void @build_overrun_file(i8* %0) {
%2 = alloca i8*
%3 = alloca [255 x i8]
%4 = alloca i32*
store i8* %0, i8** %2
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%9 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%11 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %11, i32** %4
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"_ovf.db\00"
@.str.1 = [3 x i8] c"r+\00"
define void @build_overrun_file(i8* %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ consoleget();
int /*<<< orphan*/ psym(int /*<<< orphan*/);
void main() {
  for (;;) {
    psym(consoleget());
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <main+0x9>
mov    $0x0,%al
call   1030 <consoleget@plt>
mov    %eax,%edi
call   1040 <psym@plt>
jmp    1129 <main+0x9>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <consoleget@plt>
mov    %eax,%edi
call   1040 <psym@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @consoleget()
%3 = call i32 @psym(i32 %2)
br label %1
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @consoleget()
%3 = tail call i32 @psym(i32 %2)
br label %1
}
/* Variables and functions */
int foo(int, int **);
int printf(char *, int);
int main(void) {
  int a[2][42] = {0};
  return printf("%d\n", foo(42, a));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x160(%rbp),%rdi
xor    %esi,%esi
mov    $0x150,%edx
call   1040 <memset@plt>
lea    -0x160(%rbp),%rsi
mov    $0x2a,%edi
call   1050 <foo@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x150,%rsp
mov    %rsp,%rbx
mov    $0x150,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1050 <foo@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x150,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [2 x [42 x i32]]
%2 = bitcast [2 x [42 x i32]]* %1 to i8*
%3 = bitcast [2 x [42 x i32]]* %1 to i32**
%4 = call i32 @foo(i32 42, i32** %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 %5
}
/* Variables and functions */
scalar_t__ islower(int);
scalar_t__ isupper(int);
int isalpha(int character) {
  return (isupper(character) || islower(character));
}


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

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

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

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @islower(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ usDelay(int);
void msDelay(unsigned int delay) {
  while (delay--) {
    usDelay(1030);
  }
}


x86 assembly (clang, -O0):
<msDelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <msDelay+0x2e>
mov    $0x406,%edi
call   1030 <usDelay@plt>
jmp    111b <msDelay+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msDelay>:
push   %rbx
test   %edi,%edi
je     112f <msDelay+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x406,%edi
call   1030 <usDelay@plt>
add    $0xffffffff,%ebx
jne    1120 <msDelay+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @msDelay(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add i32 %4, -1
%6 = tail call i32 @usDelay(i32 1030)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int cmp_lt(int a, int b) { return a < b; }


x86 assembly (clang, -O0):
<cmp_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_lt>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @cmp_lt(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 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @cmp_lt(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ _rotl(unsigned int, unsigned int);
int rotateL_fun_int(int x, int i) {
  return (int)_rotl((unsigned)x, (unsigned)i);
}


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

x86 assembly (clang, -O2):
<rotateL_fun_int>:
jmp    1030 <_rotl@plt>

LLVM IR (-O0):
define i32 @rotateL_fun_int(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 i64 @_rotl(i32 %5, i32 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @rotateL_fun_int(i32 %0, i32 %1) {
%3 = tail call i64 @_rotl(i32 %0, i32 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *alloc_strcpy(const char *str) {
  if (str == NULL) {
    return NULL;
  } else {
    size_t len = strlen(str);
    char *tmp = malloc((len + 1));
    if (tmp != NULL) {
      strcpy(tmp, str);
    }
    return tmp;
  }
}


x86 assembly (clang, -O0):
<alloc_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <alloc_strcpy+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1192 <alloc_strcpy+0x62>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     118a <alloc_strcpy+0x5a>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_strcpy>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <alloc_strcpy+0x2f>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <alloc_strcpy+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1161 <alloc_strcpy+0x31>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @alloc_strcpy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %23
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = add i64 %12, 1
%14 = call i8* @malloc(i64 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %21
17: ; preds = %9
%18 = load i8*, i8** %5
%19 = load i8*, i8** %3
%20 = call i32 @strcpy(i8* %18, i8* %19)
br label %21
21: ; preds = %17, %9
%22 = load i8*, i8** %5
store i8* %22, i8** %2
br label %23
23: ; preds = %21, %8
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
define i8* @alloc_strcpy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %10
10: ; preds = %3, %8, %1
%11 = phi i8* [ null, %1 ], [ %6, %8 ], [ null, %3 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ dump_out_mmx(void *, unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, char *);
void dump_out_mmx_msg_sepline(const void *msg, void *buf, unsigned int size,
                              unsigned int index) {
  printf("%s :\n", (char *)msg);
  dump_out_mmx(buf, size, index);
}


x86 assembly (clang, -O0):
<dump_out_mmx_msg_sepline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <dump_out_mmx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_out_mmx_msg_sepline>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <dump_out_mmx@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s :\0A\00"
define void @dump_out_mmx_msg_sepline(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @dump_out_mmx(i8* %1, i32 %2, i32 %3)
ret void
}
unsigned int call_despawn(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @call_despawn() {
ret i32 0
}
/* Variables and functions */
int respond(int, int, char *);
int respond_permission_denied(void) {
  return respond(550, 1, "Permission denied.");
}


x86 assembly (clang, -O0):
<respond_permission_denied>:
push   %rbp
mov    %rsp,%rbp
mov    $0x226,%edi
mov    $0x1,%esi
lea    0xedb(%rip),%rdx
call   1030 <respond@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<respond_permission_denied>:
lea    0xee9(%rip),%rdx
mov    $0x226,%edi
mov    $0x1,%esi
jmp    1030 <respond@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Permission denied.\00"
define i32 @respond_permission_denied() {
%1 = call i32 @respond(i32 550, i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [19 x i8] c"Permission denied.\00"
define i32 @respond_permission_denied() {
%1 = tail call i32 @respond(i32 550, i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
struct b_tonegen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setMIDIDrawBar(struct b_tonegen *, int, unsigned char);
void setDrawbar19(void *d, unsigned char v) {
  setMIDIDrawBar((struct b_tonegen *)d, 19, v);
}


x86 assembly (clang, -O0):
<setDrawbar19>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x13,%esi
movzbl -0x9(%rbp),%edx
call   1030 <setMIDIDrawBar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDrawbar19>:
mov    %esi,%edx
mov    $0x13,%esi
jmp    1030 <setMIDIDrawBar@plt>

LLVM IR (-O0):
%struct.b_tonegen = type { i32 }
define void @setDrawbar19(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.b_tonegen*
%7 = load i8, i8* %4
%8 = call i32 @setMIDIDrawBar(%struct.b_tonegen* %6, i32 19, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
%struct.b_tonegen = type { i32 }
define void @setDrawbar19(i8* %0, i8 zeroext %1) {
%3 = bitcast i8* %0 to %struct.b_tonegen*
%4 = tail call i32 @setMIDIDrawBar(%struct.b_tonegen* %3, i32 19, i8 zeroext %1)
ret void
}
/* Variables and functions */
scalar_t__ mik_islower(int);
scalar_t__ mik_isupper(int);
int mik_isalpha(int c) { return (mik_islower(c) || mik_isupper(c)); }


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

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

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

LLVM IR (-O2):
define i32 @mik_isalpha(i32 %0) {
%2 = tail call i64 @mik_islower(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @mik_isupper(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_RenderingControl_SetContrast(struct UPnPService *Service,
                                                  int ErrorCode, void *User) {
  printf(
      "RND Invoke Response: RenderingControl/SetContrast[ErrorCode:%d]()\r\n",
      ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_RenderingControl_SetContrast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [68 x i8] c"RND Invoke Response: RenderingControl/SetContrast[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetContrast(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [68 x i8] c"RND Invoke Response: RenderingControl/SetContrast[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetContrast(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void foo544(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo544(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _insl_ns(void *, void *, unsigned long);
void ioread32_rep(void *addr, void *dst, unsigned long count) {
  _insl_ns(addr, dst, count);
}


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

x86 assembly (clang, -O2):
<ioread32_rep>:
jmp    1030 <_insl_ns@plt>

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

LLVM IR (-O2):
define void @ioread32_rep(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @_insl_ns(i8* %0, i8* %1, i64 %2)
ret void
}
float degrees_in_radians(float degrees) { return degrees * 0.0174532925; }


x86 assembly (clang, -O0):
<degrees_in_radians>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degrees_in_radians>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @degrees_in_radians(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x3F91DF46A1FAE711
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @degrees_in_radians(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x3F91DF46A1FAE711
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ ex6();
int main() {
  ex6();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ex6()
ret i32 0
}
int c052(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c052() {
ret i32 0
}
int true(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @true() {
ret i32 1
}