xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ RegWriteA(int, int);
void AfDrvSw(unsigned char UcDrvSw) {
  if (UcDrvSw == 0x01) {
    RegWriteA(0x0081, 0x20);
    RegWriteA(0x00A0, 0x80);
  } else {
    RegWriteA(0x00A0, 0x00);
  }
}


x86 assembly (clang, -O0):
<AfDrvSw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    114e <AfDrvSw+0x3e>
mov    $0x81,%edi
mov    $0x20,%esi
call   1030 <RegWriteA@plt>
mov    $0xa0,%edi
mov    $0x80,%esi
call   1030 <RegWriteA@plt>
jmp    115a <AfDrvSw+0x4a>
mov    $0xa0,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AfDrvSw>:
xor    %esi,%esi
cmp    $0x1,%dil
jne    1131 <AfDrvSw+0x21>
push   %rax
mov    $0x81,%edi
mov    $0x20,%esi
call   1030 <RegWriteA@plt>
mov    $0x80,%esi
add    $0x8,%rsp
mov    $0xa0,%edi
jmp    1030 <RegWriteA@plt>

LLVM IR (-O0):
define void @AfDrvSw(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @RegWriteA(i32 129, i32 32)
%8 = call i32 @RegWriteA(i32 160, i32 128)
br label %11
9: ; preds = %1
%10 = call i32 @RegWriteA(i32 160, i32 0)
br label %11
11: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
define void @AfDrvSw(i8 zeroext %0) {
%2 = icmp eq i8 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @RegWriteA(i32 129, i32 32)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 128, %3 ], [ 0, %1 ]
%7 = tail call i32 @RegWriteA(i32 160, i32 %6)
ret void
}
/* Variables and functions */
size_t align_size_8(size_t num) { return (num + 7) / 8 * 8; }


x86 assembly (clang, -O0):
<align_size_8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x7,%rax
shr    $0x3,%rax
shl    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_size_8>:
lea    0x7(%rdi),%rax
and    $0xfffffffffffffff8,%rax
ret

LLVM IR (-O0):
define i64 @align_size_8(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 7
%5 = udiv i64 %4, 8
%6 = mul i64 %5, 8
ret i64 %6
}

LLVM IR (-O2):
define i64 @align_size_8(i64 %0) {
%2 = add i64 %0, 7
%3 = and i64 %2, -8
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Hello World!"); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *filebasename(char *path) {
  char *p = strrchr(path, '/');
  if (p == NULL)
    return path;
  return p + 1;
}


