xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_warning_header() {
  printf("\n!!!!!!!!! W A R N I N G !!!!!!!!!\n\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"\0A!!!!!!!!! W A R N I N G !!!!!!!!!\0A\0A\00"
define void @print_warning_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"\0A!!!!!!!!! W A R N I N G !!!!!!!!!\0A\00"
define void @print_warning_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
int calcutate(int index) {
  int a = (index * 32) & 128;
  return a;
}


x86 assembly (clang, -O0):
<calcutate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
and    $0x80,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcutate>:
mov    %edi,%eax
and    $0x4,%eax
shl    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @calcutate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 32
%6 = and i32 %5, 128
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @calcutate(i32 %0) {
%2 = shl nsw i32 %0, 5
%3 = and i32 %2, 128
ret i32 %3
}
/* Type definitions */
struct Queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Queue *);
void freeQueue(struct Queue *q) { free(q); }


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

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

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

LLVM IR (-O2):
%struct.Queue = type { i32 }
define void @freeQueue(%struct.Queue* nocapture %0) {
%2 = tail call i32 @free(%struct.Queue* %0)
ret void
}
const char *pathconN_nm6_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathconN_nm6_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <pathconN_nm6_name_out+0x2b>
jmp    111a <pathconN_nm6_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <pathconN_nm6_name_out+0x3b>
jmp    114b <pathconN_nm6_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathconN_nm6_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathconN_nm6_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm6_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathconN_nm6_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, unsigned char *, int);
unsigned int U4(unsigned char *p) {
  unsigned int u = 0;
  memcpy(&u, p, 4);
  return u;
}


