xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) { fprintf(stderr, "RTFM\n"); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"RTFM\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"RTFM\0A\00"
define void @usage(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int _start() { exit(42); }


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

x86 assembly (clang, -O2):
<_start>:
push   %rax
mov    $0x2a,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @_start() {
%1 = call i32 @exit(i32 42)
unreachable
}

LLVM IR (-O2):
define i32 @_start() {
%1 = tail call i32 @exit(i32 42)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello world!!!\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"hello world!!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned int replicate_11bits_signed_to_16bits(int value) {
  if (value >= 0)
    return (value << 5) | (value >> 5);
  value = -value;
  value = (value << 5) | (value >> 5);
  return -value;
}


x86 assembly (clang, -O0):
<replicate_11bits_signed_to_16bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1127 <replicate_11bits_signed_to_16bits+0x27>
mov    -0x8(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%ecx
sar    $0x5,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <replicate_11bits_signed_to_16bits+0x48>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%ecx
sar    $0x5,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<replicate_11bits_signed_to_16bits>:
mov    %edi,%eax
test   %edi,%edi
js     1111 <replicate_11bits_signed_to_16bits+0x11>
mov    %eax,%ecx
shl    $0x5,%ecx
shr    $0x5,%eax
or     %ecx,%eax
ret
neg    %eax
mov    %eax,%ecx
shl    $0x5,%ecx
shr    $0x5,%eax
or     %ecx,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @replicate_11bits_signed_to_16bits(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = shl i32 %0, 5
%5 = lshr i32 %0, 5
%6 = or i32 %4, %5
br label %13
7: ; preds = %1
%8 = sub nsw i32 0, %0
%9 = shl i32 %8, 5
%10 = lshr i32 %8, 5
%11 = or i32 %9, %10
%12 = sub nsw i32 0, %11
br label %13
13: ; preds = %7, %3
%14 = phi i32 [ %6, %3 ], [ %12, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void perr_exit(const char *s) {
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<perr_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<perr_exit>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @perr_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @perr_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int);
main() { f(-1, 1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 -1, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 -1, i32 1)
ret i32 0
}
void init_noise() {}


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

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

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

LLVM IR (-O2):
define void @init_noise() {
ret void
}
/* Variables and functions */
int is_smark(char);
int is_space_mark(char c) { return (c > 0 && c < 33) ? 1 : is_smark(c); }


x86 assembly (clang, -O0):
<is_space_mark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jle    1145 <is_space_mark+0x35>
movsbl -0x1(%rbp),%eax
cmp    $0x21,%eax
jge    1145 <is_space_mark+0x35>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1151 <is_space_mark+0x41>
movsbl -0x1(%rbp),%edi
call   1030 <is_smark@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space_mark>:
lea    -0x1(%rdi),%eax
cmp    $0x20,%al
jae    111d <is_space_mark+0xd>
mov    $0x1,%eax
ret
movsbl %dil,%edi
jmp    1030 <is_smark@plt>

LLVM IR (-O0):
define i32 @is_space_mark(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %8, 33
br i1 %9, label %10, label %11
10: ; preds = %6
br label %14
11: ; preds = %6, %1
%12 = load i8, i8* %2
%13 = call i32 @is_smark(i8 signext %12)
br label %14
14: ; preds = %11, %10
%15 = phi i32 [ 1, %10 ], [ %13, %11 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @is_space_mark(i8 signext %0) {
%2 = add i8 %0, -1
%3 = icmp ult i8 %2, 32
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @is_smark(i8 signext %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 1, %1 ]
ret i32 %7
}
char *mystrcat(char *dest, char *src) {
  char *ret = dest;
  char *d = dest;
  char *s = src;
  while (*d) {
    d++;
  }
  while (*d++ = *s++)
    ;
  return ret;
}


x86 assembly (clang, -O0):
<mystrcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <mystrcat+0x42>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1124 <mystrcat+0x24>
jmp    1147 <mystrcat+0x47>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%al
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1176 <mystrcat+0x76>
jmp    1147 <mystrcat+0x47>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <mystrcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <mystrcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @mystrcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int dspd_strtoi32(char const *, int /*<<< orphan*/ *, int);
int dspd_strtol(const char *str, long *n, int base) {
  return dspd_strtoi32(str, (int32_t *)n, base);
}


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

x86 assembly (clang, -O2):
<dspd_strtol>:
jmp    1030 <dspd_strtoi32@plt>

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

LLVM IR (-O2):
define i32 @dspd_strtol(i8* %0, i64* %1, i32 %2) {
%4 = bitcast i64* %1 to i32*
%5 = tail call i32 @dspd_strtoi32(i8* %0, i32* %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ do_bt();
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void handler3() {
  write(2, "handler3\n", strlen("handler3\n"));
  do_bt();
}


x86 assembly (clang, -O0):
<handler3>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    $0x2,%edi
lea    0xeb2(%rip),%rsi
call   1030 <write@plt>
mov    $0x0,%al
call   1050 <do_bt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler3>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <do_bt@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"handler3\0A\00"
define void @handler3() {
%1 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write(i32 2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @do_bt()
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"handler3\0A\00"
define void @handler3() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @do_bt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f(char a) {
  char b;
  a = 1;
  b = 2;
  printf("hello\n");
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x1,-0x1(%rbp)
movb   $0x2,-0x2(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @f(i8 signext %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
void reset(char str[], int len) {
  for (int i = 0; i < len; i++)
    str[i] = '\0';
}


x86 assembly (clang, -O0):
<reset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <reset+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <reset+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset>:
test   %esi,%esi
jle    1122 <reset+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @reset(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int Conf1LimpiaBuffer(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
Conf1LimpiaBuf(char *buf) { return (Conf1LimpiaBuffer(buf, strlen(buf))); }


x86 assembly (clang, -O0):
<Conf1LimpiaBuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <Conf1LimpiaBuffer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Conf1LimpiaBuf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <Conf1LimpiaBuffer@plt>

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

LLVM IR (-O2):
define i32 @Conf1LimpiaBuf(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @Conf1LimpiaBuffer(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ random();
void random_non_functional_bad() {
  if (random() != random()) {
    int *p = NULL;
    *p = 42;
  }
}


x86 assembly (clang, -O0):
<random_non_functional_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     114c <random_non_functional_bad+0x3c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_non_functional_bad>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <random@plt>

LLVM IR (-O0):
define void @random_non_functional_bad() {
%1 = alloca i32*
%2 = call i64 (...) @random()
%3 = call i64 (...) @random()
%4 = icmp ne i64 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %0
store i32* null, i32** %1
%6 = load i32*, i32** %1
store i32 42, i32* %6
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @random_non_functional_bad() {
%1 = tail call i64 (...) @random()
%2 = tail call i64 (...) @random()
%3 = icmp eq i64 %1, %2
tail call void @llvm.assume(i1 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ printheader();
int /*<<< orphan*/ system(char *);
void printempmenu() {
  system("clear");
  printheader();
  printf("\n\t\t############\n"
         "\x1b[36m"
         "\t\t| EMPLOYEE |:\n"
         "\t\t############\n\n"
         "\x1b[34m"
         "\t\t\t1] Add a record of new employee/doctor\n\n"
         "\t\t\t2] Edit existing record\n\n"
         "\t\t\t3] Display record of particular employee/doctor\n\n"
         "\t\t\t4] List of all registered employee\n\n"
         "\t\t\t5] Close the enrollment of employee\n\n"
         "\t\t\t6] Return to main menu\n"
         "\x1b[0m");
}


x86 assembly (clang, -O0):
<printempmenu>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1050 <printheader@plt>
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printempmenu>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
call   1050 <printheader@plt>
lea    0xebb(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [291 x i8] c"\0A\09\09############\0A\1B[36m\09\09| EMPLOYEE |:\0A\09\09############\0A\0A\1B[34m\09\09\091] Add a record of new employee/doctor\0A\0A\09\09\092] Edit existing record\0A\0A\09\09\093] Display record of particular employee/doctor\0A\0A\09\09\094] List of all registered employee\0A\0A\09\09\095] Close the enrollment of employee\0A\0A\09\09\096] Return to main menu\0A\1B[0m\00"
define void @printempmenu() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @printheader()
%3 = call i32 @printf(i8* getelementptr inbounds ([291 x i8], [291 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [291 x i8] c"\0A\09\09############\0A\1B[36m\09\09| EMPLOYEE |:\0A\09\09############\0A\0A\1B[34m\09\09\091] Add a record of new employee/doctor\0A\0A\09\09\092] Edit existing record\0A\0A\09\09\093] Display record of particular employee/doctor\0A\0A\09\09\094] List of all registered employee\0A\0A\09\09\095] Close the enrollment of employee\0A\0A\09\09\096] Return to main menu\0A\1B[0m\00"
define void @printempmenu() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @printheader()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([291 x i8], [291 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t __simplePNG__final_deflate_block_size(size_t size) {
  size_t def_final_block_size = size % 0xffff;
  return def_final_block_size;
}


x86 assembly (clang, -O0):
<__simplePNG__final_deflate_block_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xffff,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__simplePNG__final_deflate_block_size>:
movabs $0x8000800080008001,%rcx
mov    %rdi,%rax
mul    %rcx
shr    $0xf,%rdx
mov    %rdx,%rax
shl    $0x10,%rax
sub    %rax,%rdx
lea    (%rdx,%rdi,1),%rax
ret

LLVM IR (-O0):
define i64 @__simplePNG__final_deflate_block_size(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = urem i64 %4, 65535
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @__simplePNG__final_deflate_block_size(i64 %0) {
%2 = urem i64 %0, 65535
ret i64 %2
}
const char *osurandom_get_implementation(void) { return "/dev/urandom"; }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/urandom\00"
define i8* @osurandom_get_implementation() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
define i8* @osurandom_get_implementation() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
int template_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @template_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @template_init() {
ret i32 0
}
ISR(INT0_vect) {
  DEBUG("ISR "
        "INT0"
        " occured");
}


x86 assembly (clang, -O0):
<ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ISR INT0 occured\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [17 x i8] c"ISR INT0 occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void testaPID(pid_t *pid) {
  if (*pid < 0) {
    fprintf(stderr, "Erro ao criar processo\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<testaPID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jge    1159 <testaPID+0x39>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testaPID>:
push   %rax
cmpq   $0x0,(%rdi)
js     1129 <testaPID+0x9>
pop    %rax
ret
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Erro ao criar processo\0A\00"
define void @testaPID(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
int system(const char *command) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @system(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a = 1;
  switch (a) {
  case 1:
    a = 4;
    break;
  case 2:
    a = 2;
    break;
  case 3:
    a = 3;
    break;
  case 4:
  case 5:
    a = 8;
    break;
  default:
    a = 3;
  }
  test_assert(a == 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     117f <main+0x6f>
mov    -0x10(%rbp),%rax
lea    0xeba(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x4,-0x8(%rbp)
jmp    1186 <main+0x76>
movl   $0x2,-0x8(%rbp)
jmp    1186 <main+0x76>
movl   $0x3,-0x8(%rbp)
jmp    1186 <main+0x76>
movl   $0x8,-0x8(%rbp)
jmp    1186 <main+0x76>
movl   $0x3,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 1, label %4
i32 2, label %5
i32 3, label %6
i32 4, label %7
i32 5, label %7
]
4: ; preds = %0
store i32 4, i32* %2
br label %9
5: ; preds = %0
store i32 2, i32* %2
br label %9
6: ; preds = %0
store i32 3, i32* %2
br label %9
7: ; preds = %0, %0
store i32 8, i32* %2
br label %9
8: ; preds = %0
store i32 3, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5, %4
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 4
%12 = zext i1 %11 to i32
%13 = call i32 @test_assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
/* Variables and functions */
void *memmove(void *, void const *, size_t);
void *__wrap_memcpy(void *dest, const void *src, size_t n) {
  return memmove(dest, src, n);
}


x86 assembly (clang, -O0):
<__wrap_memcpy>:
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    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memmove@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_memcpy>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define i8* @__wrap_memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
long DiagFlen(int iHandle) { return (-1); }


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

x86 assembly (clang, -O2):
<DiagFlen>:
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @DiagFlen(i32 %0) {
ret i64 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xc6() {
  Assert_real((isascii(198) == 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_isascii.c",
              995, ("isascii should be 0 for 0xc6"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xc6>:
push   %rax
mov    $0xc6,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3e3,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xc6\00"
define void @t_isascii_0xc6() {
%1 = call i64 @isascii(i32 198)
%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 995, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xc6\00"
define void @t_isascii_0xc6() {
%1 = tail call i64 @isascii(i32 198)
%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 995, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void next(const char **input) { ++*input; }


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
addq   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @next(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %3, i8** %0
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XKeyReleasedEvent;

/* Variables and functions */
void set_XKeyReleasedEvent_window(void *_p, unsigned long _v) {
  ((XKeyReleasedEvent *)_p)->window = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XKeyReleasedEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int qwerty(int i) {
  switch (i) {
  case 1:
    return 'q';
  case 2:
    return 'w';
  case 3:
    return 'e';
  case 4:
    return 'r';
  case 5:
    return 't';
  case 6:
    return 'y';
  }
}


x86 assembly (clang, -O0):
<qwerty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1173 <qwerty+0x73>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x71,-0x4(%rbp)
jmp    1173 <qwerty+0x73>
movl   $0x77,-0x4(%rbp)
jmp    1173 <qwerty+0x73>
movl   $0x65,-0x4(%rbp)
jmp    1173 <qwerty+0x73>
movl   $0x72,-0x4(%rbp)
jmp    1173 <qwerty+0x73>
movl   $0x74,-0x4(%rbp)
jmp    1173 <qwerty+0x73>
movl   $0x79,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qwerty>:
add    $0xfffffffe,%edi
mov    $0x71,%eax
cmp    $0x4,%edi
ja     111a <qwerty+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @qwerty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
i32 6, label %10
]
5: ; preds = %1
store i32 113, i32* %2
br label %11
6: ; preds = %1
store i32 119, i32* %2
br label %11
7: ; preds = %1
store i32 101, i32* %2
br label %11
8: ; preds = %1
store i32 114, i32* %2
br label %11
9: ; preds = %1
store i32 116, i32* %2
br label %11
10: ; preds = %1
store i32 121, i32* %2
br label %11
11: ; preds = %5, %6, %7, %8, %9, %10, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@switch.table.qwerty = [5 x i32] [i32 119, i32 101, i32 114, i32 116, i32 121]
define i32 @qwerty(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 5
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.qwerty, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 113, %1 ], [ %7, %4 ]
ret i32 %9
}
void media_device_delete(struct media_device *mdev, const char *module_name,
                         struct module *owner) {}


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

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

LLVM IR (-O0):
%struct.media_device = type opaque
%struct.module = type opaque
define void @media_device_delete(%struct.media_device* %0, i8* %1, %struct.module* %2) {
%4 = alloca %struct.media_device*
%5 = alloca i8*
%6 = alloca %struct.module*
store %struct.media_device* %0, %struct.media_device** %4
store i8* %1, i8** %5
store %struct.module* %2, %struct.module** %6
ret void
}

LLVM IR (-O2):
%struct.media_device = type opaque
%struct.module = type opaque
define void @media_device_delete(%struct.media_device* nocapture %0, i8* nocapture %1, %struct.module* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ enter_panic(int);
void *memalloc(int /*<<< orphan*/);
void *xmemalloc(uint16_t size) {
  void *mem = memalloc(size);
  if (mem)
    return mem;
  enter_panic(0x02);
}


x86 assembly (clang, -O0):
<xmemalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <memalloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114f <xmemalloc+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <xmemalloc+0x39>
mov    $0x2,%edi
call   1040 <enter_panic@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmemalloc>:
push   %rbx
call   1030 <memalloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1138 <xmemalloc+0x18>
mov    $0x2,%edi
call   1040 <enter_panic@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @xmemalloc(i32 %0) {
%2 = tail call i8* @memalloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @enter_panic(i32 2)
br label %6
6: ; preds = %1, %4
ret i8* %2
}
int test_imm_99uint16_reg(unsigned short val) {
  return ((val) & (0x99 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_99uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x99,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_99uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 153
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int isatty(int desc) {
  _exit(-1);
  return 0;
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<isatty>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @isatty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
%2 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
isdelim(char c) {
  if (strchr(" !;,+-<>'/*%^=()", c) || c == 9 || c == '\r' || c == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isdelim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    115f <isdelim+0x4f>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     115f <isdelim+0x4f>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
je     115f <isdelim+0x4f>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    116b <isdelim+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1172 <isdelim+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdelim>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1130 <isdelim+0x20>
pop    %rbx
ret
cmp    $0xd,%bl
ja     1143 <isdelim+0x33>
movzbl %bl,%ecx
mov    $0x2201,%edx
bt     %rcx,%rdx
jb     112e <isdelim+0x1e>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c" !;,+-<>'/*%^=()\00"
define i32 @isdelim(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @strchr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br i1 %10, label %19, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 13
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15, %11, %7, %1
store i32 1, i32* %2
br label %21
20: ; preds = %15
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@.str = [17 x i8] c" !;,+-<>'/*%^=()\00"
define i32 @isdelim(i8 signext %0) {
%2 = tail call i64 @strchr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
switch i8 %0, label %6 [
i8 13, label %7
i8 9, label %7
i8 0, label %7
]
6: ; preds = %5
br label %7
7: ; preds = %1, %5, %5, %5, %6
%8 = phi i32 [ 0, %6 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ], [ 1, %1 ]
ret i32 %8
}
int __double_encoded_array_size(const double *p, int elements) {
  return sizeof(double) * elements;
}


x86 assembly (clang, -O0):
<__double_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__double_encoded_array_size>:
lea    0x0(,%rsi,8),%eax
ret

LLVM IR (-O0):
define i32 @__double_encoded_array_size(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = mul i64 8, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @__double_encoded_array_size(double* nocapture readnone %0, i32 %1) {
%3 = shl i32 %1, 3
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stdout;
void move_cursor_to_column(int count) {
  char buffer[10];
  memset(buffer, 0, sizeof(buffer));
  sprintf(buffer, "\033[%dG", count);
  fputs(buffer, stdout);
}


x86 assembly (clang, -O0):
<move_cursor_to_column>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xea7(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0xe(%rbp),%rdi
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_cursor_to_column>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
lea    0xe(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
lea    0xeac(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
call   1050 <sprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <fputs@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dG\00"
@stdout = global i32 0
define void @move_cursor_to_column(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 10)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* @stdout
%11 = call i32 @fputs(i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dG\00"
@stdout = global i32 0
define void @move_cursor_to_column(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 10)
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = load i32, i32* @stdout
%7 = call i32 @fputs(i8* %3, i32 %6)
ret void
}
float CPU_time(void) {
  static float time;
  time += 0.0001;
  return (float)time;
}


x86 assembly (clang, -O0):
<CPU_time>:
push   %rbp
mov    %rsp,%rbp
movss  0x2f18(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x2efc(%rip)
movss  0x2ef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPU_time>:
movss  0x2f1c(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xeec(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x2f04(%rip)
ret

LLVM IR (-O0):
@CPU_time.time = internal global float 0.000000e+00
define float @CPU_time() {
%1 = load float, float* @CPU_time.time
%2 = fpext float %1 to double
%3 = fadd double %2, 1.000000e-04
%4 = fptrunc double %3 to float
store float %4, float* @CPU_time.time
%5 = load float, float* @CPU_time.time
ret float %5
}

LLVM IR (-O2):
@CPU_time.time = internal unnamed_addr global float 0.000000e+00
define float @CPU_time() {
%1 = load float, float* @CPU_time.time
%2 = fpext float %1 to double
%3 = fadd double %2, 1.000000e-04
%4 = fptrunc double %3 to float
store float %4, float* @CPU_time.time
ret float %4
}
main() { int f(); }


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

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

LLVM IR (-O0):
define i32 @main() {
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void errorCheck(int value, char *errorMessage) {
  if (value == -1) {
    fprintf(stderr, "Error: %s with %d\n", errorMessage, value);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<errorCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1163 <errorCheck+0x43>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorCheck>:
cmp    $0xffffffff,%edi
je     1126 <errorCheck+0x6>
ret
push   %rax
mov    %rsi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
mov    $0xffffffff,%ecx
call   1030 <fprintf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Error: %s with %d\0A\00"
@EXIT_FAILURE = global i32 0
define void @errorCheck(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 = icmp eq i32 %5, -1
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %4
%10 = load i32, i32* %3
%11 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Error: %s with %d\0A\00"
@EXIT_FAILURE = global i32 0
define void @errorCheck(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1, i32 -1)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}