xunge/DecIR huggingface dataset:
int cpuid_edx(int op) {
  int rax, rcx, rdx;
  __asm__("pushq %%rbx\n\tcpuid\n\tpopq %%rbx"
          : "=a"(rax), "=c"(rcx), "=d"(rdx)
          : "a"(op));
  return rdx;
}


x86 assembly (clang, -O0):
<cpuid_edx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
push   %rbx
cpuid
pop    %rbx
mov    %eax,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_edx>:
mov    %edi,%eax
push   %rbx
cpuid
pop    %rbx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @cpuid_edx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call { i32, i32, i32 } asm "pushq %rbx\0A\09cpuid\0A\09popq %rbx", "={ax},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %6)
%8 = extractvalue { i32, i32, i32 } %7, 0
%9 = extractvalue { i32, i32, i32 } %7, 1
%10 = extractvalue { i32, i32, i32 } %7, 2
store i32 %8, i32* %3
store i32 %9, i32* %4
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @cpuid_edx(i32 %0) {
%2 = tail call { i32, i32, i32 } asm "pushq %rbx\0A\09cpuid\0A\09popq %rbx", "={ax},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32, i32 } %2, 2
ret i32 %3
}
/* Type definitions */
struct fh_closure {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct fh_closure *);
void free_closure(struct fh_closure *closure) { free(closure); }