x86 assembly (clang, -O0):
<filebasename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1146 <filebasename+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <filebasename+0x42>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filebasename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @filebasename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ max_prime_factor(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  printf("%ld\n", max_prime_factor(600851475143));
  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    $0xe589eac7,%edi
call   1040 <max_prime_factor@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\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 @max_prime_factor(i32 -443946297)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @max_prime_factor(i32 -443946297)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
char *pgr_backend_role(int role) {
  switch (role) {
  case 1:
    return "master";
  case 2:
    return "slave";
  default:
    return "unknown";
  }
}


x86 assembly (clang, -O0):
<pgr_backend_role>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     112c <pgr_backend_role+0x2c>
jmp    111b <pgr_backend_role+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     113c <pgr_backend_role+0x3c>
jmp    114c <pgr_backend_role+0x4c>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <pgr_backend_role+0x57>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <pgr_backend_role+0x57>
lea    0xeba(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgr_backend_role>:
cmp    $0x2,%edi
lea    0xefd(%rip),%rax
lea    0xefc(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xee1(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"master\00"
@.str.1 = [6 x i8] c"slave\00"
@.str.2 = [8 x i8] c"unknown\00"
define i8* @pgr_backend_role(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 1, label %5
i32 2, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"master\00"
@.str.1 = [6 x i8] c"slave\00"
@.str.2 = [8 x i8] c"unknown\00"
define i8* @pgr_backend_role(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int lcm(int, int);
int lcmOfArray(int input[], int size) {
  int result = input[0];
  for (int i = 1; i < size; i++) {
    result = lcm(result, input[i]);
  }
  return result;
}


x86 assembly (clang, -O0):
<lcmOfArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <lcmOfArray+0x4f>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <lcm@plt>
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <lcmOfArray+0x1f>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcmOfArray>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%eax
cmp    $0x2,%esi
jl     1144 <lcmOfArray+0x34>
mov    %rdi,%r15
mov    %esi,%r14d
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %eax,%edi
call   1030 <lcm@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <lcmOfArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @lcmOfArray(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9, %2
%8 = phi i32 [ %3, %2 ], [ %14, %9 ]
ret i32 %8
9: ; preds = %5, %9
%10 = phi i64 [ 1, %5 ], [ %15, %9 ]
%11 = phi i32 [ %3, %5 ], [ %14, %9 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %10
%13 = load i32, i32* %12
%14 = tail call i32 @lcm(i32 %11, i32 %13)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %7, label %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
extern uint32_t cel_rs_hash(const char *str) {
  register uint32_t h = 0;
  register uint32_t magic = 63689;
  while (*str != '\0') {
    h = h * magic + (*str++);
    magic *= 378551;
  }
  return (h & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<cel_rs_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xf8c9,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1153 <cel_rs_hash+0x53>
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
imul   $0x5c6b7,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <cel_rs_hash+0x16>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cel_rs_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113f <cel_rs_hash+0x3f>
add    $0x1,%rdi
xor    %eax,%eax
mov    $0xf8c9,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
imul   %edx,%eax
add    %ecx,%eax
imul   $0x5c6b7,%edx,%edx
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <cel_rs_hash+0x20>
and    $0x7fffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cel_rs_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %13, %4 ], [ 63689, %1 ]
%7 = phi i32 [ %12, %4 ], [ 0, %1 ]
%8 = phi i8* [ %11, %4 ], [ %0, %1 ]
%9 = sext i8 %5 to i32
%10 = mul nsw i32 %6, %7
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = add nsw i32 %10, %9
%13 = mul nsw i32 %6, 378551
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = and i32 %12, 2147483647
br label %18
18: ; preds = %16, %1
%19 = phi i32 [ 0, %1 ], [ %17, %16 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int error_message(char *msg) {
  fprintf(stderr, msg);
  return (0);
}


x86 assembly (clang, -O0):
<error_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_message>:
push   %rax
mov    %rdi,%rsi
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
define i32 @error_message(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
ret i32 0
}
int fun753() { return 753; }


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

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

LLVM IR (-O0):
define i32 @fun753() {
ret i32 753
}

LLVM IR (-O2):
define i32 @fun753() {
ret i32 753
}
/* Variables and functions */
int /*<<< orphan*/ Render_Paletted_ClearRemapping();
void Palette_Initialise(void) { Render_Paletted_ClearRemapping(); }


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

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

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

LLVM IR (-O2):
define void @Palette_Initialise() {
%1 = tail call i32 (...) @Render_Paletted_ClearRemapping()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgincind(char *, char *, int);
void cginc1pi(int v) { cgincind("ax", "add", v); }


x86 assembly (clang, -O0):
<cginc1pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <cgincind@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cginc1pi>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee3(%rip),%rsi
jmp    1030 <cgincind@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ax\00"
@.str.1 = [4 x i8] c"add\00"
define void @cginc1pi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cgincind(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ax\00"
@.str.1 = [4 x i8] c"add\00"
define void @cginc1pi(i32 %0) {
%2 = tail call i32 @cgincind(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void RTFsQueryType(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFsQueryType() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_crc(unsigned char);
int /*<<< orphan*/ serial_send_raw(unsigned char);
void serial_send_cooked(unsigned char sb) {
  process_crc(sb);
  if (sb == 0xCA) {
    serial_send_raw(0xCB);
    serial_send_raw(0);
  } else if (sb == 0xCB) {
    serial_send_raw(0xCB);
    serial_send_raw(1);
  } else {
    serial_send_raw(sb);
  }
}


x86 assembly (clang, -O0):
<serial_send_cooked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <process_crc@plt>
movzbl -0x1(%rbp),%eax
cmp    $0xca,%eax
jne    115c <serial_send_cooked+0x3c>
mov    $0xcb,%edi
call   1030 <serial_send_raw@plt>
xor    %edi,%edi
call   1030 <serial_send_raw@plt>
jmp    1192 <serial_send_cooked+0x72>
movzbl -0x1(%rbp),%eax
cmp    $0xcb,%eax
jne    1184 <serial_send_cooked+0x64>
mov    $0xcb,%edi
call   1030 <serial_send_raw@plt>
mov    $0x1,%edi
call   1030 <serial_send_raw@plt>
jmp    118d <serial_send_cooked+0x6d>
movzbl -0x1(%rbp),%edi
call   1030 <serial_send_raw@plt>
jmp    1192 <serial_send_cooked+0x72>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_send_cooked>:
push   %rbx
mov    %edi,%ebx
call   1040 <process_crc@plt>
cmp    $0xca,%bl
je     1136 <serial_send_cooked+0x16>
cmp    $0xcb,%bl
jne    1142 <serial_send_cooked+0x22>
mov    $0x1,%bl
jmp    1138 <serial_send_cooked+0x18>
xor    %ebx,%ebx
mov    $0xcb,%edi
call   1030 <serial_send_raw@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <serial_send_raw@plt>

LLVM IR (-O0):
define void @serial_send_cooked(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @process_crc(i8 zeroext %3)
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 202
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @serial_send_raw(i8 zeroext -53)
%10 = call i32 @serial_send_raw(i8 zeroext 0)
br label %22
11: ; preds = %1
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, 203
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = call i32 @serial_send_raw(i8 zeroext -53)
%17 = call i32 @serial_send_raw(i8 zeroext 1)
br label %21
18: ; preds = %11
%19 = load i8, i8* %2
%20 = call i32 @serial_send_raw(i8 zeroext %19)
br label %21
21: ; preds = %18, %15
br label %22
22: ; preds = %21, %8
ret void
}

LLVM IR (-O2):
define void @serial_send_cooked(i8 zeroext %0) {
%2 = tail call i32 @process_crc(i8 zeroext %0)
switch i8 %0, label %7 [
i8 -54, label %4
i8 -53, label %3
]
3: ; preds = %1
br label %4
4: ; preds = %1, %3
%5 = phi i8 [ 1, %3 ], [ 0, %1 ]
%6 = tail call i32 @serial_send_raw(i8 zeroext -53)
br label %7
7: ; preds = %4, %1
%8 = phi i8 [ %0, %1 ], [ %5, %4 ]
%9 = tail call i32 @serial_send_raw(i8 zeroext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, void *);
char *wCharConcat(char *, char *);
char *wCharConcatPtr(char *dst, void *ptr) {
  char buffer[32];
  sprintf(buffer, "%p", ptr);
  return wCharConcat(dst, buffer);
}


x86 assembly (clang, -O0):
<wCharConcatPtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <wCharConcat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wCharConcatPtr>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xecc(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <wCharConcat@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define i8* @wCharConcatPtr(i8* %0, i8* %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = call i8* @wCharConcat(i8* %0, i8* %4)
ret i8* %6
}
void mem_write16(int val, unsigned char *p) {
  *(p + 0) = (val >> 0) & 0xFF;
  *(p + 1) = (val >> 8) & 0xFF;
}


x86 assembly (clang, -O0):
<mem_write16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_write16>:
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @mem_write16(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 = ashr i32 %5, 0
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %3
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @mem_write16(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void sector_to_chs(uint32_t sector, uint32_t *c, uint32_t *h, uint32_t *s) {
  *s = sector & 0x3f;
  *h = (sector & 0xff00) >> 8;
  *c = (sector & 0x3ff0000) >> 16;
}


x86 assembly (clang, -O0):
<sector_to_chs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3f,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0x3ff0000,%ecx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sector_to_chs>:
push   %rbx
mov    %edi,%eax
mov    %edi,%ebx
and    $0x3f,%ebx
mov    %ebx,(%rcx)
movzbl %ah,%ecx
mov    %ecx,(%rdx)
shr    $0x10,%eax
and    $0x3ff,%eax
mov    %eax,(%rsi)
pop    %rbx
ret

LLVM IR (-O0):
define void @sector_to_chs(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = and i32 %9, 63
%11 = load i32*, i32** %8
store i32 %10, i32* %11
%12 = load i32, i32* %5
%13 = and i32 %12, 65280
%14 = ashr i32 %13, 8
%15 = load i32*, i32** %7
store i32 %14, i32* %15
%16 = load i32, i32* %5
%17 = and i32 %16, 67043328
%18 = ashr i32 %17, 16
%19 = load i32*, i32** %6
store i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @sector_to_chs(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = and i32 %0, 63
store i32 %5, i32* %3
%6 = lshr i32 %0, 8
%7 = and i32 %6, 255
store i32 %7, i32* %2
%8 = lshr i32 %0, 16
%9 = and i32 %8, 1023
store i32 %9, i32* %1
ret void
}
/* Type definitions */
struct network {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ irc_send_raw(struct network *, char *, ...);
void irc_quit(struct network *net, const char *msg) {
  if (msg)
    irc_send_raw(net, "QUIT :%s", msg);
  else
    irc_send_raw(net, "QUIT");
}


x86 assembly (clang, -O0):
<irc_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <irc_quit+0x36>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <irc_send_raw@plt>
jmp    1158 <irc_quit+0x48>
mov    -0x8(%rbp),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1030 <irc_send_raw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_quit>:
test   %rsi,%rsi
je     1126 <irc_quit+0x16>
mov    %rsi,%rdx
lea    0xee1(%rip),%rsi
xor    %eax,%eax
jmp    1030 <irc_send_raw@plt>
lea    0xedc(%rip),%rsi
xor    %eax,%eax
jmp    1030 <irc_send_raw@plt>

LLVM IR (-O0):
%struct.network = type { i32 }
@.str = [9 x i8] c"QUIT :%s\00"
@.str.1 = [5 x i8] c"QUIT\00"
define void @irc_quit(%struct.network* %0, i8* %1) {
%3 = alloca %struct.network*
%4 = alloca i8*
store %struct.network* %0, %struct.network** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load %struct.network*, %struct.network** %3
%9 = load i8*, i8** %4
%10 = call i32 (%struct.network*, i8*, ...) @irc_send_raw(%struct.network* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %14
11: ; preds = %2
%12 = load %struct.network*, %struct.network** %3
%13 = call i32 (%struct.network*, i8*, ...) @irc_send_raw(%struct.network* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
%struct.network = type { i32 }
@.str = [9 x i8] c"QUIT :%s\00"
@.str.1 = [5 x i8] c"QUIT\00"
define void @irc_quit(%struct.network* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (%struct.network*, i8*, ...) @irc_send_raw(%struct.network* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
6: ; preds = %2
%7 = tail call i32 (%struct.network*, i8*, ...) @irc_send_raw(%struct.network* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
const char *skip_blanks(const char *p) {
  while (isspace((unsigned char)*p) && *p != '\n')
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skip_blanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     114a <skip_blanks+0x3a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115a <skip_blanks+0x4a>
jmp    116b <skip_blanks+0x5b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_blanks+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_blanks>:
push   %rbx
mov    %rdi,%rbx
movzbl (%rdi),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skip_blanks+0x29>
cmpb   $0xa,(%rbx)
je     1139 <skip_blanks+0x29>
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1120 <skip_blanks+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_blanks(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isspace(i8 zeroext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 10
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @skip_blanks(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isspace(i8 zeroext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %9
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 10
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = tail call i64 @isspace(i8 zeroext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %9, %1
%15 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %5 ]
ret i8* %15
}
void RTTarOpen(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarOpen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void func() {
  int i = 0;
  return;
  bar();
  i = 2;
}


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

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

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

LLVM IR (-O2):
define void @func() {
ret void
}
/* Variables and functions */
float cblas_sasum(int const, float const *, int const);
void acc_sasum_(const int *N, const float *X, const int *incX, float *result) {
  *result = cblas_sasum(*N, X, *incX);
}


x86 assembly (clang, -O0):
<acc_sasum_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <cblas_sasum@plt>
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acc_sasum_>:
push   %rbx
mov    %rcx,%rbx
mov    (%rdi),%edi
mov    (%rdx),%edx
call   1030 <cblas_sasum@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @acc_sasum_(i32* %0, float* %1, i32* %2, float* %3) {
%5 = alloca i32*
%6 = alloca float*
%7 = alloca i32*
%8 = alloca float*
store i32* %0, i32** %5
store float* %1, float** %6
store i32* %2, i32** %7
store float* %3, float** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load float*, float** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
%14 = call float @cblas_sasum(i32 %10, float* %11, i32 %13)
%15 = load float*, float** %8
store float %14, float* %15
ret void
}

LLVM IR (-O2):
define void @acc_sasum_(i32* nocapture %0, float* %1, i32* nocapture %2, float* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = tail call float @cblas_sasum(i32 %5, float* %1, i32 %6)
store float %7, float* %3
ret void
}
void null_doall3(int a, int b, int c) {}


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

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

LLVM IR (-O0):
define void @null_doall3(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
ret void
}

LLVM IR (-O2):
define void @null_doall3(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int strerror_r(int, char *, size_t);
int muggle_socket_strerror(int errnum, char *buf, size_t bufsize) {
  return strerror_r(errnum, buf, bufsize);
}


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

x86 assembly (clang, -O2):
<muggle_socket_strerror>:
jmp    1030 <strerror_r@plt>

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

LLVM IR (-O2):
define i32 @muggle_socket_strerror(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @strerror_r(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
main() {
  int i = 0;
  while (i < 5) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1121 <main+0x21>
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ print_led(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char buf[5 * 32];
  print_led(1234567, buf);
  printf("%s\n", buf);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xa0,%rsp
mov    %rsp,%rbx
mov    $0x12d687,%edi
mov    %rbx,%rsi
call   1040 <print_led@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [160 x i8]
%2 = getelementptr inbounds [160 x i8], [160 x i8]* %1, i64 0, i64 0
%3 = call i32 @print_led(i32 1234567, i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
double
f4_cb_send_pre_double_double_double_double_double_double_double_double_double(
    double (*cb)(double, double, double, double, double, double, double, double,
                 double)) {
  double r = 66.0;
  return cb(8.25, 9.25, 10.25, 11.25, 12.25, 13.25, 14.25, 15.25, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_double_double_double_double_double_double_double_double_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xf34(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm8
movsd  0xedd(%rip),%xmm0
movsd  0xedd(%rip),%xmm1
movsd  0xedd(%rip),%xmm2
movsd  0xedd(%rip),%xmm3
movsd  0xedd(%rip),%xmm4
movsd  0xedd(%rip),%xmm5
movsd  0xedd(%rip),%xmm6
movsd  0xedd(%rip),%xmm7
movsd  %xmm8,(%rsp)
call   *%rax
movsd  0xe8d(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_double_double_double_double_double_double_double_double_double>:
push   %rax
movabs $0x4050800000000000,%rax
80 50 40
mov    %rax,(%rsp)
movsd  0xee9(%rip),%xmm0
movsd  0xee9(%rip),%xmm1
movsd  0xee9(%rip),%xmm2
movsd  0xee9(%rip),%xmm3
movsd  0xee9(%rip),%xmm4
movsd  0xee9(%rip),%xmm5
movsd  0xee9(%rip),%xmm6
movsd  0xee9(%rip),%xmm7
call   *%rdi
addsd  0xee7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_double_double_double_double_double_double_double_double_double(double (double, double, double, double, double, double, double, double, double)* %0) {
%2 = alloca double (double, double, double, double, double, double, double, double, double)*
%3 = alloca double
store double (double, double, double, double, double, double, double, double, double)* %0, double (double, double, double, double, double, double, double, double, double)** %2
store double 6.600000e+01, double* %3
%4 = load double (double, double, double, double, double, double, double, double, double)*, double (double, double, double, double, double, double, double, double, double)** %2
%5 = load double, double* %3
%6 = call double %4(double 8.250000e+00, double 9.250000e+00, double 1.025000e+01, double 1.125000e+01, double 1.225000e+01, double 1.325000e+01, double 1.425000e+01, double 1.525000e+01, double %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_double_double_double_double_double_double_double_double_double(double (double, double, double, double, double, double, double, double, double)* nocapture %0) {
%2 = tail call double %0(double 8.250000e+00, double 9.250000e+00, double 1.025000e+01, double 1.125000e+01, double 1.225000e+01, double 1.325000e+01, double 1.425000e+01, double 1.525000e+01, double 6.600000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
int main() {
  char *a = (char *)0x1000;
  int c = -1, d = 0.0;
  return sizeof(double);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1000,%eax
mov    %rax,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x8,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i8* inttoptr (i64 4096 to i8*), i8** %2
store i32 -1, i32* %3
store i32 0, i32* %4
ret i32 8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ bobCall();
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ timeShift();
void Specification3(void) {
  {
    {
      bobCall();
      timeShift();
      timeShift();
      timeShift();
      timeShift();
      timeShift();
      bobCall();
      cleanup();
    }
    return;
  }
}


x86 assembly (clang, -O0):
<Specification3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bobCall@plt>
mov    $0x0,%al
call   1050 <timeShift@plt>
mov    $0x0,%al
call   1050 <timeShift@plt>
mov    $0x0,%al
call   1050 <timeShift@plt>
mov    $0x0,%al
call   1050 <timeShift@plt>
mov    $0x0,%al
call   1050 <timeShift@plt>
mov    $0x0,%al
call   1030 <bobCall@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Specification3>:
push   %rax
xor    %eax,%eax
call   1030 <bobCall@plt>
xor    %eax,%eax
call   1050 <timeShift@plt>
xor    %eax,%eax
call   1050 <timeShift@plt>
xor    %eax,%eax
call   1050 <timeShift@plt>
xor    %eax,%eax
call   1050 <timeShift@plt>
xor    %eax,%eax
call   1050 <timeShift@plt>
xor    %eax,%eax
call   1030 <bobCall@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cleanup@plt>

LLVM IR (-O0):
define void @Specification3() {
%1 = call i32 (...) @bobCall()
%2 = call i32 (...) @timeShift()
%3 = call i32 (...) @timeShift()
%4 = call i32 (...) @timeShift()
%5 = call i32 (...) @timeShift()
%6 = call i32 (...) @timeShift()
%7 = call i32 (...) @bobCall()
%8 = call i32 (...) @cleanup()
ret void
}

LLVM IR (-O2):
define void @Specification3() {
%1 = tail call i32 (...) @bobCall()
%2 = tail call i32 (...) @timeShift()
%3 = tail call i32 (...) @timeShift()
%4 = tail call i32 (...) @timeShift()
%5 = tail call i32 (...) @timeShift()
%6 = tail call i32 (...) @timeShift()
%7 = tail call i32 (...) @bobCall()
%8 = tail call i32 (...) @cleanup()
ret void
}
/* Variables and functions */
scalar_t__ strstr(char const *, char *);
int is_list_file(const char *path) {
  return strstr(path, "/var/lib/dpkg/info/") && strstr(path, ".list");
}


x86 assembly (clang, -O0):
<is_list_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1158 <is_list_file+0x48>
mov    -0x8(%rbp),%rdi
lea    0xecb(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_list_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
je     1141 <is_list_file+0x31>
lea    0xee8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"/var/lib/dpkg/info/\00"
@.str.1 = [6 x i8] c".list\00"
define i32 @is_list_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strstr(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [20 x i8] c"/var/lib/dpkg/info/\00"
@.str.1 = [6 x i8] c".list\00"
define i32 @is_list_file(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ CERTIFICATEPOLICIES;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ CERTIFICATEPOLICIES_it;
CERTIFICATEPOLICIES *d2i_CERTIFICATEPOLICIES(CERTIFICATEPOLICIES **a,
                                             const unsigned char **in,
                                             long len) {
  return (CERTIFICATEPOLICIES *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                              &CERTIFICATEPOLICIES_it);
}


x86 assembly (clang, -O0):
<d2i_CERTIFICATEPOLICIES>:
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
mov    0x2ea9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_CERTIFICATEPOLICIES>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@CERTIFICATEPOLICIES_it = global i32 0
define i32* @d2i_CERTIFICATEPOLICIES(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @CERTIFICATEPOLICIES_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@CERTIFICATEPOLICIES_it = global i32 0
define i32* @d2i_CERTIFICATEPOLICIES(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @CERTIFICATEPOLICIES_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(int);
void putch(int c) {
  if (c < 32 || c >= 127)
    printf("?");
  else
    putchar(c);
}


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jl     113f <putch+0x1f>
cmpl   $0x7f,-0x4(%rbp)
jl     1150 <putch+0x30>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
jmp    1158 <putch+0x38>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
lea    -0x7f(%rdi),%eax
cmp    $0xffffffa0,%eax
ja     1122 <putch+0x12>
mov    $0x3f,%edi
jmp    1030 <putchar@plt>
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @putch(i32 %0) {
%2 = add i32 %0, -127
%3 = icmp ult i32 %2, -95
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @putchar(i32 63)
br label %8
6: ; preds = %1
%7 = tail call i32 @putchar(i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}
__attribute__((always_)) void sti(void) { asm volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @sti() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SerialWriteString(char *);
void iRobot_PushButton(unsigned short button_bits) {
  char data[] = {165, button_bits};
  SerialWriteString(data);
}


x86 assembly (clang, -O0):
<iRobot_PushButton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movb   $0xa5,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,-0x3(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <SerialWriteString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iRobot_PushButton>:
push   %rax
movb   $0xa5,0x6(%rsp)
mov    %dil,0x7(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <SerialWriteString@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @iRobot_PushButton(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca [2 x i8]
store i16 %0, i16* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 -91, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i16, i16* %2
%7 = trunc i16 %6 to i8
store i8 %7, i8* %5
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%9 = call i32 @SerialWriteString(i8* %8)
ret void
}

LLVM IR (-O2):
define void @iRobot_PushButton(i16 zeroext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 -91, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%5 = trunc i16 %0 to i8
store i8 %5, i8* %4
%6 = call i32 @SerialWriteString(i8* %3)
ret void
}