xunge/DecIR huggingface dataset:
char *itcp_error_get(int error) {
  switch (error) {
  case 0:
    return ("LIBtcp_SUCCESS");
  case -1:
    return ("LIBtcp_ERROR_IO");
  }
  return ("LIBtcp_ERROR Unknown error");
}


x86 assembly (clang, -O0):
<itcp_error_get>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xffffffff,%eax
je     113b <itcp_error_get+0x3b>
jmp    111b <itcp_error_get+0x1b>
mov    -0x10(%rbp),%eax
test   %eax,%eax
jne    114b <itcp_error_get+0x4b>
jmp    112b <itcp_error_get+0x2b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <itcp_error_get+0x56>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <itcp_error_get+0x56>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itcp_error_get>:
cmp    $0xffffffff,%edi
lea    0xf05(%rip),%rax
lea    0xf0e(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee2(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"LIBtcp_SUCCESS\00"
@.str.1 = [16 x i8] c"LIBtcp_ERROR_IO\00"
@.str.2 = [27 x i8] c"LIBtcp_ERROR Unknown error\00"
define i8* @itcp_error_get(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 -1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [15 x i8] c"LIBtcp_SUCCESS\00"
@.str.1 = [16 x i8] c"LIBtcp_ERROR_IO\00"
@.str.2 = [27 x i8] c"LIBtcp_ERROR Unknown error\00"
define i8* @itcp_error_get(i32 %0) {
%2 = icmp eq i32 %0, -1
%3 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void banner(void) {
  printf("\nbmp2cgb v%.2f - bitmap converter for Game Boy Color\n", 1.21);
  printf("Programmed by: tmk, email: tmk@tuta.io\n");
  printf("Project page: https://github.com/gitendo/bmp2cgb/\n\n");
}


x86 assembly (clang, -O0):
<banner>:
push   %rbp
mov    %rsp,%rbp
lea    0xeed(%rip),%rdi
movsd  0xedd(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<banner>:
push   %rax
lea    0xee0(%rip),%rdi
movsd  0xed0(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"\0Abmp2cgb v%.2f - bitmap converter for Game Boy Color\0A\00"
@.str.1 = [40 x i8] c"Programmed by: tmk, email: tmk@tuta.io\0A\00"
@.str.2 = [52 x i8] c"Project page: https://github.com/gitendo/bmp2cgb/\0A\0A\00"
define void @banner() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), double 1.210000e+00)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"\0Abmp2cgb v%.2f - bitmap converter for Game Boy Color\0A\00"
@str = [39 x i8] c"Programmed by: tmk, email: tmk@tuta.io\00"
@str.3 = [51 x i8] c"Project page: https://github.com/gitendo/bmp2cgb/\0A\00"
define void @banner() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), double 1.210000e+00)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int removeContinuum(int, double *, double *, int, int, double *);
int removeContinuumInplace(int n, double *wvl, double *dat, int ret_cc,
                           int verbose) {
  return removeContinuum(n, wvl, dat, ret_cc, verbose, dat);
}


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

x86 assembly (clang, -O2):
<removeContinuumInplace>:
mov    %rdx,%r9
jmp    1030 <removeContinuum@plt>

LLVM IR (-O0):
define i32 @removeContinuumInplace(i32 %0, double* %1, double* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store double* %1, double** %7
store double* %2, double** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load double*, double** %7
%13 = load double*, double** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = load double*, double** %8
%17 = call i32 @removeContinuum(i32 %11, double* %12, double* %13, i32 %14, i32 %15, double* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @removeContinuumInplace(i32 %0, double* %1, double* %2, i32 %3, i32 %4) {
%6 = tail call i32 @removeContinuum(i32 %0, double* %1, double* %2, i32 %3, i32 %4, double* %2)
ret i32 %6
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int top_bit(uint16_t w, int bits) {
  if (bits == 16)
    return ((w & 0x8000) != 0);
  else
    return ((w & 0x80) != 0);
}


x86 assembly (clang, -O0):
<top_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jne    112f <top_bit+0x2f>
mov    -0x8(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <top_bit+0x45>
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<top_bit>:
mov    %edi,%eax
cmp    $0x10,%esi
sete   %cl
shl    $0x3,%cl
or     $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @top_bit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 16
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = and i32 %9, 32768
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %3
br label %18
13: ; preds = %2
%14 = load i32, i32* %4
%15 = and i32 %14, 128
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @top_bit(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 16
%4 = select i1 %3, i32 15, i32 7
%5 = lshr i32 %0, %4
%6 = and i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x0c() {
  Assert_real((isalnum(12) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              65, ("isalnum should be 0 for 0x0c"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x0c\00"
define void @t_isalnum_0x0c() {
%1 = tail call i64 @isalnum(i32 12)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 65, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glColor3s(short, short, short);
void Color3s(short r, short g, short b) { glColor3s(r, g, b); }


x86 assembly (clang, -O0):
<Color3s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x4(%rbp),%ax
movswl %cx,%edi
movswl %ax,%esi
movswl -0x6(%rbp),%edx
call   1030 <glColor3s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Color3s>:
jmp    1030 <glColor3s@plt>

LLVM IR (-O0):
define void @Color3s(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = load i16, i16* %5
%9 = load i16, i16* %6
%10 = call i32 @glColor3s(i16 signext %7, i16 signext %8, i16 signext %9)
ret void
}

LLVM IR (-O2):
define void @Color3s(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = tail call i32 @glColor3s(i16 signext %0, i16 signext %1, i16 signext %2)
ret void
}
void SIO1_resume(void) {}


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

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

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

LLVM IR (-O2):
define void @SIO1_resume() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void __attribute__((weak)) usr_mlme_poll_conf(uint8_t status) {
  status = status;
}


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

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

LLVM IR (-O0):
define weak void @usr_mlme_poll_conf(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 weak void @usr_mlme_poll_conf(i32 %0) {
ret void
}
int pause(void) {
  long __res;
  __asm__ volatile("int $0x80" : "=a"(__res) : "0"(29));
  do {
    return (int)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1d,%eax
int    $0x80
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
mov    $0x1d,%eax
int    $0x80
ret

LLVM IR (-O0):
define i32 @pause() {
%1 = alloca i64
%2 = call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 29)
store i64 %2, i64* %1
br label %3
3: ; preds = %0
%4 = load i64, i64* %1
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @pause() {
%1 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 29)
%2 = trunc i64 %1 to i32
ret i32 %2
}
int toupper(c)
register int c;
{
  if (c >= 'a' && c <= 'z')
    c += 'A' - 'a';
  return (c);
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1124 <toupper+0x24>
cmpl   $0x7a,-0x4(%rbp)
jg     1124 <toupper+0x24>
mov    -0x4(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned int stb_fget_varlenu(int /*<<< orphan*/ *);
int stb_fget_varlen(FILE *f) {
  unsigned int z = stb_fget_varlenu(f);
  return (z & 1) ? ~(z >> 1) : (z >> 1);
}


x86 assembly (clang, -O0):
<stb_fget_varlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <stb_fget_varlenu@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1148 <stb_fget_varlen+0x38>
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1151 <stb_fget_varlen+0x41>
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_fget_varlen>:
push   %rax
call   1030 <stb_fget_varlenu@plt>
mov    %eax,%ecx
shr    %ecx
and    $0x1,%eax
neg    %eax
xor    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @stb_fget_varlen(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @stb_fget_varlenu(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = lshr i32 %10, 1
%12 = xor i32 %11, -1
br label %16
13: ; preds = %1
%14 = load i32, i32* %3
%15 = lshr i32 %14, 1
br label %16
16: ; preds = %13, %9
%17 = phi i32 [ %12, %9 ], [ %15, %13 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @stb_fget_varlen(i32* %0) {
%2 = tail call i32 @stb_fget_varlenu(i32* %0)
%3 = lshr i32 %2, 1
%4 = and i32 %2, 1
%5 = sub nsw i32 0, %4
%6 = xor i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ss2srm(int);
void ss2srm_(int *mode) { ss2srm(*mode); }


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

x86 assembly (clang, -O2):
<ss2srm_>:
mov    (%rdi),%edi
jmp    1030 <ss2srm@plt>

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

LLVM IR (-O2):
define void @ss2srm_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @ss2srm(i32 %2)
ret void
}
/* Variables and functions */
int fls(unsigned int);
unsigned int align_power2(unsigned int u) { return 1 << fls(u - 1); }


x86 assembly (clang, -O0):
<align_power2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <fls@plt>
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_power2>:
push   %rax
add    $0xffffffff,%edi
call   1030 <fls@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
mov    %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @align_power2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 1
%5 = call i32 @fls(i32 %4)
%6 = shl i32 1, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @align_power2(i32 %0) {
%2 = add i32 %0, -1
%3 = tail call i32 @fls(i32 %2)
%4 = shl nuw i32 1, %3
ret i32 %4
}
/* Variables and functions */
size_t strlen(const char *str) {
  const char *tmp;
  for (tmp = str; *tmp != '\0'; tmp++)
    ;
  return tmp - str;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
jmp    1125 <strlen+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
int ath79_register_pci(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ath79_register_pci() {
ret i32 0
}
unsigned long insert_ral(unsigned long insn, long value, const char **errmsg) {
  if (value == 0 || value == ((insn >> 21) & 0x1f))
    *errmsg = "invalid register operand when updating";
  return insn | ((value & 0x1f) << 16);
}


x86 assembly (clang, -O0):
<insert_ral>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <insert_ral+0x34>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x15,%rcx
and    $0x1f,%rcx
cmp    %rcx,%rax
jne    1142 <insert_ral+0x42>
mov    -0x18(%rbp),%rax
lea    0xec1(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_ral>:
mov    %rsi,%rax
test   %rsi,%rsi
je     1115 <insert_ral+0x15>
mov    %edi,%ecx
shr    $0x15,%ecx
and    $0x1f,%ecx
cmp    %rax,%rcx
jne    111f <insert_ral+0x1f>
lea    0xee4(%rip),%rcx
mov    %rcx,(%rdx)
and    $0x1f,%eax
shl    $0x10,%rax
or     %rdi,%rax
ret

LLVM IR (-O0):
@.str = [39 x i8] c"invalid register operand when updating\00"
define i64 @insert_ral(i64 %0, i64 %1, i8** %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8**
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%7 = load i64, i64* %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %3
%10 = load i64, i64* %5
%11 = load i64, i64* %4
%12 = lshr i64 %11, 21
%13 = and i64 %12, 31
%14 = icmp eq i64 %10, %13
br i1 %14, label %15, label %17
15: ; preds = %9, %3
%16 = load i8**, i8*** %6
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8** %16
br label %17
17: ; preds = %15, %9
%18 = load i64, i64* %4
%19 = load i64, i64* %5
%20 = and i64 %19, 31
%21 = shl i64 %20, 16
%22 = or i64 %18, %21
ret i64 %22
}

LLVM IR (-O2):
@.str = [39 x i8] c"invalid register operand when updating\00"
define i64 @insert_ral(i64 %0, i64 %1, i8** nocapture writeonly %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = lshr i64 %0, 21
%7 = and i64 %6, 31
%8 = icmp eq i64 %7, %1
br i1 %8, label %9, label %10
9: ; preds = %5, %3
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %9, %5
%11 = shl i64 %1, 16
%12 = and i64 %11, 2031616
%13 = or i64 %12, %0
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ consoleClearAfterCmdDefaultMsg();
int /*<<< orphan*/ consoleGetHistory();
int /*<<< orphan*/ consolePrint(char *);
int /*<<< orphan*/ consolePrintLinesList(int /*<<< orphan*/);
void consoleCmdHistory() {
  consolePrint("--- History of commands ---");
  consolePrintLinesList(consoleGetHistory());
  consoleClearAfterCmdDefaultMsg();
}


x86 assembly (clang, -O0):
<consoleCmdHistory>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <consolePrint@plt>
mov    $0x0,%al
call   1040 <consoleGetHistory@plt>
mov    %eax,%edi
call   1060 <consolePrintLinesList@plt>
mov    $0x0,%al
call   1050 <consoleClearAfterCmdDefaultMsg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<consoleCmdHistory>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <consolePrint@plt>
xor    %eax,%eax
call   1040 <consoleGetHistory@plt>
mov    %eax,%edi
call   1060 <consolePrintLinesList@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <consoleClearAfterCmdDefaultMsg@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"--- History of commands ---\00"
define void @consoleCmdHistory() {
%1 = call i32 @consolePrint(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @consoleGetHistory()
%3 = call i32 @consolePrintLinesList(i32 %2)
%4 = call i32 (...) @consoleClearAfterCmdDefaultMsg()
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"--- History of commands ---\00"
define void @consoleCmdHistory() {
%1 = tail call i32 @consolePrint(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @consoleGetHistory()
%3 = tail call i32 @consolePrintLinesList(i32 %2)
%4 = tail call i32 (...) @consoleClearAfterCmdDefaultMsg()
ret void
}
void av_get_channel_description() {}


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

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

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

LLVM IR (-O2):
define void @av_get_channel_description() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr, "%s: <n> <min_hd>\n", argv0);
  fprintf(stderr, "    MAX_N = %d\n", 16);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xede(%rip),%rsi
mov    $0x10,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"%s: <n> <min_hd>\0A\00"
@.str.1 = [16 x i8] c" MAX_N = %d\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 16)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"%s: <n> <min_hd>\0A\00"
@.str.1 = [16 x i8] c" MAX_N = %d\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 16)
ret void
}
adrreg0adrreg1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((p0[10000000]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl 0x1312d00(%rax),%eax
mov    -0x20(%rbp),%rcx
movzwl 0x87a22(%rcx),%ecx
cmp    %ecx,%eax
jg     1149 <adrreg0adrreg1+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <adrreg0adrreg1+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0adrreg1>:
movzwl 0x1312d00(%r8),%ecx
01
xor    %eax,%eax
cmp    0x87a22(%r9),%cx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @adrreg0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = getelementptr inbounds i16, i16* %5, i64 277777
%10 = load i16, i16* %9
%11 = icmp ule i16 %8, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xee() {
  Assert_real((isupper(238) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1195, ("isupper should be 0 for 0xee"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xee\00"
define void @t_isupper_0xee() {
%1 = tail call i64 @isupper(i32 238)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1195, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void rop3_49_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D & stk3;
  stk1 = S | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_49_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)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %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_49_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
or     %al,%cl
not    %cl
and    %al,%sil
and    %dl,%al
or     %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

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

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

/* Variables and functions */
void ror6502(uint8_t *byte, bool *carry) {
  bool old_carry = *carry;
  (*carry) = ((*byte) & 1);
  (*byte) >>= 1;
  if (old_carry)
    (*byte) |= 0x80;
}


x86 assembly (clang, -O0):
<ror6502>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sar    $0x1,%ecx
mov    %ecx,(%rax)
cmpl   $0x0,-0x14(%rbp)
je     1147 <ror6502+0x47>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0x80,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ror6502>:
mov    (%rdi),%eax
and    $0x1,%eax
mov    (%rsi),%ecx
mov    %eax,(%rsi)
mov    (%rdi),%eax
sar    %eax
mov    %eax,%edx
or     $0x80,%edx
test   %ecx,%ecx
cmove  %eax,%edx
mov    %edx,(%rdi)
ret

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

LLVM IR (-O2):
define void @ror6502(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = and i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %0
%7 = ashr i32 %6, 1
%8 = icmp eq i32 %3, 0
%9 = or i32 %7, 128
%10 = select i1 %8, i32 %7, i32 %9
store i32 %10, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tick_handler();
void int_20() { tick_handler(); }


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

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

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

LLVM IR (-O2):
define void @int_20() {
%1 = tail call i32 (...) @tick_handler()
ret void
}
int do_691() { return 691; }


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

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

LLVM IR (-O0):
define i32 @do_691() {
ret i32 691
}

LLVM IR (-O2):
define i32 @do_691() {
ret i32 691
}
int mio_aucat_nfds(struct mio_hdl *sh) { return 1; }


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

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

LLVM IR (-O0):
%struct.mio_hdl = type opaque
define i32 @mio_aucat_nfds(%struct.mio_hdl* %0) {
%2 = alloca %struct.mio_hdl*
store %struct.mio_hdl* %0, %struct.mio_hdl** %2
ret i32 1
}

LLVM IR (-O2):
%struct.mio_hdl = type opaque
define i32 @mio_aucat_nfds(%struct.mio_hdl* nocapture readnone %0) {
ret i32 1
}
int test_imm_69int8_mem(signed char *val) {
  return ((*val) & (-0x69 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_69int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -105
%7 = icmp ne i32 %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_69int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -105
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _testpass();
int /*<<< orphan*/ printf(char *);
main() {
  printf("Hello, World!\n");
  printf("                ");
  _testpass();
}


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

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

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

LLVM IR (-O2):
@.str.1 = [17 x i8] c" \00"
@str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @_testpass()
ret i32 0
}
void gtk_object_sink() {}


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

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

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

LLVM IR (-O2):
define void @gtk_object_sink() {
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
char *find_last_slash(const char *str) {
  const char *slash = strrchr(str, '/');
  return (char *)slash;
}


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

x86 assembly (clang, -O2):
<find_last_slash>:
mov    $0x2f,%esi
jmp    1030 <strrchr@plt>

LLVM IR (-O0):
define i8* @find_last_slash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @find_last_slash(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ ffxmsg(int, char *);
void ffcmsg(void) {
  char *dummy = 0;
  ffxmsg(1, dummy);
  return;
}


x86 assembly (clang, -O0):
<ffcmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <ffxmsg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffcmsg>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <ffxmsg@plt>

LLVM IR (-O0):
define void @ffcmsg() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @ffxmsg(i32 1, i8* %2)
ret void
}

LLVM IR (-O2):
define void @ffcmsg() {
%1 = tail call i32 @ffxmsg(i32 1, i8* null)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  int z;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  z = __VERIFIER_nondet_int();
  while (x > z) {
    while (y > z) {
      y = y - 1;
    }
    x = x - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1176 <main+0x66>
jmp    114e <main+0x3e>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1168 <main+0x58>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114e <main+0x3e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ XFontSetExtents;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XFontSetExtents(void *_p) {
  if (_p == NULL)
    abort();
  free((XFontSetExtents *)_p);
}


x86 assembly (clang, -O0):
<free_XFontSetExtents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XFontSetExtents+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XFontSetExtents>:
test   %rdi,%rdi
je     112a <free_XFontSetExtents+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XFontSetExtents(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XFontSetExtents(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
void addone(int **n) { (**n)++; }


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

x86 assembly (clang, -O2):
<addone>:
mov    (%rdi),%rax
addl   $0x1,(%rax)
ret

LLVM IR (-O0):
define void @addone(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @addone(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long subwindow;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
void set_XButtonReleasedEvent_subwindow(void *_p, unsigned long _v) {
  ((XButtonReleasedEvent *)_p)->subwindow = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XButtonReleasedEvent_subwindow(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int cdiHaveFiletype(int filetype) {
  int status = 0;
  switch (filetype) {
  default: {
    status = 0;
    break;
  }
  }
  return (status);
}


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

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

LLVM IR (-O0):
define i32 @cdiHaveFiletype(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %5 [
]
5: ; preds = %1
store i32 0, i32* %3
br label %6
6: ; preds = %5
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @cdiHaveFiletype(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sdotsub(int const *, float const *, int const *,
                           float const *, int const *, float *);
float c_sdot(const int N, const float *X, const int strideX, const float *Y,
             const int strideY) {
  float dot;
  sdotsub(&N, X, &strideX, Y, &strideY, &dot);
  return dot;
}


x86 assembly (clang, -O0):
<c_sdot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x24(%rbp),%r8
lea    -0x28(%rbp),%r9
call   1030 <sdotsub@plt>
movss  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_sdot>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
lea    0x8(%rsp),%r9
call   1030 <sdotsub@plt>
movss  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define float @c_sdot(i32 %0, float* %1, i32 %2, float* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
store i32 %0, i32* %6
store i32 %2, i32* %7
store i32 %4, i32* %8
%10 = bitcast float* %9 to i8*
%11 = call i32 @sdotsub(i32* %6, float* %1, i32* %7, float* %3, i32* %8, float* %9)
%12 = load float, float* %9
ret float %12
}