x86 assembly (clang, -O0):
<free_closure>:
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):
<free_closure>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.fh_closure = type { i32 }
define void @free_closure(%struct.fh_closure* nocapture %0) {
%2 = tail call i32 @free(%struct.fh_closure* %0)
ret void
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("1! = %i\n", factorial(1));
  printf("3! = %i\n", factorial(3));
  printf("5! = %i\n", factorial(5));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <factorial@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1030 <factorial@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1030 <factorial@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"1! = %i\0A\00"
@.str.1 = [9 x i8] c"3! = %i\0A\00"
@.str.2 = [9 x i8] c"5! = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @factorial(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @factorial(i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @factorial(i32 5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void NativeNoStructToVoid(int32_t a, int32_t b, int32_t c, int32_t d) {}


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

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

LLVM IR (-O0):
define void @NativeNoStructToVoid(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @NativeNoStructToVoid(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
OP(fd, e6) {
  illegal_1();
  op_e6();
}


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_e6@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_e6@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_e6()
%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_e6()
ret i32 undef
}
int scard_function_get_attrib_return(void *user_data, struct stream *in_s,
                                     int len, int status) {
  return 0;
}


x86 assembly (clang, -O0):
<scard_function_get_attrib_return>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stream = type opaque
define i32 @scard_function_get_attrib_return(i8* %0, %struct.stream* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca %struct.stream*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store %struct.stream* %1, %struct.stream** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.stream = type opaque
define i32 @scard_function_get_attrib_return(i8* nocapture readnone %0, %struct.stream* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
XAddToExtensionList() {}


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

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

LLVM IR (-O0):
define i32 @XAddToExtensionList() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XAddToExtensionList() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void parameter_list_destroy_function(void *object) { free((char *)object); }


x86 assembly (clang, -O0):
<parameter_list_destroy_function>:
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):
<parameter_list_destroy_function>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @parameter_list_destroy_function(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay_tick(int);
int readl(int);
void v_wait_uart_empty() {
  unsigned int count = 0;
  do {
    if ((readl((0xf3100000 + (((0x01 << 10) | (0x33 << 2))))) & (1 << 22)) ==
        0) {
      delay_tick(4);
    } else {
      break;
    }
    count++;
  } while (count < 20000);
}


x86 assembly (clang, -O0):
<v_wait_uart_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf31004cc,%edi
call   1040 <readl@plt>
and    $0x400000,%eax
cmp    $0x0,%eax
jne    1156 <v_wait_uart_empty+0x36>
mov    $0x4,%edi
call   1030 <delay_tick@plt>
jmp    115b <v_wait_uart_empty+0x3b>
jmp    1171 <v_wait_uart_empty+0x51>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x4e20,-0x4(%rbp)
jb     112f <v_wait_uart_empty+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_wait_uart_empty>:
push   %rbx
mov    $0x4e20,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0xf31004cc,%edi
call   1040 <readl@plt>
test   $0x400000,%eax
jne    1150 <v_wait_uart_empty+0x30>
mov    $0x4,%edi
call   1030 <delay_tick@plt>
add    $0xffffffff,%ebx
jne    1130 <v_wait_uart_empty+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @v_wait_uart_empty() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %12, %0
%3 = call i32 @readl(i32 -217054004)
%4 = and i32 %3, 4194304
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 @delay_tick(i32 4)
br label %9
8: ; preds = %2
br label %15
9: ; preds = %6
%10 = load i32, i32* %1
%11 = add i32 %10, 1
store i32 %11, i32* %1
br label %12
12: ; preds = %9
%13 = load i32, i32* %1
%14 = icmp ult i32 %13, 20000
br i1 %14, label %2, label %15
15: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
define void @v_wait_uart_empty() {
br label %1
1: ; preds = %6, %0
%2 = phi i32 [ 0, %0 ], [ %8, %6 ]
%3 = tail call i32 @readl(i32 -217054004)
%4 = and i32 %3, 4194304
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 @delay_tick(i32 4)
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 20000
br i1 %9, label %10, label %1
10: ; preds = %1, %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
pid_t __clone(int (*func)(void *), void *stack, int flags, void *arg) {
  return (0);
}


x86 assembly (clang, -O0):
<__clone>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__clone(i32 (i8*)* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32 (i8*)*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i32 (i8*)* %0, i32 (i8*)** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @__clone(i32 (i8*)* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int ENOSYS;
int errno;
int fremovexattr(int filedes, const char *name) { return (errno = ENOSYS, -1); }


x86 assembly (clang, -O0):
<fremovexattr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fremovexattr>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fremovexattr(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fremovexattr(i32 %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int sscanf(char *, char *);
int _check_ThreadDesc(char *string) {
  return ((sscanf(string, "%d") == 1) ? 1 : 0);
}


x86 assembly (clang, -O0):
<_check_ThreadDesc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_ThreadDesc>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <sscanf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @_check_ThreadDesc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sscanf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @_check_ThreadDesc(i8* nocapture %0) {
%2 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
void border_nw_ext_corner_special_sand_long_hori(unsigned char *pic,
                                                 unsigned char *mirr) {
  *pic = 0x30;
  *mirr = 0x01 | 0x02;
}


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

x86 assembly (clang, -O2):
<border_nw_ext_corner_special_sand_long_hori>:
movb   $0x30,(%rdi)
movb   $0x3,(%rsi)
ret

LLVM IR (-O0):
define void @border_nw_ext_corner_special_sand_long_hori(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
store i8 48, i8* %5
%6 = load i8*, i8** %4
store i8 3, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_nw_ext_corner_special_sand_long_hori(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 48, i8* %0
store i8 3, i8* %1
ret void
}
void fd_init(int fd) {}


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

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

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

LLVM IR (-O2):
define void @fd_init(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
char fcpeek(FILE *f) {
  char c = getc(f);
  ungetc(c, f);
  return c;
}


x86 assembly (clang, -O0):
<fcpeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <ungetc@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcpeek>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <getc@plt>
movsbl %al,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @fcpeek(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call signext i8 @getc(i32* %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = load i32*, i32** %2
%8 = call i32 @ungetc(i8 signext %6, i32* %7)
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @fcpeek(i32* nocapture %0) {
%2 = tail call signext i8 @getc(i32* %0)
%3 = tail call i32 @ungetc(i8 signext %2, i32* %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char str[10] = "";
  itoa(-20, str);
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
lea    -0xe(%rbp),%rsi
mov    $0xffffffec,%edi
call   1050 <itoa@plt>
lea    -0xe(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
mov    %rsp,%rbx
mov    $0xffffffec,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 -20, i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fatal(const char *msg) {
  fprintf(stderr, "fatal: %s", *msg ? msg : "Oops!");
  exit(-1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <fatal+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1165 <fatal+0x45>
lea    0xeae(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1165 <fatal+0x45>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rdx
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    0x2eb8(%rip),%rax
cmpb   $0x0,(%rdi)
mov    (%rax),%eax
lea    0xed6(%rip),%rdx
cmovne %rdi,%rdx
lea    0xec1(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"fatal: %s\00"
@.str.1 = [6 x i8] c"Oops!\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0
%6 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *p = "123";
  printf("p = %s\n", p);
  p = "456" + 1;
  printf("p = %s\n", p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeec(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
@.str.1 = [8 x i8] c"p = %s\0A\00"
@.str.2 = [4 x i8] c"456\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 1))
ret i32 0
}
/* Type definitions */
struct server {
  int dummy;
};
struct imapmsg {
  int dummy;
};
struct folder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ conn_teardown(struct server *, struct folder *);
void imap_byeok(struct imapmsg *msg, struct server *sptr, struct folder *fptr) {
  conn_teardown(sptr, fptr);
}


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

x86 assembly (clang, -O2):
<imap_byeok>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <conn_teardown@plt>

LLVM IR (-O0):
%struct.imapmsg = type { i32 }
%struct.server = type { i32 }
%struct.folder = type { i32 }
define void @imap_byeok(%struct.imapmsg* %0, %struct.server* %1, %struct.folder* %2) {
%4 = alloca %struct.imapmsg*
%5 = alloca %struct.server*
%6 = alloca %struct.folder*
store %struct.imapmsg* %0, %struct.imapmsg** %4
store %struct.server* %1, %struct.server** %5
store %struct.folder* %2, %struct.folder** %6
%7 = load %struct.server*, %struct.server** %5
%8 = load %struct.folder*, %struct.folder** %6
%9 = call i32 @conn_teardown(%struct.server* %7, %struct.folder* %8)
ret void
}

LLVM IR (-O2):
%struct.imapmsg = type { i32 }
%struct.server = type { i32 }
%struct.folder = type { i32 }
define void @imap_byeok(%struct.imapmsg* nocapture readnone %0, %struct.server* %1, %struct.folder* %2) {
%4 = tail call i32 @conn_teardown(%struct.server* %1, %struct.folder* %2)
ret void
}
void instruc_17() {}


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

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

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

LLVM IR (-O2):
define void @instruc_17() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int a;
  int b;
  a = 12;
  b = 33;
  printf("a=%d, b=%d\n", a, b);
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
  printf("a=%d, b=%d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
movl   $0x21,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
mov    $0x21,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x21,%esi
mov    $0xc,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"a=%d, b=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 12, i32* %2
store i32 33, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = xor i32 %7, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = xor i32 %10, %11
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = xor i32 %13, %14
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"a=%d, b=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 12, i32 33)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 33, i32 12)
ret i32 0
}
double linearstep(double start, double end, double position, int length) {
  double o = (end - start) / length;
  return start + position * o;
}


x86 assembly (clang, -O0):
<linearstep>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearstep>:
cvtsi2sd %edi,%xmm3
subsd  %xmm0,%xmm1
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @linearstep(double %0, double %1, double %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store i32 %3, i32* %8
%10 = load double, double* %6
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = load i32, i32* %8
%14 = sitofp i32 %13 to double
%15 = fdiv double %12, %14
store double %15, double* %9
%16 = load double, double* %5
%17 = load double, double* %7
%18 = load double, double* %9
%19 = call double @llvm.fmuladd.f64(double %17, double %18, double %16)
ret double %19
}

LLVM IR (-O2):
define double @linearstep(double %0, double %1, double %2, i32 %3) {
%5 = fsub double %1, %0
%6 = sitofp i32 %3 to double
%7 = fdiv double %5, %6
%8 = tail call double @llvm.fmuladd.f64(double %2, double %7, double %0)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_21() {
  Assert_real((isqrt(21) == 4),
              "/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/stdlib/isqrt.c",
              110, ("Integer square root of 21 should be 4"));
}


x86 assembly (clang, -O0):
<t_sqrt_21>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15,%edi
call   1030 <isqrt@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x6e,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_21>:
push   %rax
mov    $0x15,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x6e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 21 should be 4\00"
define void @t_sqrt_21() {
%1 = call i32 @isqrt(i32 21)
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 21 should be 4\00"
define void @t_sqrt_21() {
%1 = tail call i32 @isqrt(i32 21)
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ con_runfile(char *);
int /*<<< orphan*/ reset_timeouts();
int /*<<< orphan*/ router_restart();
void router_init(void) {
  router_restart();
  con_runfile("autoexec.script");
  reset_timeouts();
}


x86 assembly (clang, -O0):
<router_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <router_restart@plt>
lea    0xebe(%rip),%rdi
call   1050 <con_runfile@plt>
mov    $0x0,%al
call   1030 <reset_timeouts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<router_init>:
push   %rax
xor    %eax,%eax
call   1040 <router_restart@plt>
lea    0xec1(%rip),%rdi
call   1050 <con_runfile@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <reset_timeouts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"autoexec.script\00"
define void @router_init() {
%1 = call i32 (...) @router_restart()
%2 = call i32 @con_runfile(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @reset_timeouts()
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"autoexec.script\00"
define void @router_init() {
%1 = tail call i32 (...) @router_restart()
%2 = tail call i32 @con_runfile(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @reset_timeouts()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_SUBUSB(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0xd8);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


x86 assembly (clang, -O0):
<MMX_SUBUSB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xd8,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_SUBUSB>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xd8,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_SUBUSB(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 216)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_SUBUSB(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 216)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
typedef TYPE_1__ ASN1_STRING;

/* Variables and functions */
int ASN1_STRING_type(const ASN1_STRING *x) { return x->type; }


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

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @ASN1_STRING_type(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @ASN1_STRING_type(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int strlen(char *);
void x(char *p) {
  int i, key = 0xFE;
  for (i = 0; i < strlen(p); i++)
    p[i] ^= key;
}


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xfe,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    1168 <x+0x58>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
xor    %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <x+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1148 <x+0x38>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorb   $0xfe,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <x+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @x(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = xor i8 %7, -2
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
void accWriteByte(unsigned char address, unsigned char data) {}


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

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

LLVM IR (-O0):
define void @accWriteByte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
ret void
}

LLVM IR (-O2):
define void @accWriteByte(i8 zeroext %0, i8 zeroext %1) {
ret void
}
int PDC_set_rows(int rows) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @PDC_set_rows(i32 %0) {
ret i32 0
}
void Mhal_PNL_Flock_LPLLSet(unsigned int ldHz) { (ldHz = ldHz); }


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

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

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

LLVM IR (-O2):
define void @Mhal_PNL_Flock_LPLLSet(i32 %0) {
ret void
}
int is_missing(unsigned const char *p, int len) {
  int i;
  for (i = 0; i < len; i++) {
    if (p[i] != 255)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_missing>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <is_missing+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0xff,%eax
je     1141 <is_missing+0x41>
movl   $0x0,-0x4(%rbp)
jmp    115b <is_missing+0x5b>
jmp    1146 <is_missing+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <is_missing+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_missing>:
mov    $0x1,%eax
test   %esi,%esi
jle    111f <is_missing+0x1f>
mov    %esi,%ecx
xor    %edx,%edx
nopl   (%rax)
cmpb   $0xff,(%rdi,%rdx,1)
jne    1120 <is_missing+0x20>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <is_missing+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_missing(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, -1
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %6, label %14
14: ; preds = %8, %6, %2
%15 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %15
}
int test_imm_45int32_mem(int *val) {
  return ((*val) & (0x45 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_45int32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x45,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_45int32_mem>:
testb  $0x45,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_45int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 69
%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_45int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 69
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *string_downshift(s)
char *s;
{
  register char *x = s;
  for (; *x; x++)
    if (isupper(*x))
      *x = tolower(*x);
  return (s);
}


x86 assembly (clang, -O0):
<string_downshift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1180 <string_downshift+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%eax
je     116a <string_downshift+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    116f <string_downshift+0x4f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <string_downshift+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_downshift>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1165 <string_downshift+0x45>
lea    0x1(%r14),%rbx
jmp    114b <string_downshift+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <string_downshift+0x45>
movsbl %al,%ebp
mov    %ebp,%edi
call   1040 <isupper@plt>
test   %eax,%eax
je     1140 <string_downshift+0x20>
mov    %ebp,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
jmp    1140 <string_downshift+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @string_downshift(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 = %23, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %26
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 @isupper(i32 %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = call i32 @tolower(i32 %18)
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
store i8 %20, i8* %21
br label %22
22: ; preds = %15, %9
br label %23
23: ; preds = %22
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %3
br label %5
26: ; preds = %5
%27 = load i8*, i8** %2
ret i8* %27
}

LLVM IR (-O2):
define i8* @string_downshift(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @isupper(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = tail call i32 @tolower(i32 %7)
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
br label %13
13: ; preds = %4, %10
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %13, %1
ret i8* %0
}
void dec_rt_group(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) {}


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

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

LLVM IR (-O0):
%struct.sched_rt_entity = type opaque
%struct.rt_rq = type opaque
define void @dec_rt_group(%struct.sched_rt_entity* %0, %struct.rt_rq* %1) {
%3 = alloca %struct.sched_rt_entity*
%4 = alloca %struct.rt_rq*
store %struct.sched_rt_entity* %0, %struct.sched_rt_entity** %3
store %struct.rt_rq* %1, %struct.rt_rq** %4
ret void
}

LLVM IR (-O2):
%struct.sched_rt_entity = type opaque
%struct.rt_rq = type opaque
define void @dec_rt_group(%struct.sched_rt_entity* nocapture %0, %struct.rt_rq* nocapture %1) {
ret void
}
int push_column() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @push_column() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read_write_screen(char *, int /*<<< orphan*/);
void write_screen(char *buf) { read_write_screen(buf, 0); }


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

x86 assembly (clang, -O2):
<write_screen>:
xor    %esi,%esi
jmp    1030 <read_write_screen@plt>

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

LLVM IR (-O2):
define void @write_screen(i8* %0) {
%2 = tail call i32 @read_write_screen(i8* %0, i32 0)
ret void
}
pi(i) { printf("%d ", i); }


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

x86 assembly (clang, -O2):
<pi>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @pi(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int /*<<< orphan*/ my_putnbr_base(int, char *);
int my_put_nbr(int nb) {
  my_putnbr_base(nb, "0123456789");
  my_putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<my_put_nbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1030 <my_putnbr_base@plt>
mov    $0xa,%edi
call   1040 <my_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_put_nbr>:
push   %rax
lea    0xed8(%rip),%rsi
call   1030 <my_putnbr_base@plt>
mov    $0xa,%edi
call   1040 <my_putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
define i32 @my_put_nbr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @my_putnbr_base(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @my_putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define i32 @my_put_nbr(i32 %0) {
%2 = tail call i32 @my_putnbr_base(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @my_putchar(i8 signext 10)
ret i32 0
}
void InertiaH36(double *M, double *q, double *L, double *addl, double mass) {}


x86 assembly (clang, -O0):
<InertiaH36>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @InertiaH36(double* %0, double* %1, double* %2, double* %3, double %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double %4, double* %10
ret void
}

LLVM IR (-O2):
define void @InertiaH36(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double %4) {
ret void
}