xunge/DecIR huggingface dataset:
int main(int argc, char **argv) {
  int rc = 0;
  rc = 0;
  return rc;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int msx_write(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int, char *);
int msx_writeproc(int pid, char *item, int val) {
  char fn[30];
  sprintf(fn, "/proc/%d/%s", pid, item);
  return (msx_write(fn, val));
}


x86 assembly (clang, -O0):
<msx_writeproc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xebc(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <msx_write@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msx_writeproc>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edx,%ebx
mov    %rsi,%rcx
mov    %edi,%edx
lea    0xecb(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <msx_write@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"/proc/%d/%s\00"
define i32 @msx_writeproc(i32 %0, i8* %1, i32 %2) {
%4 = alloca [30 x i8]
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%7 = call i32 @msx_write(i8* %5, i32 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void steppers_relax() { printf("Stop Steppers\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Stop Steppers\0A\00"
define void @steppers_relax() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Stop Steppers\00"
define void @steppers_relax() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ perror(char *);
pid_t safe_fork() {
  pid_t pid = fork();
  if (pid == -1) {
    perror("safe_fork - Failed to fork");
    exit(EXIT_FAILURE);
  }
  return pid;
}


x86 assembly (clang, -O0):
<safe_fork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1166 <safe_fork+0x36>
lea    0xead(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_fork>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
cmp    $0xffffffff,%eax
je     113f <safe_fork+0xf>
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"safe_fork - Failed to fork\00"
@EXIT_FAILURE = global i32 0
define i32 @safe_fork() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [27 x i8] c"safe_fork - Failed to fork\00"
@EXIT_FAILURE = global i32 0
define i32 @safe_fork() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
ret i32 %1
}
/* Variables and functions */
void reverse(char *p, size_t len) {
  char *pp = p + len - 1;
  while (p < pp) {
    char tmp = *p;
    *p = *pp;
    *pp = tmp;
    p++;
    pp--;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1165 <reverse+0x65>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <reverse+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
cmp    %rdi,%rax
jbe    113c <reverse+0x3c>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl -0x1(%rdi),%ecx
movzbl (%rax),%edx
mov    %dl,-0x1(%rdi)
mov    %cl,(%rax)
add    $0xffffffffffffffff,%rax
lea    0x1(%rdi),%rcx
cmp    %rax,%rdi
mov    %rcx,%rdi
jb     1120 <reverse+0x20>
ret

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

LLVM IR (-O2):
define void @reverse(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = icmp ugt i8* %4, %0
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi i8* [ %12, %6 ], [ %4, %2 ]
%8 = phi i8* [ %11, %6 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = load i8, i8* %7
store i8 %10, i8* %8
store i8 %9, i8* %7
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = getelementptr inbounds i8, i8* %7, i64 -1
%13 = icmp ult i8* %11, %12
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void ret() { put8(0xC3); }


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

x86 assembly (clang, -O2):
<ret>:
mov    $0xc3,%edi
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @ret() {
%1 = call i32 @put8(i32 195)
ret void
}

LLVM IR (-O2):
define void @ret() {
%1 = tail call i32 @put8(i32 195)
ret void
}
int test_imm_6Bint16_reg(short val) {
  return ((val) & (0x6B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Bint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 107
%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_6Bint16_reg(i16 signext %0) {
%2 = and i16 %0, 107
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long align(long size) { return size + (4096 - size % 4096) % 4096; }


x86 assembly (clang, -O0):
<align>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x1000,%ecx
cqto
idiv   %rcx
mov    $0x1000,%eax
sub    %rdx,%rax
mov    $0x1000,%ecx
cqto
idiv   %rcx
mov    -0x10(%rbp),%rax
add    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align>:
mov    %edi,%eax
neg    %eax
and    $0xfff,%eax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @align(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = srem i64 %4, 4096
%6 = sub nsw i64 4096, %5
%7 = srem i64 %6, 4096
%8 = add nsw i64 %3, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @align(i64 %0) {
%2 = sub i64 0, %0
%3 = and i64 %2, 4095
%4 = add nsw i64 %3, %0
ret i64 %4
}
void rop3_199_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D | T;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_199_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_199_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
not    %cl
and    %al,%sil
or     %cl,%sil
and    %dl,%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_199_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = xor i32 %40, -1
%42 = and i32 %38, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %5
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = load i8*, i8** %4
%51 = load i8, i8* %50
%52 = zext i8 %51 to i32
%53 = load i8, i8* %6
%54 = zext i8 %53 to i32
%55 = and i32 %52, %54
%56 = or i32 %49, %55
%57 = trunc i32 %56 to i8
%58 = load i8*, i8** %4
store i8 %57, i8* %58
ret void
}

LLVM IR (-O2):
define void @rop3_199_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = xor i8 %5, -1
%7 = and i8 %4, %1
%8 = or i8 %7, %6
%9 = and i8 %4, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void dll_clearerr(int /*<<< orphan*/ *);
void __wrap_clearerr(FILE *stream) { return dll_clearerr(stream); }


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

x86 assembly (clang, -O2):
<__wrap_clearerr>:
jmp    1030 <dll_clearerr@plt>

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

LLVM IR (-O2):
define void @__wrap_clearerr(i32* %0) {
tail call void @dll_clearerr(i32* %0)
ret void
}
/* Variables and functions */
void SNDDummyMuteAudio() {}


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

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

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

LLVM IR (-O2):
define void @SNDDummyMuteAudio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__0__GeneralIO__toggle();
void LedsP__Led0__toggle(void) { Msp430GpioC__0__GeneralIO__toggle(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led0__toggle() {
%1 = tail call i32 (...) @Msp430GpioC__0__GeneralIO__toggle()
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ studly(char *);
int main() {
  char *a = (char *)malloc(100 * sizeof(char));
  printf("Please type the word using your keyboard: ");
  scanf("%s", a);
  studly(a);
  printf("%c\n", *a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <studly@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <studly@plt>
movsbl (%rbx),%esi
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Please type the word using your keyboard: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 100)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @studly(i8* %8)
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"Please type the word using your keyboard: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 100)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = tail call i32 @studly(i8* %2)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, unsigned int *);
char rw_get_hexa(char *s) {
  unsigned int x;
  sscanf(s, "%2x", &x);
  return (char)x;
}


x86 assembly (clang, -O0):
<rw_get_hexa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rw_get_hexa>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%al
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%2x\00"
define signext i8 @rw_get_hexa(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
ret i8 %6
}
void ble_rsp_system_endpoint_rx(
    const struct ble_msg_system_endpoint_rx_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.ble_msg_system_endpoint_rx_rsp_t = type opaque
define void @ble_rsp_system_endpoint_rx(%struct.ble_msg_system_endpoint_rx_rsp_t* %0) {
%2 = alloca %struct.ble_msg_system_endpoint_rx_rsp_t*
store %struct.ble_msg_system_endpoint_rx_rsp_t* %0, %struct.ble_msg_system_endpoint_rx_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.ble_msg_system_endpoint_rx_rsp_t = type opaque
define void @ble_rsp_system_endpoint_rx(%struct.ble_msg_system_endpoint_rx_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_map();
int /*<<< orphan*/ map_read_filename(char *);
int main(void) {
  clear_map();
  map_read_filename("gm.map");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clear_map@plt>
lea    0xece(%rip),%rdi
call   1030 <map_read_filename@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"gm.map\00"
define i32 @main() {
%1 = call i32 (...) @clear_map()
%2 = call i32 @map_read_filename(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"gm.map\00"
define i32 @main() {
%1 = tail call i32 (...) @clear_map()
%2 = tail call i32 @map_read_filename(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(long);
long strtol(char const *const, int /*<<< orphan*/ *, int /*<<< orphan*/);
void processForceQuitOption(const char *const option __attribute__((unused)),
                            const char *const parameter) {
  long s = 0;
  if (parameter != NULL && parameter[0] != '\0')
    s = strtol(parameter, NULL, 0);
  exit(s);
}


x86 assembly (clang, -O0):
<processForceQuitOption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1166 <processForceQuitOption+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1166 <processForceQuitOption+0x46>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<processForceQuitOption>:
push   %rax
test   %rsi,%rsi
je     112b <processForceQuitOption+0xb>
cmpb   $0x0,(%rsi)
jne    1132 <processForceQuitOption+0x12>
xor    %edi,%edi
call   1040 <exit@plt>
mov    %rsi,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %rax,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @processForceQuitOption(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
store i64 0, i64* %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = load i8*, i8** %4
%16 = call i64 @strtol(i8* %15, i32* null, i32 0)
store i64 %16, i64* %5
br label %17
17: ; preds = %14, %8, %2
%18 = load i64, i64* %5
%19 = call i32 @exit(i64 %18)
unreachable
}

LLVM IR (-O2):
define void @processForceQuitOption(i8* nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i64 @strtol(i8* nocapture %1, i32* null, i32 0)
br label %9
9: ; preds = %7, %4, %2
%10 = phi i64 [ %8, %7 ], [ 0, %4 ], [ 0, %2 ]
%11 = tail call i32 @exit(i64 %10)
unreachable
}
/* Variables and functions */
scalar_t__ abs(int);
int /*<<< orphan*/ link_failure_abs();
void test_abs(int x) {
  if (abs(x) != abs(x))
    link_failure_abs();
}


x86 assembly (clang, -O0):
<test_abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     1156 <test_abs+0x36>
mov    $0x0,%al
call   1040 <link_failure_abs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_abs>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <abs@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1030 <abs@plt>
cmp    %rax,%r14
jne    1142 <test_abs+0x22>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <link_failure_abs@plt>

LLVM IR (-O0):
define void @test_abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @abs(i32 %3)
%5 = load i32, i32* %2
%6 = call i64 @abs(i32 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_abs()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_abs(i32 %0) {
%2 = tail call i64 @abs(i32 %0)
%3 = tail call i64 @abs(i32 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_abs()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
char const *findJsonEndParams(char const *, int /*<<< orphan*/, int *, int *,
                              int *);
int /*<<< orphan*/ strlen(char const *);
const char *findJsonEnd(const char *data) {
  int inString = 0;
  int level = 0;
  int pos = 0;
  return findJsonEndParams(data, strlen(data), &inString, &level, &pos);
}


x86 assembly (clang, -O0):
<findJsonEnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <findJsonEndParams@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findJsonEnd>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
call   1030 <strlen@plt>
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <findJsonEndParams@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @findJsonEnd(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = tail call i32 @strlen(i8* %0)
%9 = call i8* @findJsonEndParams(i8* %0, i32 %8, i32* %2, i32* %3, i32* %4)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(int);
tab() { outbyte(9); }


x86 assembly (clang, -O0):
<tab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x9,%edi
call   1030 <outbyte@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tab() {
%1 = alloca i32
%2 = call i32 @outbyte(i32 9)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @tab() {
%1 = tail call i32 @outbyte(i32 9)
ret i32 undef
}
double derive_linear(double x) { return 1.0; }


x86 assembly (clang, -O0):
<derive_linear>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @derive_linear(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @derive_linear(double %0) {
ret double 1.000000e+00
}
int test_imm_B7uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xB7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B7uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11993088
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fexpect_string(char *, int, char *, char *);
void whitespace() {
  fexpect_string(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/lex.c",
      37, "x y", "x y");
  ;
}


x86 assembly (clang, -O0):
<whitespace>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x25,%esi
lea    0xf61(%rip),%rcx
mov    %rcx,%rdx
call   1030 <fexpect_string@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<whitespace>:
lea    0xee9(%rip),%rdi
lea    0xf6a(%rip),%rcx
mov    $0x25,%esi
mov    %rcx,%rdx
jmp    1030 <fexpect_string@plt>

LLVM IR (-O0):
@.str = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/lex.c\00"
@.str.1 = [4 x i8] c"x y\00"
define void @whitespace() {
%1 = call i32 @fexpect_string(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i32 37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/lex.c\00"
@.str.1 = [4 x i8] c"x y\00"
define void @whitespace() {
%1 = tail call i32 @fexpect_string(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i32 37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned xrop3_240_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  return (T & S) | (T & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_240_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_240_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    %esi,%eax
and    %ecx,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_240_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
store i32 %13, i32* %6
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = shl i32 %15, 8
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = load i32, i32* %6
%22 = and i32 %20, %21
%23 = load i32, i32* %7
%24 = load i32, i32* %7
%25 = xor i32 %24, -1
%26 = and i32 %23, %25
%27 = or i32 %22, %26
%28 = load i32, i32* %7
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %5
%33 = and i32 %31, %32
%34 = or i32 %27, %33
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_240_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = and i32 %6, %4
%8 = xor i32 %4, -1
%9 = and i32 %8, %5
%10 = or i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, int);
int read_register(unsigned int, unsigned int);
void print_register(unsigned component, unsigned reg) {
  printf("%#.8X - [%#.8X]\n", reg, read_register(component, reg));
}


x86 assembly (clang, -O0):
<print_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <read_register@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_register>:
push   %rbx
mov    %esi,%ebx
call   1030 <read_register@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%#.8X - [%#.8X]\0A\00"
define void @print_register(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @read_register(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%#.8X - [%#.8X]\0A\00"
define void @print_register(i32 %0, i32 %1) {
%3 = tail call i32 @read_register(i32 %0, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %3)
ret void
}
int execute_statfs64() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_statfs64() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *);
int /*<<< orphan*/ kill_this_task();
void disarm(void) {
  debug("Elixer disarmed.");
  kill_this_task();
}


x86 assembly (clang, -O0):
<disarm>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <debug@plt>
mov    $0x0,%al
call   1030 <kill_this_task@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disarm>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <debug@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <kill_this_task@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Elixer disarmed.\00"
define void @disarm() {
%1 = call i32 @debug(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @kill_this_task()
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Elixer disarmed.\00"
define void @disarm() {
%1 = tail call i32 @debug(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @kill_this_task()
ret void
}
void gtk_text_search_flags_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_search_flags_get_type() {
ret void
}
int test_imm_BAint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xBA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BAint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xba,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_BAint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 798863917056
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int argvlen(char const *const *argv) {
  int i = 0;
  while (*argv++)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<argvlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,(%rax)
je     1136 <argvlen+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <argvlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<argvlen>:
cmpq   $0x0,(%rdi)
je     111d <argvlen+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <argvlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @argvlen(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8*, i8** %7
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int pulldown_drop(int action, int bottom_field) {
  int ret = 1;
  if (action == (1 << 0) && bottom_field)
    ret = 0;
  if (action == (1 << 2) && !bottom_field)
    ret = 0;
  if (action == (1 << 3) && !bottom_field)
    ret = 0;
  if (action == (1 << 4) && bottom_field)
    ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<pulldown_drop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    112c <pulldown_drop+0x2c>
cmpl   $0x0,-0x8(%rbp)
je     112c <pulldown_drop+0x2c>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0x4(%rbp)
jne    1147 <pulldown_drop+0x47>
cmpl   $0x0,-0x8(%rbp)
jne    1147 <pulldown_drop+0x47>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0x4(%rbp)
jne    1162 <pulldown_drop+0x62>
cmpl   $0x0,-0x8(%rbp)
jne    1162 <pulldown_drop+0x62>
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0x4(%rbp)
jne    117d <pulldown_drop+0x7d>
cmpl   $0x0,-0x8(%rbp)
je     117d <pulldown_drop+0x7d>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pulldown_drop>:
cmp    $0x1,%edi
sete   %al
test   %esi,%esi
sete   %sil
setne  %dl
and    %dl,%al
cmp    $0x4,%edi
setne  %cl
or     %dl,%cl
xor    %al,%cl
cmp    $0x8,%edi
setne  %al
or     %dl,%al
cmp    $0x10,%edi
setne  %dl
or     %sil,%dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @pulldown_drop(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
%6 = icmp ne i32 %0, 4
%7 = or i1 %6, %4
%8 = xor i1 %5, %7
%9 = icmp ne i32 %0, 8
%10 = or i1 %9, %4
%11 = and i1 %10, %8
%12 = icmp eq i32 %0, 16
%13 = and i1 %12, %4
%14 = xor i1 %13, true
%15 = and i1 %11, %14
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  char a = 0;
  a = getchar();
  getchar();
  char b;
  b = a;
  b = getchar();
  printf("a + b = %d", (a - '0') + (b - '0'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
movsbl -0x6(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
lea    0xe95(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
add    %bl,%al
add    $0xa0,%al
movsbl %al,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"a + b = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = call signext i8 (...) @getchar()
%6 = load i8, i8* %2
store i8 %6, i8* %3
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %3
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 48
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 48
%14 = add nsw i32 %10, %13
%15 = trunc i32 %14 to i8
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"a + b = %d\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = tail call signext i8 (...) @getchar()
%3 = tail call signext i8 (...) @getchar()
%4 = add i8 %1, -96
%5 = add i8 %4, %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
uint64_t read_uint64(FILE *in) {
  uint64_t x;
  assert(fread(&x, sizeof(uint64_t), 1, in) == 1);
  return x;
}


x86 assembly (clang, -O0):
<read_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint64>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_uint64(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(i32* %3, i32 4, i32 1, i32* %4)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_uint64(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i32* %2, i32 4, i32 1, i32* %0)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}
char bit_value(unsigned char *str, int bit_number) {
  return (str[bit_number / 8] & (1 << bit_number % 8)) >> (bit_number % 8);
}


x86 assembly (clang, -O0):
<bit_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
mov    %edx,%ecx
sar    %cl,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_value>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%edx
sar    $0x3,%edx
movslq %edx,%rdx
movzbl (%rdi,%rdx,1),%edx
and    $0xfffffff8,%eax
sub    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edx,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define signext i8 @bit_value(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = srem i32 %12, 8
%14 = shl i32 1, %13
%15 = and i32 %11, %14
%16 = load i32, i32* %4
%17 = srem i32 %16, 8
%18 = ashr i32 %15, %17
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @bit_value(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = srem i32 %1, 8
%9 = shl nuw nsw i32 1, %8
%10 = and i32 %9, %7
%11 = lshr i32 %10, %8
%12 = trunc i32 %11 to i8
ret i8 %12
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
__attribute__((__always___)) int bound_motion_vector(const int vector,
                                                     const int f_code) {
  return ((int32_t)vector << (27 - f_code)) >> (27 - f_code);
}


x86 assembly (clang, -O0):
<bound_motion_vector>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1b,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    $0x1b,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bound_motion_vector>:
mov    %edi,%eax
mov    $0x1b,%cl
sub    %sil,%cl
shl    %cl,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @bound_motion_vector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 27, %6
%8 = shl i32 %5, %7
%9 = load i32, i32* %4
%10 = sub nsw i32 27, %9
%11 = ashr i32 %8, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @bound_motion_vector(i32 %0, i32 %1) {
%3 = sub nsw i32 27, %1
%4 = shl i32 %0, %3
%5 = ashr i32 %4, %3
ret i32 %5
}
void ARGBSepiaRow_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ARGBSepiaRow_SSSE3() {
ret void
}