xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sh_list_assign(void *, void *);
void sh_queue_assign(void *to, void *from) { sh_list_assign(to, from); }


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

x86 assembly (clang, -O2):
<sh_queue_assign>:
jmp    1030 <sh_list_assign@plt>

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

LLVM IR (-O2):
define void @sh_queue_assign(i8* %0, i8* %1) {
%3 = tail call i32 @sh_list_assign(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ simple_real_time_now();
int /*<<< orphan*/ simple_timestamp_to_iso8601(int /*<<< orphan*/, char *);
void simple_now_iso8601(char out[]) {
  simple_timestamp_to_iso8601(simple_real_time_now(), out);
}


x86 assembly (clang, -O0):
<simple_now_iso8601>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <simple_real_time_now@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <simple_timestamp_to_iso8601@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_now_iso8601>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <simple_real_time_now@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <simple_timestamp_to_iso8601@plt>

LLVM IR (-O0):
define void @simple_now_iso8601(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @simple_real_time_now()
%4 = load i8*, i8** %2
%5 = call i32 @simple_timestamp_to_iso8601(i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
define void @simple_now_iso8601(i8* %0) {
%2 = tail call i32 (...) @simple_real_time_now()
%3 = tail call i32 @simple_timestamp_to_iso8601(i32 %2, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printbl(int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<printbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <printbl+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printbl+0x12>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @printbl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @printbl(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_secp256k1_sub(uintptr_t, uintptr_t, uintptr_t);
void fiat_secp256k1_sub(uint32_t out1[8], const uint32_t arg1[8],
                        const uint32_t arg2[8]) {
  internal_fiat_secp256k1_sub((uintptr_t)out1, (uintptr_t)arg1,
                              (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_secp256k1_sub>:
jmp    1030 <internal_fiat_secp256k1_sub@plt>

LLVM IR (-O0):
define void @fiat_secp256k1_sub(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_secp256k1_sub(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_sub(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_secp256k1_sub(i64 %4, i64 %5, i64 %6)
ret void
}
int __attribute__((const)) my_sin(unsigned char i) {
  return (i * 46) % 289 > 144;
}


x86 assembly (clang, -O0):
<my_sin>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
imul   $0x2e,%eax,%eax
mov    $0x121,%ecx
cltd
idiv   %ecx
cmp    $0x90,%edx
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sin>:
imul   $0x2e,%edi,%eax
imul   $0x28bf66,%edi,%ecx
shr    $0x18,%ecx
imul   $0x121,%ecx,%ecx
sub    %ecx,%eax
movzwl %ax,%ecx
xor    %eax,%eax
cmp    $0x91,%ecx
setae  %al
ret

LLVM IR (-O0):
define i32 @my_sin(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = mul nsw i32 %4, 46
%6 = srem i32 %5, 289
%7 = icmp sgt i32 %6, 144
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @my_sin(i8 zeroext %0) {
%2 = zext i8 %0 to i16
%3 = mul nuw nsw i16 %2, 46
%4 = urem i16 %3, 289
%5 = icmp ugt i16 %4, 144
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned int, unsigned int,
                           unsigned int, unsigned int);
void string_from_ip_address(const unsigned char *bytes, char *str) {
  sprintf(str, "%u.%u.%u.%u", (unsigned)bytes[0], (unsigned)bytes[1],
          (unsigned)bytes[2], (unsigned)bytes[3]);
}


x86 assembly (clang, -O0):
<string_from_ip_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%r8d
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%r9d
lea    0xeb4(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_from_ip_address>:
mov    %rsi,%rax
movzbl (%rdi),%edx
movzbl 0x1(%rdi),%ecx
movzbl 0x2(%rdi),%r8d
movzbl 0x3(%rdi),%r9d
lea    0xed5(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%u.%u.%u.%u\00"
define void @string_from_ip_address(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 3
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %13, i32 %17, i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%u.%u.%u.%u\00"
define void @string_from_ip_address(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = getelementptr inbounds i8, i8* %0, i64 3
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %10, i32 %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fork_chain(int);
int main() {
  fork_chain(15);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fork_chain(i32 15)
ret i32 0
}
/* Variables and functions */
int decode_sigmaster_char(char);
int parse_face(char *p) {
  int f = decode_sigmaster_char(*p);
  if (f >= 0)
    p++;
  return f;
}


x86 assembly (clang, -O0):
<parse_face>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <decode_sigmaster_char@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1141 <parse_face+0x31>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_face>:
movsbl (%rdi),%edi
jmp    1030 <decode_sigmaster_char@plt>

LLVM IR (-O0):
define i32 @parse_face(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i32 @decode_sigmaster_char(i8 signext %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @parse_face(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @decode_sigmaster_char(i8 signext %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ optionHashSome(int *, char **, int /*<<< orphan*/);
void optionHash(int *pArgc, char *argv[]) { optionHashSome(pArgc, argv, 0); }


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

x86 assembly (clang, -O2):
<optionHash>:
xor    %edx,%edx
jmp    1030 <optionHashSome@plt>

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

LLVM IR (-O2):
define void @optionHash(i32* %0, i8** %1) {
%3 = tail call i32 @optionHashSome(i32* %0, i8** %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ quickSort(int *, int /*<<< orphan*/, int);
int main() {
  int A[] = {10, 80, 30, 90, 40, 50, 70};
  printArray(A, 7);
  quickSort(A, 0, 6);
  printArray(A, 7);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb9(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1050 <printArray@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1040 <quickSort@plt>
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1050 <printArray@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xed0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1040 <quickSort@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.A = [7 x i32] [i32 10, i32 80, i32 30, i32 90, i32 40, i32 50, i32 70]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 7)
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%6 = call i32 @quickSort(i32* %5, i32 0, i32 6)
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%8 = call i32 @printArray(i32* %7, i32 7)
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [7 x i32] [i32 10, i32 80, i32 30, i32 90, i32 40, i32 50, i32 70]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 7)
%5 = call i32 @quickSort(i32* %3, i32 0, i32 6)
%6 = call i32 @printArray(i32* %3, i32 7)
%7 = call i32 (...) @getchar()
ret i32 0
}
void skip_romstage(void) { asm volatile("jmp	__main\n"); }


x86 assembly (clang, -O0):
<skip_romstage>:
push   %rbp
mov    %rsp,%rbp
jmp    1030 <__main@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_romstage>:
jmp    1030 <__main@plt>
ret

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

LLVM IR (-O2):
define void @skip_romstage() {
tail call void asm sideeffect "jmp\09__main\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int ENODEV;
int downgrade_hvdcp_9v_to_5v(void) { return -ENODEV; }


x86 assembly (clang, -O0):
<downgrade_hvdcp_9v_to_5v>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<downgrade_hvdcp_9v_to_5v>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @downgrade_hvdcp_9v_to_5v() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @downgrade_hvdcp_9v_to_5v() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
char const *gettext(char const *);
__attribute__((format_arg(1))) const char *_(const char *msgid) {
  if (!*msgid)
    return "";
  return 0 ? "# GETTEXT POISON #" : gettext(msgid);
}


x86 assembly (clang, -O0):
<_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1139 <_+0x29>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <_+0x36>
mov    -0x10(%rbp),%rdi
call   1030 <gettext@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_>:
cmpb   $0x0,(%rdi)
je     111a <_+0xa>
jmp    1030 <gettext@plt>
lea    0xedf(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @_(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @gettext(i8* %9)
store i8* %10, i8** %2
br label %11
11: ; preds = %8, %7
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @_(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @gettext(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %7
}
void test_shift_too_much(char x) {
  if (0)
    (void)(x >> 80);
  (void)(x >> 80);
}


x86 assembly (clang, -O0):
<test_shift_too_much>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_shift_too_much(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = ashr i32 %4, 80
ret void
}

LLVM IR (-O2):
define void @test_shift_too_much(i8 signext %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ UINT16_MAX;
uint16_t limitUint16(int32_t value) {
  if (value > UINT16_MAX) {
    value = UINT16_MAX;
  } else if (value < 0) {
    value = 0;
  }
  return (uint16_t)value;
}


x86 assembly (clang, -O0):
<limitUint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%rax
jle    112f <limitUint16+0x2f>
mov    0x2ebd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <limitUint16+0x47>
cmpq   $0x0,-0x8(%rbp)
jge    1142 <limitUint16+0x42>
movq   $0x0,-0x8(%rbp)
jmp    1147 <limitUint16+0x47>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<limitUint16>:
mov    0x2ed9(%rip),%rax
xor    %ecx,%ecx
test   %rdi,%rdi
mov    %edi,%edx
cmovle %ecx,%edx
mov    (%rax),%rax
cmp    %rdi,%rax
cmovge %edx,%eax
ret

LLVM IR (-O0):
@UINT16_MAX = global i64 0
define i32 @limitUint16(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @UINT16_MAX
%5 = icmp sgt i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i64, i64* @UINT16_MAX
store i64 %7, i64* %2
br label %13
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i64 0, i64* %2
br label %12
12: ; preds = %11, %8
br label %13
13: ; preds = %12, %6
%14 = load i64, i64* %2
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@UINT16_MAX = global i64 0
define i32 @limitUint16(i64 %0) {
%2 = load i64, i64* @UINT16_MAX
%3 = icmp slt i64 %2, %0
%4 = icmp sgt i64 %0, 0
%5 = select i1 %4, i64 %0, i64 0
%6 = select i1 %3, i64 %2, i64 %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
int test_imm_E0uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xE0 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E0uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 14680064
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_random(int /*<<< orphan*/ *, int);
void get_key(uint8_t key[12]) { get_random(key, 12); }


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

x86 assembly (clang, -O2):
<get_key>:
mov    $0xc,%esi
jmp    1030 <get_random@plt>

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

LLVM IR (-O2):
define void @get_key(i32* %0) {
%2 = tail call i32 @get_random(i32* %0, i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double sqrt(double);
int main() {
  double flaeche = 1600.00, seite;
  seite = sqrt(flaeche);
  printf("\n\n\tSeitenlaenge =\t%.2f cm\n", seite);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"\0A\0A\09Seitenlaenge =\09%.2f cm\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 1.600000e+03, double* %2
%4 = load double, double* %2
%5 = call double @sqrt(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0A\0A\09Seitenlaenge =\09%.2f cm\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double 4.000000e+01)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ entab(int);
int main(void) {
  int tabwidth = 4;
  entab(tabwidth);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @entab(i32 4)
ret i32 0
}
int axp_set_cstchargetime(int cst) {
  int ret = 0;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @axp_set_cstchargetime(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ DSA;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *PEM_read_bio_PrivateKey(int /*<<< orphan*/ *,
                                            int /*<<< orphan*/ *,
                                            int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ *pkey_get_dsa(int /*<<< orphan*/ *, int /*<<< orphan*/ **);
DSA *PEM_read_bio_DSAPrivateKey(BIO *bp, DSA **dsa, pem_password_cb *cb,
                                void *u) {
  EVP_PKEY *pktmp;
  pktmp = PEM_read_bio_PrivateKey(bp, NULL, cb, u);
  return pkey_get_dsa(pktmp, dsa);
}


x86 assembly (clang, -O0):
<PEM_read_bio_DSAPrivateKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <PEM_read_bio_PrivateKey@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pkey_get_dsa@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_bio_DSAPrivateKey>:
push   %rbx
mov    %rsi,%rbx
xor    %esi,%esi
call   1040 <PEM_read_bio_PrivateKey@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <pkey_get_dsa@plt>

LLVM IR (-O0):
define i32* @PEM_read_bio_DSAPrivateKey(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %7
%12 = load i8*, i8** %8
%13 = call i32* @PEM_read_bio_PrivateKey(i32* %10, i32* null, i32* %11, i8* %12)
store i32* %13, i32** %9
%14 = load i32*, i32** %9
%15 = load i32**, i32*** %6
%16 = call i32* @pkey_get_dsa(i32* %14, i32** %15)
ret i32* %16
}

LLVM IR (-O2):
define i32* @PEM_read_bio_DSAPrivateKey(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = tail call i32* @PEM_read_bio_PrivateKey(i32* %0, i32* null, i32* %2, i8* %3)
%6 = tail call i32* @pkey_get_dsa(i32* %5, i32** %1)
ret i32* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
char *str_reverse(char *);
int main(int argc, char *argv[]) {
  if (1 == argc) {
    printf("Please provide a string to reverse!\n");
    return 1;
  }
  printf("Reversed: \"%s\"\n", str_reverse(argv[1]));
  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)
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    115e <main+0x3e>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1183 <main+0x63>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <str_reverse@plt>
mov    %rax,%rsi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jne    1149 <main+0x19>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
jmp    1165 <main+0x35>
mov    0x8(%rsi),%rdi
call   1050 <str_reverse@plt>
lea    0xea7(%rip),%rdi
xor    %ebx,%ebx
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Please provide a string to reverse!\0A\00"
@.str.1 = [16 x i8] c"Reversed: \22%s\22\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 = load i32, i32* %4
%7 = icmp eq i32 1, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i8* @str_reverse(i8* %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %14)
store i32 0, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"Reversed: \22%s\22\0A\00"
@str = [36 x i8] c"Please provide a string to reverse!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i8* @str_reverse(i8* %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %12
}
int dce_ishex(char c) {
  return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F');
}


x86 assembly (clang, -O0):
<dce_ishex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <dce_ishex+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    114e <dce_ishex+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <dce_ishex+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dce_ishex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @dce_ishex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 70
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @dce_ishex(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 6
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
void g_DUMMY_enable_commandinput(int win_id, int enable) {
  win_id = win_id;
  enable = enable;
}


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

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

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

LLVM IR (-O2):
define void @g_DUMMY_enable_commandinput(i32 %0, i32 %1) {
ret void
}
void bin_converter(int from, int to[8]) {
  int pos = 7;
  while (from != 0) {
    to[pos] = from % 2;
    from /= 2;
    pos--;
  }
}


x86 assembly (clang, -O0):
<bin_converter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x7,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114e <bin_converter+0x4e>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <bin_converter+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_converter>:
test   %edi,%edi
je     1130 <bin_converter+0x30>
add    $0x1c,%rsi
mov    %edi,%eax
nopw   0x0(%rax,%rax,1)
shr    $0x1f,%eax
add    %edi,%eax
mov    %eax,%ecx
and    $0xfffffffe,%ecx
mov    %edi,%edx
sub    %ecx,%edx
mov    %edx,(%rsi)
sar    %eax
add    $0x1,%edi
add    $0xfffffffffffffffc,%rsi
cmp    $0x2,%edi
mov    %eax,%edi
ja     1110 <bin_converter+0x10>
ret

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

LLVM IR (-O2):
define void @bin_converter(i32 %0, i32* nocapture writeonly %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 7, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = srem i32 %6, 2
%8 = getelementptr inbounds i32, i32* %1, i64 %5
store i32 %7, i32* %8
%9 = sdiv i32 %6, 2
%10 = add i64 %5, -1
%11 = add i32 %6, 1
%12 = icmp ult i32 %11, 3
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("\"Programming is like building a multilingual puzzle");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@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 = [52 x i8] c"\22Programming is like building a multilingual puzzle\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"\22Programming is like building a multilingual puzzle\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int hash(char *ident) {
  int sum = 0;
  while (*ident != '\0')
    sum = (2 * sum + *ident++) % 1001;
  return (sum);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <hash+0x49>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    $0x3e9,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1140 <hash+0x40>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
cltq
imul   $0x4178749f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x28,%rcx
add    %edx,%ecx
imul   $0x3e9,%ecx,%ecx
sub    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = load i32, i32* %3
%11 = mul nsw i32 2, %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = add nsw i32 %11, %15
%17 = srem i32 %16, 1001
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = shl nsw i32 %6, 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = add nsw i32 %9, %8
%12 = srem i32 %11, 1001
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  register int i;
  for (i = 0; i < 100; i++) {
    printf("%d", i);
  }
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    115d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = call i32 (...) @getchar()
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
void print_ip(uint32_t ip) {
  uint8_t d[4];
  *(uint32_t *)d = ip;
  kprintf("%d.%d.%d.%d", d[3], d[2], d[1], d[0]);
}


x86 assembly (clang, -O0):
<print_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xecb(%rip),%rdi
call   1030 <kprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ip>:
mov    %edi,%r8d
lea    0xee6(%rip),%rdi
jmp    1030 <kprintf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define void @print_ip(i32 %0) {
%2 = tail call i32 @kprintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 undef, i32 undef, i32 undef, i32 %0)
ret void
}
int tt_width(struct bitmap_font *font) { return 4; }


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

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

LLVM IR (-O0):
%struct.bitmap_font = type opaque
define i32 @tt_width(%struct.bitmap_font* %0) {
%2 = alloca %struct.bitmap_font*
store %struct.bitmap_font* %0, %struct.bitmap_font** %2
ret i32 4
}

LLVM IR (-O2):
%struct.bitmap_font = type opaque
define i32 @tt_width(%struct.bitmap_font* nocapture readnone %0) {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlcpy(char *, char *, unsigned long);
unsigned long ft_strlen(char *);
scalar_t__ malloc(int);
char *ft_strdup(char *src) {
  char *clone;
  unsigned long src_len;
  src_len = ft_strlen(src);
  clone = (char *)malloc(sizeof(char) * (src_len + 1));
  ft_strlcpy(clone, src, src_len + 1);
  if (ft_strlen(clone) != src_len)
    return (0);
  return (clone);
}


x86 assembly (clang, -O0):
<ft_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
add    $0x1,%rdx
call   1050 <ft_strlcpy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <ft_strlen@plt>
cmp    -0x20(%rbp),%rax
je     1195 <ft_strdup+0x65>
movq   $0x0,-0x8(%rbp)
jmp    119d <ft_strdup+0x6d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdup>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <ft_strlen@plt>
mov    %rax,%r14
lea    0x1(%rax),%r12
mov    %r12d,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <ft_strlcpy@plt>
mov    %rbx,%rdi
call   1030 <ft_strlen@plt>
xor    %ecx,%ecx
cmp    %r14,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @ft_strdup(i8* %0) {
%2 = tail call i64 @ft_strlen(i8* %0)
%3 = add i64 %2, 1
%4 = trunc i64 %3 to i32
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @ft_strlcpy(i8* %6, i8* %0, i64 %3)
%8 = tail call i64 @ft_strlen(i8* %6)
%9 = icmp eq i64 %8, %2
%10 = select i1 %9, i8* %6, i8* null
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ test();
int main(int argc, char *argv[]) { test(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test()
ret i32 0
}
int *check_ptr_MAIL_SERVERint(int *v) { return v; }


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

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

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

LLVM IR (-O2):
define i32* @check_ptr_MAIL_SERVERint(i32* readnone returned %0) {
ret i32* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
scalar_t__ rat_mod_get_msr(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int rat_mod_requires_pid(uint16_t mid, uint16_t aid) {
  do {
  } while (0);
  if (rat_mod_get_msr(mid, aid, NULL, NULL) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<rat_mod_requires_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
jmp    1123 <rat_mod_requires_pid+0x13>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <rat_mod_get_msr@plt>
cmp    $0x0,%rax
jne    114b <rat_mod_requires_pid+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <rat_mod_requires_pid+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rat_mod_requires_pid>:
push   %rax
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <rat_mod_get_msr@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rat_mod_requires_pid(i32 %0, i32 %1) {
%3 = tail call i64 @rat_mod_get_msr(i32 %0, i32 %1, i32* null, i32* null)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int main() {
  long n = 5000000000;
  int c = n;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movabs $0x12a05f200,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i64
%2 = alloca i32
store i64 5000000000, i64* %1
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
store i32 %4, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int numBuckets(int numElements) { return 26 * 26; }


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

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

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

LLVM IR (-O2):
define i32 @numBuckets(i32 %0) {
ret i32 676
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int i = 1, sum = 0;
  while (1) {
    sum += i;
    i++;
    if (i > 100)
      break;
  }
  printf("%d \n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jle    1147 <main+0x37>
jmp    114c <main+0x3c>
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x13ba,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%d \0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %12
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 100
br i1 %10, label %11, label %12
11: ; preds = %3
br label %13
12: ; preds = %3
br label %3
13: ; preds = %11
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}

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