x86 assembly (clang, -O0):
<U4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U4>:
push   %rax
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @U4(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
OP(fd, cd) {
  illegal_1();
  op_cd();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_cd@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_cd@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_cd()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_cd()
ret i32 undef
}
unsigned short MAKEWORD(unsigned char a, unsigned char b) {
  return ((unsigned short)a << 8) | b;
}


x86 assembly (clang, -O0):
<MAKEWORD>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzwl %ax,%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAKEWORD>:
shl    $0x8,%edi
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define zeroext i16 @MAKEWORD(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i16
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = or i32 %8, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @MAKEWORD(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i16
%4 = shl nuw i16 %3, 8
%5 = zext i8 %1 to i16
%6 = or i16 %4, %5
ret i16 %6
}
int is_prime(int n) {
  int c;
  for (c = 2; c <= n - 1; c++) {
    if (n % c == 0)
      return 0;
  }
  if (c == n)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     114e <is_prime+0x4e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113b <is_prime+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    116d <is_prime+0x6d>
jmp    1140 <is_prime+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1166 <is_prime+0x66>
movl   $0x1,-0x4(%rbp)
jmp    116d <is_prime+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x2,%ecx
cmp    $0x3,%edi
jl     1122 <is_prime+0x22>
mov    $0x2,%ecx
nop
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     112a <is_prime+0x2a>
add    $0x1,%ecx
cmp    %ecx,%edi
jne    1110 <is_prime+0x10>
mov    %edi,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ 2, %1 ]
%5 = srem i32 %0, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %7, %1
%11 = phi i32 [ 2, %1 ], [ %0, %7 ]
%12 = icmp eq i32 %11, %0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %3, %10
%15 = phi i32 [ %13, %10 ], [ 0, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *,
                         char const *const);
int unlink(char const *const);
void p_file_remove(const char *const filename) {
  if (unlink(filename) == -1) {
    error(EXIT_FAILURE, errno, "unlink(file=[%s])", filename);
  }
}


x86 assembly (clang, -O0):
<p_file_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
jne    1160 <p_file_remove+0x40>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
lea    0xea5(%rip),%rdx
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_file_remove>:
push   %rbx
mov    %rdi,%rbx
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
je     1130 <p_file_remove+0x10>
pop    %rbx
ret
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xeb7(%rip),%rdx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <error@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [18 x i8] c"unlink(file=[%s])\00"
define void @p_file_remove(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @unlink(i8* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @EXIT_FAILURE
%8 = load i32, i32* @errno
%9 = load i8*, i8** %2
%10 = call i32 @error(i32 %7, i32 %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [18 x i8] c"unlink(file=[%s])\00"
define void @p_file_remove(i8* %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @errno
%7 = tail call i32 @error(i32 %5, i32 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %4, %1
ret void
}
int islop(char c) { return (c == '<' || c == '>' || c == '='); }


x86 assembly (clang, -O0):
<islop>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3c,%ecx
mov    %al,-0x2(%rbp)
je     113b <islop+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3e,%ecx
mov    %al,-0x2(%rbp)
je     113b <islop+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x3d,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islop>:
mov    %edi,%eax
and    $0xfd,%al
cmp    $0x3c,%al
sete   %al
cmp    $0x3d,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @islop(i8 signext %0) {
%2 = and i8 %0, -3
%3 = icmp eq i8 %2, 60
%4 = icmp eq i8 %0, 61
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printnum(int);
void f() { printnum(9); }


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

x86 assembly (clang, -O2):
<f>:
mov    $0x9,%edi
jmp    1030 <printnum@plt>

LLVM IR (-O0):
define void @f() {
%1 = call i32 @printnum(i32 9)
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 @printnum(i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void copyright(void) {
  fprintf(stderr, "\n Written by: Gerald Tamayo, 2004/2009\n");
}


x86 assembly (clang, -O0):
<copyright>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyright>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"\0A Written by: Gerald Tamayo, 2004/2009\0A\00"
define void @copyright() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"\0A Written by: Gerald Tamayo, 2004/2009\0A\00"
define void @copyright() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int f11(unsigned int x, int y __attribute__((unused))) {
  return (x << 1) | (x >> ((-1) & (8 * sizeof(unsigned int) - 1)));
}


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f11>:
mov    %edi,%eax
rol    %eax
ret

LLVM IR (-O0):
define i32 @f11(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = shl i32 %5, 1
%7 = load i32, i32* %3
%8 = lshr i32 %7, 31
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f11(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void OnInvalidInputHandler(void) { puts("Input invalid. Please try again."); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Input invalid. Please try again.\00"
define void @OnInvalidInputHandler() {
%1 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Input invalid. Please try again.\00"
define void @OnInvalidInputHandler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char argv0[]) { printf("Usage: %s <device>", argv0); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Usage: %s <device>\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Usage: %s <device>\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int fun904() { return 904; }


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

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

LLVM IR (-O0):
define i32 @fun904() {
ret i32 904
}

LLVM IR (-O2):
define i32 @fun904() {
ret i32 904
}
/* Variables and functions */
int partition(int *, int, int);
void quickSort(int A[], int minIndex, int maxIndex) {
  if (minIndex < maxIndex) {
    int pivotIndex = partition(A, minIndex, maxIndex);
    quickSort(A, minIndex, pivotIndex - 1);
    quickSort(A, pivotIndex + 1, maxIndex);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ max_maps;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
int get_Screen_max_maps(void *_p) { return (int)((Screen *)_p)->max_maps; }


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

x86 assembly (clang, -O2):
<get_Screen_max_maps>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_Screen_max_maps(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
unsigned int s5p_get_apll(unsigned long pllval, unsigned long baseclk) {
  unsigned long mdiv, pdiv, sdiv;
  baseclk /= 1000;
  mdiv = (pllval & (0x3ff << 16)) >> 16;
  pdiv = (pllval & (0x3f << 8)) >> 8;
  sdiv = (pllval & (0x03 << 0)) >> 0;
  return (baseclk * (mdiv)) / ((pdiv) << sdiv) * 1000;
}


x86 assembly (clang, -O0):
<s5p_get_apll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3ff0000,%rax
shr    $0x10,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3f00,%rax
shr    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3,%rax
shr    $0x0,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
shl    %cl,%rdx
mov    %rdx,%rcx
xor    %edx,%edx
div    %rcx
imul   $0x3e8,%rax,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s5p_get_apll>:
mov    %rsi,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
mov    %rdi,%rcx
shr    $0x4,%rdx
mov    %ecx,%eax
shr    $0x10,%eax
and    $0x3ff,%eax
imul   %rdx,%rax
mov    %ecx,%esi
shr    $0x8,%esi
and    $0x3f,%esi
and    $0x3,%cl
shl    %cl,%rsi
mov    %rax,%rcx
shr    $0x20,%rcx
je     114c <s5p_get_apll+0x4c>
xor    %edx,%edx
div    %rsi
imul   $0x3e8,%eax,%eax
ret
xor    %edx,%edx
div    %esi
imul   $0x3e8,%eax,%eax
ret

LLVM IR (-O0):
define i32 @s5p_get_apll(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%8 = load i64, i64* %4
%9 = udiv i64 %8, 1000
store i64 %9, i64* %4
%10 = load i64, i64* %3
%11 = and i64 %10, 67043328
%12 = lshr i64 %11, 16
store i64 %12, i64* %5
%13 = load i64, i64* %3
%14 = and i64 %13, 16128
%15 = lshr i64 %14, 8
store i64 %15, i64* %6
%16 = load i64, i64* %3
%17 = and i64 %16, 3
%18 = lshr i64 %17, 0
store i64 %18, i64* %7
%19 = load i64, i64* %4
%20 = load i64, i64* %5
%21 = mul i64 %19, %20
%22 = load i64, i64* %6
%23 = load i64, i64* %7
%24 = shl i64 %22, %23
%25 = udiv i64 %21, %24
%26 = mul i64 %25, 1000
%27 = trunc i64 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @s5p_get_apll(i64 %0, i64 %1) {
%3 = udiv i64 %1, 1000
%4 = lshr i64 %0, 16
%5 = and i64 %4, 1023
%6 = lshr i64 %0, 8
%7 = and i64 %6, 63
%8 = and i64 %0, 3
%9 = mul i64 %3, %5
%10 = shl nuw nsw i64 %7, %8
%11 = udiv i64 %9, %10
%12 = trunc i64 %11 to i32
%13 = mul i32 %12, 1000
ret i32 %13
}
float test1(float x) {
  float t;
  t = x;
  t += 2;
  x = t;
  return x;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xee5(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
addss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @test1(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
store float %4, float* %3
%5 = load float, float* %3
%6 = fadd float %5, 2.000000e+00
store float %6, float* %3
%7 = load float, float* %3
store float %7, float* %2
%8 = load float, float* %2
ret float %8
}

LLVM IR (-O2):
define float @test1(float %0) {
%2 = fadd float %0, 2.000000e+00
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int __serialize_uint8(uint8_t *out, int out_sz, uint8_t n) {
  if (out_sz < 1)
    return (-1);
  out[0] = n;
  return (out_sz - 1);
}


x86 assembly (clang, -O0):
<__serialize_uint8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x1,-0x14(%rbp)
jge    1124 <__serialize_uint8+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1136 <__serialize_uint8+0x36>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__serialize_uint8>:
test   %esi,%esi
jle    110c <__serialize_uint8+0xc>
mov    %esi,%eax
mov    %edx,(%rdi)
add    $0xffffffff,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @__serialize_uint8(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, 1
br i1 %4, label %7, label %5
5: ; preds = %3
store i32 %2, i32* %0
%6 = add nsw i32 %1, -1
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ -1, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xc3() {
  Assert_real((iscntrl(195) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              980, ("iscntrl should be 0 for 0xc3"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0xc3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc3,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3d4,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0xc3>:
push   %rax
mov    $0xc3,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3d4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xc3\00"
define void @t_iscntrl_0xc3() {
%1 = call i64 @iscntrl(i32 195)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 980, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xc3\00"
define void @t_iscntrl_0xc3() {
%1 = tail call i64 @iscntrl(i32 195)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 980, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void createFile(char *nameFile) {
  FILE *fd;
  fd = fopen(nameFile, "wt");
  fclose(fd);
}


x86 assembly (clang, -O0):
<createFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createFile>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"wt\00"
define void @createFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fclose(i32* %6)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"wt\00"
define void @createFile(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fclose(i32* %2)
ret void
}
const char *get_psy_version(void) {
  static const char *const str = "0"
                                 "."
                                 "89";
  return str;
}


x86 assembly (clang, -O0):
<get_psy_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_psy_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@get_psy_version.str = internal constant i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0)
@.str = [5 x i8] c"0.89\00"
define i8* @get_psy_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"0.89\00"
define i8* @get_psy_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_idxset_next() {
  printf("NOT IMPLEMENTED:"
         "pa_idxset_next"
         "\n");
}


x86 assembly (clang, -O0):
<pa_idxset_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_idxset_next\0A\00"
define i32 @pa_idxset_next() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_idxset_next\00"
define i32 @pa_idxset_next() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ecfpECFP_BSIZE_multiply(double *, double const *,
                                           double const *);
void ecfpECFP_BSIZE_square(double *r, const double *x) {
  ecfpECFP_BSIZE_multiply(r, x, x);
}


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

x86 assembly (clang, -O2):
<ecfpECFP_BSIZE_square>:
mov    %rsi,%rdx
jmp    1030 <ecfpECFP_BSIZE_multiply@plt>

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

LLVM IR (-O2):
define void @ecfpECFP_BSIZE_square(double* %0, double* %1) {
%3 = tail call i32 @ecfpECFP_BSIZE_multiply(double* %0, double* %1, double* %1)
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
scalar_t__ write(int, void const *, size_t);
ssize_t write_nointr(int fd, const void *buf, size_t count) {
  ssize_t ret;
again:
  ret = write(fd, buf, count);
  if (ret < 0 && errno == EINTR)
    goto again;
  return ret;
}


x86 assembly (clang, -O0):
<write_nointr>:
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 <write@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    1161 <write_nointr+0x51>
mov    0x2e97(%rip),%rax
mov    (%rax),%rax
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%rax
jne    1161 <write_nointr+0x51>
jmp    1123 <write_nointr+0x13>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_nointr>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <write@plt>
test   %rax,%rax
jns    114b <write_nointr+0x3b>
mov    (%r15),%rcx
cmp    (%r12),%rcx
je     1130 <write_nointr+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i64 @write_nointr(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i64 @write(i32 %0, i8* %1, i64 %2)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %7, %4
ret i64 %5
}
/* Variables and functions */
scalar_t__ isalnum(char);
void trim(char *str) {
  char *c;
  for (c = str; isalnum(*c); c++) {
  }
  *c = '\0';
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
je     1150 <trim+0x40>
jmp    113f <trim+0x2f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <trim+0x14>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <isalnum@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <trim+0x10>
movb   $0x0,-0x1(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @trim(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isalnum(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
store i8 0, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core6_print(char *, char const *);
void U_EMRPOLYLINE16_print(const char *contents) {
  core6_print("U_EMRPOLYLINE16", contents);
}


x86 assembly (clang, -O0):
<U_EMRPOLYLINE16_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <core6_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRPOLYLINE16_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <core6_print@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"U_EMRPOLYLINE16\00"
define void @U_EMRPOLYLINE16_print(i8* %0) {
%2 = tail call i32 @core6_print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int reverse_bits(int n) {
  int m = 0;
  for (int i = 0; i < sizeof(int) * 8; i++) {
    if ((n >> i) & 1) {
      m = m | (1 << (((sizeof(int) * 8) - 1) - i));
    }
  }
  return m;
}


x86 assembly (clang, -O0):
<reverse_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x20,%rax
jae    1167 <reverse_bits+0x67>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1154 <reverse_bits+0x54>
mov    -0x8(%rbp),%eax
movslq -0xc(%rbp),%rdx
mov    $0x1f,%ecx
sub    %rdx,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <reverse_bits+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <reverse_bits+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_bits>:
xor    %r8d,%r8d
xor    %edx,%edx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    $0x80000000,%esi
mov    %edx,%ecx
shr    %cl,%esi
bt     %edx,%edi
cmovae %r8d,%esi
or     %eax,%esi
lea    0x1(%rdx),%eax
movzbl %al,%ecx
mov    $0x80000000,%eax
shr    %cl,%eax
bt     %ecx,%edi
cmovae %r8d,%eax
or     %esi,%eax
add    $0x2,%edx
cmp    $0x20,%edx
jne    1110 <reverse_bits+0x10>
ret

LLVM IR (-O0):
define i32 @reverse_bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 32
br i1 %8, label %9, label %27
9: ; preds = %5
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = ashr i32 %10, %11
%13 = and i32 %12, 1
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %9
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = sub i64 31, %18
%20 = trunc i64 %19 to i32
%21 = shl i32 1, %20
%22 = or i32 %16, %21
store i32 %22, i32* %3
br label %23
23: ; preds = %15, %9
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %5
27: ; preds = %5
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @reverse_bits(i32 %0) {
br label %3
2: ; preds = %3
ret i32 %18
3: ; preds = %3, %1
%4 = phi i32 [ 0, %1 ], [ %19, %3 ]
%5 = phi i32 [ 0, %1 ], [ %18, %3 ]
%6 = shl nuw i32 1, %4
%7 = and i32 %6, %0
%8 = icmp eq i32 %7, 0
%9 = lshr i32 -2147483648, %4
%10 = select i1 %8, i32 0, i32 %9
%11 = or i32 %10, %5
%12 = or i32 %4, 1
%13 = shl nuw i32 1, %12
%14 = and i32 %13, %0
%15 = icmp eq i32 %14, 0
%16 = lshr i32 -2147483648, %12
%17 = select i1 %15, i32 0, i32 %16
%18 = or i32 %17, %11
%19 = add nuw nsw i32 %4, 2
%20 = icmp eq i32 %19, 32
br i1 %20, label %2, label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void byteswap32(uint32_t *v) {
  union {
    uint32_t w;
    uint8_t b[4];
  } x, y;
  x.w = *v;
  y.b[0] = x.b[3];
  y.b[1] = x.b[2];
  y.b[2] = x.b[1];
  y.b[3] = x.b[0];
  *v = y.w;
  x.w = y.w = 0;
}


x86 assembly (clang, -O0):
<byteswap32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteswap32>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
%union.anon = type { i64, [8 x i8] }
define void @byteswap32(i64* %0) {
%2 = alloca i64*
%3 = alloca %union.anon
%4 = alloca %union.anon
store i64* %0, i64** %2
%5 = load i64*, i64** %2
%6 = load i64, i64* %5
%7 = bitcast %union.anon* %3 to i64*
store i64 %6, i64* %7
%8 = bitcast %union.anon* %3 to [4 x i32]*
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 3
%10 = load i32, i32* %9
%11 = bitcast %union.anon* %4 to [4 x i32]*
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 0
store i32 %10, i32* %12
%13 = bitcast %union.anon* %3 to [4 x i32]*
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 2
%15 = load i32, i32* %14
%16 = bitcast %union.anon* %4 to [4 x i32]*
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %16, i64 0, i64 1
store i32 %15, i32* %17
%18 = bitcast %union.anon* %3 to [4 x i32]*
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %18, i64 0, i64 1
%20 = load i32, i32* %19
%21 = bitcast %union.anon* %4 to [4 x i32]*
%22 = getelementptr inbounds [4 x i32], [4 x i32]* %21, i64 0, i64 2
store i32 %20, i32* %22
%23 = bitcast %union.anon* %3 to [4 x i32]*
%24 = getelementptr inbounds [4 x i32], [4 x i32]* %23, i64 0, i64 0
%25 = load i32, i32* %24
%26 = bitcast %union.anon* %4 to [4 x i32]*
%27 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 3
store i32 %25, i32* %27
%28 = bitcast %union.anon* %4 to i64*
%29 = load i64, i64* %28
%30 = load i64*, i64** %2
store i64 %29, i64* %30
%31 = bitcast %union.anon* %4 to i64*
store i64 0, i64* %31
%32 = bitcast %union.anon* %3 to i64*
store i64 0, i64* %32
ret void
}

LLVM IR (-O2):
define void @byteswap32(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
int main(int argc, const char *argv[]) {
  foo(L"This is some text");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i32] [i32 84, i32 104, i32 105, i32 115, i32 32, i32 105, i32 115, i32 32, i32 115, i32 111, i32 109, i32 101, i32 32, i32 116, i32 101, i32 120, i32 116, i32 0]
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 @foo(i8* bitcast ([18 x i32]* @.str to i8*))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i32] [i32 84, i32 104, i32 105, i32 115, i32 32, i32 105, i32 115, i32 32, i32 115, i32 111, i32 109, i32 101, i32 32, i32 116, i32 101, i32 120, i32 116, i32 0]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i8* bitcast ([18 x i32]* @.str to i8*))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_printout();
int /*<<< orphan*/ mc_autoprint(int);
int /*<<< orphan*/ setup_printout(char const *, int, char *);
int /*<<< orphan*/ test_printout();
int tst_autoprint(const char *the_title) {
  setup_printout(the_title, (1), "scrolling region");
  mc_autoprint((1));
  test_printout();
  mc_autoprint((0));
  cleanup_printout();
  return 1;
}


x86 assembly (clang, -O0):
<tst_autoprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
lea    0xea4(%rip),%rdx
call   1040 <setup_printout@plt>
mov    $0x1,%edi
call   1030 <mc_autoprint@plt>
mov    $0x0,%al
call   1060 <test_printout@plt>
xor    %edi,%edi
call   1030 <mc_autoprint@plt>
mov    $0x0,%al
call   1050 <cleanup_printout@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_autoprint>:
push   %rax
lea    0xeb8(%rip),%rdx
mov    $0x1,%esi
call   1040 <setup_printout@plt>
mov    $0x1,%edi
call   1030 <mc_autoprint@plt>
xor    %eax,%eax
call   1060 <test_printout@plt>
xor    %edi,%edi
call   1030 <mc_autoprint@plt>
xor    %eax,%eax
call   1050 <cleanup_printout@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"scrolling region\00"
define i32 @tst_autoprint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @setup_printout(i8* %3, i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @mc_autoprint(i32 1)
%6 = call i32 (...) @test_printout()
%7 = call i32 @mc_autoprint(i32 0)
%8 = call i32 (...) @cleanup_printout()
ret i32 1
}

LLVM IR (-O2):
@.str = [17 x i8] c"scrolling region\00"
define i32 @tst_autoprint(i8* %0) {
%2 = tail call i32 @setup_printout(i8* %0, i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @mc_autoprint(i32 1)
%4 = tail call i32 (...) @test_printout()
%5 = tail call i32 @mc_autoprint(i32 0)
%6 = tail call i32 (...) @cleanup_printout()
ret i32 1
}
void os_trace_api_ret(unsigned id) {}


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

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

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

LLVM IR (-O2):
define void @os_trace_api_ret(i32 %0) {
ret void
}
void mismatched_before_winapi(int x) {}


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

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

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

LLVM IR (-O2):
define void @mismatched_before_winapi(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ crypt1_test();
int main() {
  crypt1_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @crypt1_test()
ret i32 0
}