xunge/DecIR huggingface dataset:
/* Variables and functions */
int BKDRHash(char *s, size_t size) {
  int seed = 131;
  unsigned long hash = 0;
  while (*s != '\0') {
    hash = hash * seed + *s++;
  }
  return hash % size;
}


x86 assembly (clang, -O0):
<BKDRHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x83,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1156 <BKDRHash+0x56>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rcx,%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    111b <BKDRHash+0x1b>
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BKDRHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112b <BKDRHash+0x2b>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x83,%rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <BKDRHash+0x10>
jmp    112d <BKDRHash+0x2d>
xor    %eax,%eax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1142 <BKDRHash+0x42>
xor    %edx,%edx
div    %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @BKDRHash(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i64 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = mul i64 %7, 131
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = sext i8 %6 to i64
%12 = add i64 %9, %11
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 0, %2 ], [ %12, %5 ]
%17 = urem i64 %16, %1
%18 = trunc i64 %17 to i32
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ ztest_test_skip();
void test_1b(void) { ztest_test_skip(); }


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

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

LLVM IR (-O0):
define void @test_1b() {
%1 = call i32 (...) @ztest_test_skip()
ret void
}

LLVM IR (-O2):
define void @test_1b() {
%1 = tail call i32 (...) @ztest_test_skip()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void rtp2435_set_ts(uint8_t *header, uint8_t ts) { header[0] = ts; }


x86 assembly (clang, -O0):
<rtp2435_set_ts>:
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):
<rtp2435_set_ts>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @rtp2435_set_ts(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
void arith(int a, int b) {
  int c;
  c = a + b;
  c = a - b;
  c = a / b;
  c = a * b;
  c = a + b;
  c = a - b;
  c = a / b;
  c = a * b;
}


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

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

LLVM IR (-O0):
define void @arith(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = sdiv i32 %12, %13
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
store i32 %17, i32* %5
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = add nsw i32 %18, %19
store i32 %20, i32* %5
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = sub nsw i32 %21, %22
store i32 %23, i32* %5
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = sdiv i32 %24, %25
store i32 %26, i32* %5
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = mul nsw i32 %27, %28
store i32 %29, i32* %5
ret void
}

LLVM IR (-O2):
define void @arith(i32 %0, i32 %1) {
ret void
}
signed long signedlong_ignoring_unsignedlong(signed long x, unsigned long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlong_ignoring_unsignedlong(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlong_ignoring_unsignedlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func_1(void) { printf("func_1\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"func_1\00"
define void @func_1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned char proper_to_bcd_single(unsigned char value) {
  unsigned char high, low;
  low = (value % 10) & 0xf;
  high = (((value / 10) % 10) * 0x10U) & 0xf0;
  return high | low;
}


x86 assembly (clang, -O0):
<proper_to_bcd_single>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
and    $0xf,%edx
mov    %dl,%al
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
shl    $0x4,%eax
and    $0xf0,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
movzbl -0x3(%rbp),%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proper_to_bcd_single>:
imul   $0xcd,%edi,%eax
shr    $0xb,%eax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%dil
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
and    $0xfffffffe,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
shl    $0x4,%al
or     %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @proper_to_bcd_single(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = srem i32 %6, 10
%8 = and i32 %7, 15
%9 = trunc i32 %8 to i8
store i8 %9, i8* %4
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = sdiv i32 %11, 10
%13 = srem i32 %12, 10
%14 = mul i32 %13, 16
%15 = and i32 %14, 240
%16 = trunc i32 %15 to i8
store i8 %16, i8* %3
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
ret i8 %22
}

LLVM IR (-O2):
define zeroext i8 @proper_to_bcd_single(i8 zeroext %0) {
%2 = urem i8 %0, 10
%3 = udiv i8 %0, 10
%4 = urem i8 %3, 10
%5 = shl nuw i8 %4, 4
%6 = or i8 %5, %2
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ labs(long);
int /*<<< orphan*/ llabs(long long);
void uninitvar_labs(void) {
  long int li;
  (void)labs(li);
  long long int lli;
  (void)llabs(lli);
}


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

x86 assembly (clang, -O2):
<uninitvar_labs>:
push   %rax
call   1030 <labs@plt>
pop    %rax
jmp    1040 <llabs@plt>

LLVM IR (-O0):
define void @uninitvar_labs() {
%1 = alloca i64
%2 = alloca i64
%3 = load i64, i64* %1
%4 = call i32 @labs(i64 %3)
%5 = load i64, i64* %2
%6 = call i32 @llabs(i64 %5)
ret void
}

LLVM IR (-O2):
define void @uninitvar_labs() {
%1 = tail call i32 @labs(i64 undef)
%2 = tail call i32 @llabs(i64 undef)
ret void
}
int isLarger(int valve, int data) { return (data > valve); }


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

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

LLVM IR (-O0):
define i32 @isLarger(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isLarger(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void ftnstop(char *msg) {
  if (msg != NULL)
    fprintf(stderr, "%s\n", msg);
  exit(0);
}


x86 assembly (clang, -O0):
<ftnstop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <ftnstop+0x30>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ftnstop>:
push   %rax
test   %rdi,%rdi
je     113e <ftnstop+0x1e>
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @ftnstop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @ftnstop(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ failed();
unsigned int ntohl(int);
void check_test(unsigned int err) {
  if (err != ntohl(-5031) && err != ntohl(-5000)) {
    failed();
  }
}


x86 assembly (clang, -O0):
<check_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xffffec59,%edi
call   1040 <ntohl@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
je     116c <check_test+0x4c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xffffec78,%edi
call   1040 <ntohl@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
je     116c <check_test+0x4c>
mov    $0x0,%al
call   1030 <failed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_test>:
push   %rbx
mov    %edi,%ebx
mov    $0xffffec59,%edi
call   1040 <ntohl@plt>
cmp    %ebx,%eax
je     113f <check_test+0x1f>
mov    $0xffffec78,%edi
call   1040 <ntohl@plt>
cmp    %ebx,%eax
jne    1141 <check_test+0x21>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1030 <failed@plt>

LLVM IR (-O0):
define void @check_test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ntohl(i32 -5031)
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @ntohl(i32 -5000)
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 (...) @failed()
br label %12
12: ; preds = %10, %6, %1
ret void
}

LLVM IR (-O2):
define void @check_test(i32 %0) {
%2 = tail call i32 @ntohl(i32 -5031)
%3 = icmp eq i32 %2, %0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @ntohl(i32 -5000)
%6 = icmp eq i32 %5, %0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 (...) @failed()
br label %9
9: ; preds = %7, %4, %1
ret void
}
/* Variables and functions */
int strlen(char *);
void str_trim_crlf(char *str) {
  char *p = &str[strlen(str) - 1];
  while (*p == '\r' || *p == '\n')
    *p-- = '\0';
}


x86 assembly (clang, -O0):
<str_trim_crlf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x19(%rbp)
je     1165 <str_trim_crlf+0x55>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1175 <str_trim_crlf+0x65>
jmp    118c <str_trim_crlf+0x7c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
jmp    1140 <str_trim_crlf+0x30>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_trim_crlf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
jmp    1137 <str_trim_crlf+0x27>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movb   $0x0,(%rax)
add    $0xffffffffffffffff,%rax
movzbl (%rax),%ecx
cmp    $0xd,%cl
je     1130 <str_trim_crlf+0x20>
cmp    $0xa,%cl
je     1130 <str_trim_crlf+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @str_trim_crlf(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
br label %6
6: ; preds = %9, %1
%7 = phi i8* [ %5, %1 ], [ %10, %9 ]
%8 = load i8, i8* %7
switch i8 %8, label %11 [
i8 13, label %9
i8 10, label %9
]
9: ; preds = %6, %6
%10 = getelementptr inbounds i8, i8* %7, i64 -1
store i8 0, i8* %7
br label %6
11: ; preds = %6
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t u64_from_le(const unsigned char *x) {
  return (uint64_t)(x[0]) | (((uint64_t)(x[1])) << 8) |
         (((uint64_t)(x[2])) << 16) | (((uint64_t)(x[3])) << 24) |
         (((uint64_t)(x[4])) << 32) | (((uint64_t)(x[5])) << 40) |
         (((uint64_t)(x[6])) << 48) | (((uint64_t)(x[7])) << 56);
}


x86 assembly (clang, -O0):
<u64_from_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x4(%rcx),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x5(%rcx),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x6(%rcx),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x7(%rcx),%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @u64_from_le(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 4
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = shl i32 %28, 32
%30 = or i32 %24, %29
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 5
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = shl i32 %34, 40
%36 = or i32 %30, %35
%37 = load i8*, i8** %2
%38 = getelementptr inbounds i8, i8* %37, i64 6
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = shl i32 %40, 48
%42 = or i32 %36, %41
%43 = load i8*, i8** %2
%44 = getelementptr inbounds i8, i8* %43, i64 7
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = shl i32 %46, 56
%48 = or i32 %42, %47
ret i32 %48
}

LLVM IR (-O2):
define i32 @u64_from_le(i8* nocapture readnone %0) {
ret i32 poison
}
/* Variables and functions */
int partition(int *, int, int);
void quicksort(int a[], int low, int high) {
  int pindex;
  if ((high - low) <= 1)
    return;
  else {
    pindex = partition(a, low, high);
    quicksort(a, low, pindex - 1);
    quicksort(a, pindex + 1, high);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x1,%eax
jg     1146 <quicksort+0x26>
jmp    117c <quicksort+0x5c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%eax
sub    %esi,%eax
cmp    $0x2,%eax
jl     116b <quicksort+0x4b>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort@plt>
add    $0x1,%ebx
mov    %r14d,%eax
sub    %ebx,%eax
mov    %ebx,%ebp
cmp    $0x1,%eax
jg     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = icmp sle i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %3
br label %26
13: ; preds = %3
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call i32 @partition(i32* %14, i32 %15, i32 %16)
store i32 %17, i32* %7
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = load i32, i32* %7
%21 = sub nsw i32 %20, 1
%22 = load i32*, i32** %4
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
%25 = load i32, i32* %6
br label %26
26: ; preds = %12, %13
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = icmp slt i32 %4, 2
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ %1, %3 ]
%8 = tail call i32 @partition(i32* %0, i32 %7, i32 %2)
%9 = add nsw i32 %8, -1
tail call void @quicksort(i32* %0, i32 %7, i32 %9)
%10 = add nsw i32 %8, 1
%11 = sub nsw i32 %2, %10
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %6
13: ; preds = %6, %3
ret void
}
/* Variables and functions */
unsigned int executeBatchWithReply(void *, int /*<<< orphan*/, char **,
                                   unsigned int, int /*<<< orphan*/ *);
unsigned int executeBatch(void *rulesBinding, char **commands,
                          unsigned int commandCount) {
  return executeBatchWithReply(rulesBinding, 0, commands, commandCount, NULL);
}


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

x86 assembly (clang, -O2):
<executeBatch>:
mov    %edx,%ecx
mov    %rsi,%rdx
xor    %esi,%esi
xor    %r8d,%r8d
jmp    1030 <executeBatchWithReply@plt>

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

LLVM IR (-O2):
define i32 @executeBatch(i8* %0, i8** %1, i32 %2) {
%4 = tail call i32 @executeBatchWithReply(i8* %0, i32 0, i8** %1, i32 %2, i32* null)
ret i32 %4
}
int IsLeapYear(int year) {
  return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
}


x86 assembly (clang, -O0):
<IsLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <IsLeapYear+0x34>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1148 <IsLeapYear+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsLeapYear>:
test   $0x3,%dil
jne    112c <IsLeapYear+0x2c>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%eax
sub    %ecx,%edx
je     112c <IsLeapYear+0x2c>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @IsLeapYear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6, %1
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @IsLeapYear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ mmcau_sha1_hash_n(unsigned int *, int, unsigned int *);
void mmcau_sha1_hash(unsigned int msg_data[], unsigned int sha1_state[]) {
  mmcau_sha1_hash_n(msg_data, 1, sha1_state);
}


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

x86 assembly (clang, -O2):
<mmcau_sha1_hash>:
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <mmcau_sha1_hash_n@plt>

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

LLVM IR (-O2):
define void @mmcau_sha1_hash(i32* %0, i32* %1) {
%3 = tail call i32 @mmcau_sha1_hash_n(i32* %0, i32 1, i32* %1)
ret void
}
int test_imm_4Cint8_reg(signed char val) {
  return ((val) & (-0x4C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Cint8_reg>:
test   $0xb4,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Cint8_reg(i8 signext %0) {
%2 = and i8 %0, -76
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int __builtin_popcount(unsigned int);
int /*<<< orphan*/ assert(int);
int PopCount(unsigned int x) {
  int value = __builtin_popcount(x);
  assert(value >= 0 && value <= 31);
  return value;
}


x86 assembly (clang, -O0):
<PopCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    %ecx,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%ecx
mov    %ecx,%eax
and    $0x33333333,%eax
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     116c <PopCount+0x5c>
cmpl   $0x1f,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PopCount>:
push   %rbx
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
mov    %edi,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
and    $0x33333333,%eax
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%ebx
shr    $0x18,%ebx
xor    %eax,%eax
cmp    $0xffffffff,%edi
setne  %al
mov    %eax,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @PopCount(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @llvm.ctpop.i32(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp sle i32 %9, 31
br label %11
11: ; preds = %8, %1
%12 = phi i1 [ false, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @PopCount(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ne i32 %0, -1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i32 %2
}
int int_size_is_32() {
  int x1 = 0x80000000;
  int x2 = 0x7FFFFFFF;
  return x1 < 0 && x2 > 0;
}


x86 assembly (clang, -O0):
<int_size_is_32>:
push   %rbp
mov    %rsp,%rbp
movl   $0x80000000,-0x4(%rbp)
movl   $0x7fffffff,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jge    112b <int_size_is_32+0x2b>
cmpl   $0x0,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_size_is_32() {
%1 = alloca i32
%2 = alloca i32
store i32 -2147483648, i32* %1
store i32 2147483647, i32* %2
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br label %8
8: ; preds = %5, %0
%9 = phi i1 [ false, %0 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @int_size_is_32() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", 1 < 2 ? 5 : 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x5,%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    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int unlink(char const *);
int fsop_unlink(const char *file) { return unlink(file); }


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

x86 assembly (clang, -O2):
<fsop_unlink>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @fsop_unlink(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showHelp() {
  printf("====================================================================="
         "===========\n"
         "Help\n"
         "====================================================================="
         "===========\n"
         " (l)ook\t\tinspect environment, or item\n"
         " look me\tinformation on current player\n"
         " (ex)amine\texamine surroundings\n"
         " (u)p\t\tmove up\n"
         " (d)own\t\tmove down\n"
         " quit\t\texit the game\n"
         " (h)elp\t\tshow this screen\n");
}


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

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

LLVM IR (-O0):
@.str = [358 x i8] c"================================================================================\0AHelp\0A================================================================================\0A (l)ook\09\09inspect environment, or item\0A look me\09information on current player\0A (ex)amine\09examine surroundings\0A (u)p\09\09move up\0A (d)own\09\09move down\0A quit\09\09exit the game\0A (h)elp\09\09show this screen\0A\00"
define void @showHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([358 x i8], [358 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [357 x i8] c"================================================================================\0AHelp\0A================================================================================\0A (l)ook\09\09inspect environment, or item\0A look me\09information on current player\0A (ex)amine\09examine surroundings\0A (u)p\09\09move up\0A (d)own\09\09move down\0A quit\09\09exit the game\0A (h)elp\09\09show this screen\00"
define void @showHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([357 x i8], [357 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C_SLAVE;
int /*<<< orphan*/ exit(int);
scalar_t__ ioctl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ write_two(int, int, int);
void enable_accel(int file) {
  if (ioctl(file, I2C_SLAVE, (0x53)) < 0) {
    printf("error: failed to acquire bus address and or talk to slave\n");
    exit(1);
  }
  write_two(file, (0X2D), 0x08);
}


x86 assembly (clang, -O0):
<enable_accel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    $0x53,%edx
call   1050 <ioctl@plt>
cmp    $0x0,%rax
jge    1181 <enable_accel+0x41>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x4(%rbp),%edi
mov    $0x2d,%esi
mov    $0x8,%edx
call   1030 <write_two@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_accel>:
push   %rbx
mov    %edi,%ebx
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    $0x53,%edx
call   1050 <ioctl@plt>
test   %rax,%rax
js     116d <enable_accel+0x2d>
mov    %ebx,%edi
mov    $0x2d,%esi
mov    $0x8,%edx
pop    %rbx
jmp    1030 <write_two@plt>
lea    0xe8c(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@I2C_SLAVE = global i32 0
@.str = [59 x i8] c"error: failed to acquire bus address and or talk to slave\0A\00"
define void @enable_accel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @I2C_SLAVE
%5 = call i64 @ioctl(i32 %3, i32 %4, i32 83)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 @write_two(i32 %11, i32 45, i32 8)
ret void
}

LLVM IR (-O2):
@I2C_SLAVE = global i32 0
@str = [58 x i8] c"error: failed to acquire bus address and or talk to slave\00"
define void @enable_accel(i32 %0) {
%2 = load i32, i32* @I2C_SLAVE
%3 = tail call i64 @ioctl(i32 %0, i32 %2, i32 83)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = tail call i32 @write_two(i32 %0, i32 45, i32 8)
ret void
}
__float128 test1q(__float128 a) { return -a; }


x86 assembly (clang, -O0):
<test1q>:
push   %rbp
mov    %rsp,%rbp
movaps %xmm0,-0x10(%rbp)
movaps -0x10(%rbp),%xmm0
movaps 0xeed(%rip),%xmm1
xorps  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1q>:
xorps  0xef9(%rip),%xmm0
ret

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

LLVM IR (-O2):
define fp128 @test1q(fp128 %0) {
%2 = fneg fp128 %0
ret fp128 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 5;
  int *p;
  p = &a;
  {
    int a = 10;
    printf("%i\n", (*p));
    printf("%i\n", (a));
  }
  printf("%i\n", sizeof(a));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 (...) @getchar()
ret i32 0
}
void CalcFrameSsim() {}


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

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

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

LLVM IR (-O2):
define void @CalcFrameSsim() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memmove(char *, char *, size_t);
size_t strlen(char *);
char *auto_strdup(char *input) {
  char *rtn = (char *)malloc(sizeof(char) * (strlen(input) + 1));
  memmove(rtn, input, strlen(input));
  rtn[strlen(input)] = '\0';
  return rtn;
}


x86 assembly (clang, -O0):
<auto_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
call   1050 <memmove@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auto_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1050 <memmove@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movb   $0x0,(%r14,%rax,1)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @auto_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = mul i64 1, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = load i8*, i8** %2
%14 = call i64 @strlen(i8* %13)
%15 = call i32 @memmove(i8* %11, i8* %12, i64 %14)
%16 = load i8*, i8** %3
%17 = load i8*, i8** %2
%18 = call i64 @strlen(i8* %17)
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @auto_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 1
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%8 = tail call i32 @memmove(i8* %6, i8* %0, i64 %7)
%9 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%10 = getelementptr inbounds i8, i8* %6, i64 %9
store i8 0, i8* %10
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int /*<<< orphan*/ __NR_openat;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, char const *, int,
            int /*<<< orphan*/);
__attribute__((always_)) int _syscall_creat(const char *pathname, mode_t mode) {
  return syscall(__NR_openat, AT_FDCWD, pathname, O_WRONLY | O_CREAT | O_TRUNC,
                 mode);
}


x86 assembly (clang, -O0):
<_syscall_creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    0x2e84(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb3(%rip),%rax
or     (%rax),%ecx
mov    0x2ea2(%rip),%rax
or     (%rax),%ecx
mov    -0xc(%rbp),%r8d
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_creat>:
mov    %esi,%r8d
mov    %rdi,%rdx
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    0x2e92(%rip),%rax
mov    0x2e93(%rip),%rsi
mov    0x2ec4(%rip),%rcx
mov    (%rcx),%ecx
or     (%rsi),%ecx
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
or     (%rax),%ecx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_openat = global i32 0
@AT_FDCWD = global i32 0
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @_syscall_creat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @__NR_openat
%6 = load i32, i32* @AT_FDCWD
%7 = load i8*, i8** %3
%8 = load i32, i32* @O_WRONLY
%9 = load i32, i32* @O_CREAT
%10 = or i32 %8, %9
%11 = load i32, i32* @O_TRUNC
%12 = or i32 %10, %11
%13 = load i32, i32* %4
%14 = call i32 @syscall(i32 %5, i32 %6, i8* %7, i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@__NR_openat = global i32 0
@AT_FDCWD = global i32 0
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @_syscall_creat(i8* %0, i32 %1) {
%3 = load i32, i32* @__NR_openat
%4 = load i32, i32* @AT_FDCWD
%5 = load i32, i32* @O_WRONLY
%6 = load i32, i32* @O_CREAT
%7 = or i32 %6, %5
%8 = load i32, i32* @O_TRUNC
%9 = or i32 %7, %8
%10 = tail call i32 @syscall(i32 %3, i32 %4, i8* %0, i32 %9, i32 %1)
ret i32 %10
}
void gtk_widget_modify_bg() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_modify_bg() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello Git!\n");
  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    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello Git!\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 ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Hello Git!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void SysCtlC28Disable(void) {
  unsigned long ulMWRAllow;
  ulMWRAllow = (*((volatile unsigned long *)(0x400FB980)));
  (*((volatile unsigned long *)(0x400FB980))) = 0xA5A5A5A5;
  (*((volatile unsigned long *)(0x400FB860))) |= 0x00000001;
  (*((volatile unsigned long *)(0x400FB980))) = ulMWRAllow;
}


x86 assembly (clang, -O0):
<SysCtlC28Disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb980,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    $0x400fb980,%eax
mov    $0xa5a5a5a5,%ecx
mov    %rcx,(%rax)
mov    $0x400fb860,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x400fb860,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rcx
mov    $0x400fb980,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlC28Disable>:
mov    0x400fb980,%rax
40
mov    $0xa5a5a5a5,%ecx
mov    %rcx,0x400fb980
40
orq    $0x1,0x400fb860
40 01
mov    %rax,0x400fb980
40
ret

LLVM IR (-O0):
define void @SysCtlC28Disable() {
%1 = alloca i64
%2 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store i64 %2, i64* %1
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1074772064 to i64*)
%4 = or i64 %3, 1
store volatile i64 %4, i64* inttoptr (i64 1074772064 to i64*)
%5 = load i64, i64* %1
store volatile i64 %5, i64* inttoptr (i64 1074772352 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlC28Disable() {
%1 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%2 = load volatile i64, i64* inttoptr (i64 1074772064 to i64*)
%3 = or i64 %2, 1
store volatile i64 %3, i64* inttoptr (i64 1074772064 to i64*)
store volatile i64 %1, i64* inttoptr (i64 1074772352 to i64*)
ret void
}
void FIQ_Handler(void) {}


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

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

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

LLVM IR (-O2):
define void @FIQ_Handler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __VERIFIER_error(void) { abort(); }


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

x86 assembly (clang, -O2):
<__VERIFIER_error>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @__VERIFIER_error() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @__VERIFIER_error() {
%1 = tail call i32 (...) @abort()
unreachable
}