xunge/DecIR huggingface dataset:
void m_inctest(count, limit, message) int *count;
int limit;
char *message;
{
  if (++*count <= limit)
    return;
  m_err1("Internal error: %s exceeded", message);
  m_exit(1);
}


x86 assembly (clang, -O0):
<m_inctest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
cmp    -0xc(%rbp),%eax
jg     114c <m_inctest+0x2c>
jmp    116a <m_inctest+0x4a>
mov    -0x18(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <m_err1@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <m_exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_inctest>:
push   %rax
mov    (%rdi),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rdi)
cmp    %esi,%eax
jge    112e <m_inctest+0xe>
pop    %rax
ret
lea    0xecb(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1030 <m_err1@plt>
mov    $0x1,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <m_exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Internal error: %s exceeded\00"
define void @m_inctest(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
%10 = load i32, i32* %5
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %3
br label %17
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @m_err1 to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = call i32 (i32, ...) bitcast (i32 (...)* @m_exit to i32 (i32, ...)*)(i32 1)
br label %17
17: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Internal error: %s exceeded\00"
define void @m_inctest(i32* nocapture %0, i32 %1, i8* %2) {
%4 = load i32, i32* %0
%5 = add nsw i32 %4, 1
store i32 %5, i32* %0
%6 = icmp slt i32 %4, %1
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @m_err1 to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @m_exit to i32 (i32, ...)*)(i32 1)
br label %10
10: ; preds = %3, %7
ret void
}
int main() { return 21; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x15,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 21
}
int is_in_bound(int *m, int n, int *p) {
  if (m <= p && p < m + n)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
ja     1145 <is_in_bound+0x45>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1145 <is_in_bound+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <is_in_bound+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
cmp    %rdx,%rdi
setbe  %al
movslq %esi,%rcx
lea    (%rdi,%rcx,4),%rcx
cmp    %rdx,%rcx
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = icmp ule i32* %0, %2
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = icmp ugt i32* %6, %2
%8 = select i1 %4, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ vetor;

/* Variables and functions */
int maximoR3(int, int *);
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int vetor[] = {5, 6, 3, 1, 2, 4, 5, 6, 6, 23};
  int y = sizeof(vetor) / sizeof(int);
  printf("%d\n", maximoR3(y, vetor));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0xa,-0x34(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
call   1050 <maximoR3@plt>
mov    %eax,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0xa,%edi
call   1040 <maximoR3@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.vetor = [10 x i32] [i32 5, i32 6, i32 3, i32 1, i32 2, i32 4, i32 5, i32 6, i32 6, i32 23]
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @maximoR3(i32 10, i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int power_of_two(int test) {
  int limit = 8192;
  int compare = 1;
  do {
    if (test == compare) {
      return 1;
    }
    compare *= 2;
  } while (compare <= limit);
  return 0;
}


x86 assembly (clang, -O0):
<power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2000,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    112d <power_of_two+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1149 <power_of_two+0x49>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1115 <power_of_two+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_of_two>:
mov    $0x1,%eax
cmp    $0x7f,%edi
jg     1123 <power_of_two+0x23>
add    $0xffffffff,%edi
cmp    $0x3f,%edi
ja     116f <power_of_two+0x6f>
movabs $0x800000008000808b,%rcx
bt     %rdi,%rcx
jae    116f <power_of_two+0x6f>
ret
cmp    $0x3ff,%edi
jle    1145 <power_of_two+0x45>
cmp    $0xfff,%edi
jg     115f <power_of_two+0x5f>
cmp    $0x400,%edi
je     1122 <power_of_two+0x22>
cmp    $0x800,%edi
je     1122 <power_of_two+0x22>
jmp    116f <power_of_two+0x6f>
cmp    $0x80,%edi
je     1122 <power_of_two+0x22>
cmp    $0x100,%edi
je     1122 <power_of_two+0x22>
cmp    $0x200,%edi
je     1122 <power_of_two+0x22>
jmp    116f <power_of_two+0x6f>
cmp    $0x1000,%edi
je     1122 <power_of_two+0x22>
cmp    $0x2000,%edi
je     1122 <power_of_two+0x22>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @power_of_two(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 8192, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %3
%8 = load i32, i32* %5
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6
store i32 1, i32* %2
br label %19
11: ; preds = %6
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 2
store i32 %13, i32* %5
br label %14
14: ; preds = %11
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = icmp sle i32 %15, %16
br i1 %17, label %6, label %18
18: ; preds = %14
store i32 0, i32* %2
br label %19
19: ; preds = %18, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @power_of_two(i32 %0) {
switch i32 %0, label %2 [
i32 1, label %3
i32 2, label %3
i32 4, label %3
i32 8, label %3
i32 16, label %3
i32 32, label %3
i32 64, label %3
i32 128, label %3
i32 256, label %3
i32 512, label %3
i32 1024, label %3
i32 2048, label %3
i32 4096, label %3
i32 8192, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %1 ], [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
int ezFiveEighths(int x) {
  int y = (x << 2) + x;
  return (y + ((y >> 31) & 7)) >> 3;
}


x86 assembly (clang, -O0):
<ezFiveEighths>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x1f,%ecx
and    $0x7,%ecx
add    %ecx,%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ezFiveEighths>:
lea    (%rdi,%rdi,4),%ecx
mov    %ecx,%eax
sar    $0x1f,%eax
and    $0x7,%eax
add    %ecx,%eax
sar    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @ezFiveEighths(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 2
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = ashr i32 %9, 31
%11 = and i32 %10, 7
%12 = add nsw i32 %8, %11
%13 = ashr i32 %12, 3
ret i32 %13
}

LLVM IR (-O2):
define i32 @ezFiveEighths(i32 %0) {
%2 = mul i32 %0, 5
%3 = icmp slt i32 %2, 0
%4 = select i1 %3, i32 7, i32 0
%5 = add nsw i32 %4, %2
%6 = ashr i32 %5, 3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("tokenizer_driver <file> <c|d|go|ada>\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"tokenizer_driver <file> <c|d|go|ada>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [37 x i8] c"tokenizer_driver <file> <c|d|go|ada>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
size_t strnlen(char const *, size_t);
size_t strnlen_s(const char *str, size_t numberofElements) {
  return strnlen(str, numberofElements);
}


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

x86 assembly (clang, -O2):
<strnlen_s>:
jmp    1030 <strnlen@plt>

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

LLVM IR (-O2):
define i64 @strnlen_s(i8* nocapture %0, i64 %1) {
%3 = tail call i64 @strnlen(i8* %0, i64 %1)
ret i64 %3
}
void ade7854_uninitialize_ring(struct iio_ring_buffer *ring) {}


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

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

LLVM IR (-O0):
%struct.iio_ring_buffer = type opaque
define void @ade7854_uninitialize_ring(%struct.iio_ring_buffer* %0) {
%2 = alloca %struct.iio_ring_buffer*
store %struct.iio_ring_buffer* %0, %struct.iio_ring_buffer** %2
ret void
}

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define void @ade7854_uninitialize_ring(%struct.iio_ring_buffer* nocapture %0) {
ret void
}
void up_init_secondary(void) {}


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

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

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

LLVM IR (-O2):
define void @up_init_secondary() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int open(char const *, int /*<<< orphan*/);
int ptys_open(int fdm, const char *pts_name, bool acquire) {
  int fds;
  fds = open(pts_name, O_RDWR);
  if (fds < 0) {
    close(fdm);
    return -5;
  }
  return fds;
}


x86 assembly (clang, -O0):
<ptys_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1165 <ptys_open+0x45>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
movl   $0xfffffffb,-0x4(%rbp)
jmp    116b <ptys_open+0x4b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptys_open>:
push   %rbx
mov    %rsi,%rax
mov    %edi,%ebx
mov    0x2ebb(%rip),%rcx
mov    (%rcx),%esi
mov    %rax,%rdi
call   1040 <open@plt>
test   %eax,%eax
js     113d <ptys_open+0x1d>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <close@plt>
mov    $0xfffffffb,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @ptys_open(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i8*, i8** %6
%10 = load i32, i32* @O_RDWR
%11 = call i32 @open(i8* %9, i32 %10)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* %5
%16 = call i32 @close(i32 %15)
store i32 -5, i32* %4
br label %19
17: ; preds = %3
%18 = load i32, i32* %8
store i32 %18, i32* %4
br label %19
19: ; preds = %17, %14
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @ptys_open(i32 %0, i8* nocapture %1, i32 %2) {
%4 = load i32, i32* @O_RDWR
%5 = tail call i32 @open(i8* %1, i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @close(i32 %0)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ -5, %7 ], [ %5, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ draw_string(int, int, char *, int);
int strlen(char *);
int strat(int x, int y, char *s, int color) {
  draw_string(x * 12, y * 24, s, color);
  return strlen(s);
}


x86 assembly (clang, -O0):
<strat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
imul   $0xc,-0x4(%rbp),%edi
imul   $0x18,-0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1040 <draw_string@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strat>:
push   %rbx
mov    %rdx,%rbx
shl    $0x2,%edi
lea    (%rdi,%rdi,2),%edi
shl    $0x3,%esi
lea    (%rsi,%rsi,2),%esi
call   1040 <draw_string@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @strat(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 12
%11 = load i32, i32* %6
%12 = mul nsw i32 %11, 24
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @draw_string(i32 %10, i32 %12, i8* %13, i32 %14)
%16 = load i8*, i8** %7
%17 = call i32 @strlen(i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @strat(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = mul nsw i32 %0, 12
%6 = mul nsw i32 %1, 24
%7 = tail call i32 @draw_string(i32 %5, i32 %6, i8* %2, i32 %3)
%8 = tail call i32 @strlen(i8* %2)
ret i32 %8
}
/* Type definitions */
struct l_frame_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct l_frame_t *);
void l_frame_del(struct l_frame_t *frame) { free(frame); }


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

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

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

LLVM IR (-O2):
%struct.l_frame_t = type { i32 }
define void @l_frame_del(%struct.l_frame_t* nocapture %0) {
%2 = tail call i32 @free(%struct.l_frame_t* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f4(int);
void f5() { f4(42); }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1030 <f4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    $0x2a,%edi
jmp    1030 <f4@plt>

LLVM IR (-O0):
define void @f5() {
%1 = call i32 @f4(i32 42)
ret void
}

LLVM IR (-O2):
define void @f5() {
%1 = tail call i32 @f4(i32 42)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long drawable;
};
typedef TYPE_1__ XGraphicsExposeEvent;

/* Variables and functions */
void set_XGraphicsExposeEvent_drawable(void *_p, unsigned long _v) {
  ((XGraphicsExposeEvent *)_p)->drawable = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XGraphicsExposeEvent_drawable>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XGraphicsExposeEvent_drawable(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int xliniowe(int c, int b) { return -c / b; }


x86 assembly (clang, -O0):
<xliniowe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xliniowe>:
mov    %edi,%eax
cltd
idiv   %esi
neg    %eax
ret

LLVM IR (-O0):
define i32 @xliniowe(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 = sub nsw i32 0, %5
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @xliniowe(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("echo [-n] [-e] [STRING]...\n"
         "  -n    do not output a new line at the end\n"
         "  -e    process escape sequences\n");
}


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

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

LLVM IR (-O0):
@.str = [105 x i8] c"echo [-n] [-e] [STRING]...\0A -n do not output a new line at the end\0A -e process escape sequences\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [104 x i8] c"echo [-n] [-e] [STRING]...\0A -n do not output a new line at the end\0A -e process escape sequences\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
void ME_fd_zero(fd_set *fds) { FD_ZERO(fds); }


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

x86 assembly (clang, -O2):
<ME_fd_zero>:
jmp    1030 <FD_ZERO@plt>

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

LLVM IR (-O2):
define void @ME_fd_zero(i32* %0) {
%2 = tail call i32 @FD_ZERO(i32* %0)
ret void
}
void *devm_ioport_map(struct device *dev, unsigned long port, unsigned int nr) {
  return ((void *)0);
}


x86 assembly (clang, -O0):
<devm_ioport_map>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.device = type opaque
define i8* @devm_ioport_map(%struct.device* %0, i64 %1, i32 %2) {
%4 = alloca %struct.device*
%5 = alloca i64
%6 = alloca i32
store %struct.device* %0, %struct.device** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
ret i8* null
}

LLVM IR (-O2):
%struct.device = type opaque
define noalias i8* @devm_ioport_map(%struct.device* nocapture readnone %0, i64 %1, i32 %2) {
ret i8* null
}
void dummy_function() {}


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

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

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

LLVM IR (-O2):
define void @dummy_function() {
ret void
}
/* Variables and functions */
int readlinkat(int, char const *, char *, size_t);
__attribute__((__weak__, __always___)) int
softboundcets_readlinkat(int dirfd, const char *pathname, char *buf,
                         size_t bufsiz) {
  return readlinkat(dirfd, pathname, buf, bufsiz);
}


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

x86 assembly (clang, -O2):
<softboundcets_readlinkat>:
jmp    1030 <readlinkat@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_readlinkat(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @readlinkat(i32 %0, i8* %1, i8* %2, i64 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int nonblocking(int fd) {
  int flg = fcntl(fd, F_GETFL, 0);
  fcntl(fd, F_SETFL, flg | O_NONBLOCK);
  return flg;
}


x86 assembly (clang, -O0):
<nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonblocking>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,%ebp
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
or     %ebp,%edx
mov    %ebx,%edi
call   1030 <fcntl@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @nonblocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %3
%7 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %6)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ nice(int);
int /*<<< orphan*/ setsid();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ sv_core_httpd();
int main(void) {
  nice(1);
  fclose(stdin);
  fclose(stdout);
  fclose(stderr);
  if (fork() == 0) {
    setsid();
    sv_core_httpd();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1060 <nice@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    $0x0,%al
call   1070 <fork@plt>
cmp    $0x0,%rax
jne    11b2 <main+0x62>
mov    $0x0,%al
call   1040 <setsid@plt>
mov    $0x0,%al
call   1050 <sv_core_httpd@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1060 <nice@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
xor    %eax,%eax
call   1070 <fork@plt>
test   %rax,%rax
jne    119f <main+0x4f>
xor    %eax,%eax
call   1040 <setsid@plt>
xor    %eax,%eax
call   1050 <sv_core_httpd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
@stderr = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @nice(i32 1)
%3 = load i32, i32* @stdin
%4 = call i32 @fclose(i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fclose(i32 %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fclose(i32 %7)
%9 = call i64 (...) @fork()
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = call i32 (...) @setsid()
%13 = call i32 (...) @sv_core_httpd()
br label %14
14: ; preds = %11, %0
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
@stderr = global i32 0
define i32 @main() {
%1 = tail call i32 @nice(i32 1)
%2 = load i32, i32* @stdin
%3 = tail call i32 @fclose(i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fclose(i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fclose(i32 %6)
%8 = tail call i64 (...) @fork()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = tail call i32 (...) @setsid()
%12 = tail call i32 (...) @sv_core_httpd()
br label %13
13: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  unsigned int ChuckieLuckyWon = 1000000;
  float account = 1.08;
  const int withdraws = 100000;
  float balance;
  int years = 0;
  balance = (float)ChuckieLuckyWon * account - (float)withdraws;
  while (balance >= 0.0) {
    balance = balance * account - (float)withdraws;
    years++;
  }
  printf("It takes %d years for Chuckie to empty his account\n", years);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf4240,-0x8(%rbp)
movl   $0x3f8a3d71,-0xc(%rbp)
movl   $0x186a0,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xeac(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11a0 <main+0x90>
movss  -0x14(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe77(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115d <main+0x4d>
mov    -0x18(%rbp),%esi
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [52 x i8] c"It takes %d years for Chuckie to empty his account\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
%5 = alloca float
%6 = alloca i32
store i32 0, i32* %1
store i32 1000000, i32* %2
store float 0x3FF147AE20000000, float* %3
store i32 100000, i32* %4
store i32 0, i32* %6
%7 = load i32, i32* %2
%8 = uitofp i32 %7 to float
%9 = load float, float* %3
%10 = call float @llvm.fmuladd.f32(float %8, float %9, float -1.000000e+05)
store float %10, float* %5
br label %11
11: ; preds = %15, %0
%12 = load float, float* %5
%13 = fpext float %12 to double
%14 = fcmp oge double %13, 0.000000e+00
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load float, float* %5
%17 = load float, float* %3
%18 = call float @llvm.fmuladd.f32(float %16, float %17, float -1.000000e+05)
store float %18, float* %5
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %11
21: ; preds = %11
%22 = load i32, i32* %6
%23 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"It takes %d years for Chuckie to empty his account\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 20)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int error(char *message) {
  printf("%s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char getCharacter(char **);
int parse_literal(char **xml, char cLiteral) {
  char c;
  char *pos1;
  pos1 = *xml;
  c = getCharacter(xml);
  if (c != cLiteral) {
    *xml = pos1;
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<parse_literal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getCharacter@plt>
mov    %al,-0x12(%rbp)
movsbl -0x12(%rbp),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
je     1160 <parse_literal+0x50>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1167 <parse_literal+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_literal>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    (%rdi),%r14
call   1030 <getCharacter@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %bpl,%cl
je     1132 <parse_literal+0x22>
mov    %r14,(%rbx)
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @parse_literal(i8** %0, i8 signext %1) {
%3 = load i8*, i8** %0
%4 = tail call signext i8 @getCharacter(i8** %0)
%5 = icmp eq i8 %4, %1
br i1 %5, label %7, label %6
6: ; preds = %2
store i8* %3, i8** %0
br label %7
7: ; preds = %2, %6
%8 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int allocerror(char *p) {
  static int status;
  if (status = (p == (char *)0))
    perror("Memory allocation failure");
  return status;
}


x86 assembly (clang, -O0):
<allocerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,0x2efa(%rip)
test   $0x1,%al
jne    113f <allocerror+0x2f>
jmp    114b <allocerror+0x3b>
lea    0xeba(%rip),%rdi
call   1030 <perror@plt>
mov    0x2edb(%rip),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocerror>:
push   %rax
xor    %eax,%eax
xor    %ecx,%ecx
test   %rdi,%rdi
sete   %cl
mov    %ecx,0x2f0b(%rip)
je     1125 <allocerror+0x15>
pop    %rcx
ret
lea    0xed4(%rip),%rdi
call   1030 <perror@plt>
mov    0x2ef5(%rip),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@allocerror.status = internal unnamed_addr global i32 0
@.str = [26 x i8] c"Memory allocation failure\00"
define i32 @allocerror(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = zext i1 %2 to i32
store i32 %3, i32* @allocerror.status
br i1 %2, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @allocerror.status
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
void uDMAChannel0_7SelectAltMapping(unsigned long ulAltPeriphs) {
  (*((volatile unsigned long *)(0x400FF510))) |= ulAltPeriphs;
}


x86 assembly (clang, -O0):
<uDMAChannel0_7SelectAltMapping>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x400ff510,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400ff510,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannel0_7SelectAltMapping>:
or     %rdi,0x400ff510
40
ret

LLVM IR (-O0):
define void @uDMAChannel0_7SelectAltMapping(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074787600 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074787600 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannel0_7SelectAltMapping(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074787600 to i64*)
%3 = or i64 %2, %0
store volatile i64 %3, i64* inttoptr (i64 1074787600 to i64*)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t rotl64(uint64_t a, uint8_t r) { return (a << r) | (a >> (64 - r)); }


x86 assembly (clang, -O0):
<rotl64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl64>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl64(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl64(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int len(char *p);
  int n;
  char str[20];
  printf("input string:");
  scanf("%s", str);
  n = len(str);
  printf("The len of string is %d.\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <len@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <len@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"input string:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [26 x i8] c"The len of string is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = call i32 @len(i8* %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"input string:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [26 x i8] c"The len of string is %d.\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @len(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: nohup [--] utility [arguments]\n");
  exit(127);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x7f,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x7f,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"usage: nohup [--] utility [arguments]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 127)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"usage: nohup [--] utility [arguments]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 127)
unreachable
}
/* Variables and functions */
double acos(double);
double Double_acos(double x) { return acos(x); }


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

x86 assembly (clang, -O2):
<Double_acos>:
jmp    1030 <acos@plt>

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

LLVM IR (-O2):
define double @Double_acos(double %0) {
%2 = tail call double @acos(double %0)
ret double %2
}
int analisarTrio(int a, int b, int c) {
  if (a > b && b <= c) {
    return 1;
  }
  if (a < b && b >= c) {
    return 1;
  }
  if (a == b && b != c) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<analisarTrio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1131 <analisarTrio+0x31>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1131 <analisarTrio+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1180 <analisarTrio+0x80>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1155 <analisarTrio+0x55>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1155 <analisarTrio+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1180 <analisarTrio+0x80>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1179 <analisarTrio+0x79>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1179 <analisarTrio+0x79>
movl   $0x1,-0x4(%rbp)
jmp    1180 <analisarTrio+0x80>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<analisarTrio>:
mov    $0x1,%eax
cmp    %esi,%edi
jle    110e <analisarTrio+0xe>
cmp    %edx,%esi
jg     110e <analisarTrio+0xe>
ret
cmp    %esi,%edi
jge    1116 <analisarTrio+0x16>
cmp    %edx,%esi
jge    110d <analisarTrio+0xd>
cmp    %esi,%edi
sete   %al
cmp    %edx,%esi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @analisarTrio(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %4
br label %35
16: ; preds = %11, %3
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = icmp sge i32 %21, %22
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 1, i32* %4
br label %35
25: ; preds = %20, %16
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = icmp eq i32 %26, %27
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = icmp ne i32 %30, %31
br i1 %32, label %33, label %34
33: ; preds = %29
store i32 1, i32* %4
br label %35
34: ; preds = %29, %25
store i32 0, i32* %4
br label %35
35: ; preds = %34, %33, %24, %15
%36 = load i32, i32* %4
ret i32 %36
}

LLVM IR (-O2):
define i32 @analisarTrio(i32 %0, i32 %1, i32 %2) {
%4 = icmp sle i32 %0, %1
%5 = icmp sgt i32 %1, %2
%6 = or i1 %4, %5
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = icmp sge i32 %0, %1
%9 = icmp slt i32 %1, %2
%10 = or i1 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = icmp eq i32 %0, %1
%13 = icmp ne i32 %1, %2
%14 = and i1 %12, %13
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %11, %7, %3
%17 = phi i32 [ 1, %3 ], [ 1, %7 ], [ %15, %11 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int hello(void *p) {
  execlp("echo", "echo", "hello ", NULL);
  exit(1);
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rsi
lea    0xecb(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1040 <execlp@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<hello>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
call   1040 <execlp@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"echo\00"
@.str.1 = [7 x i8] c"hello \00"
define i32 @hello(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @execlp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* null)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"echo\00"
@.str.1 = [7 x i8] c"hello \00"
define i32 @hello(i8* nocapture readnone %0) {
%2 = tail call i32 @execlp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* null)
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned long USBFIFOAddrGet(unsigned long ulBase, unsigned long ulEndpoint) {
  return (ulBase + 0x00000020 + (ulEndpoint >> 2));
}


x86 assembly (clang, -O0):
<USBFIFOAddrGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rax
mov    -0x10(%rbp),%rcx
shr    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBFIFOAddrGet>:
shr    $0x2,%rsi
lea    (%rdi,%rsi,1),%rax
add    $0x20,%rax
ret

LLVM IR (-O0):
define i64 @USBFIFOAddrGet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 32
%7 = load i64, i64* %4
%8 = lshr i64 %7, 2
%9 = add i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @USBFIFOAddrGet(i64 %0, i64 %1) {
%3 = add i64 %0, 32
%4 = lshr i64 %1, 2
%5 = add i64 %3, %4
ret i64 %5
}