xunge/DecIR huggingface dataset:
extern int GetScreenPitch() {
  int retval;
  __asm__ __volatile__("int $0x40" : "=a"(retval) : "a"(61), "b"(3));
  return retval;
}


x86 assembly (clang, -O0):
<GetScreenPitch>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x3d,%eax
mov    $0x3,%ebx
int    $0x40
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetScreenPitch>:
push   %rbx
mov    $0x3d,%eax
mov    $0x3,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i32 @GetScreenPitch() {
%1 = alloca i32
%2 = call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 61, i32 3)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @GetScreenPitch() {
%1 = tail call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 61, i32 3)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void Sys_EndStreamedFile(FILE *f) {}


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

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

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

LLVM IR (-O2):
define void @Sys_EndStreamedFile(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notimplemented(char *);
void __svgalib_driver32p_copybox(int x1, int y1, int w, int h, int x2, int y2) {
  {
    notimplemented("32-bit paged copybox");
    return;
  };
}


x86 assembly (clang, -O0):
<__svgalib_driver32p_copybox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <notimplemented@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"32-bit paged copybox\00"
define void @__svgalib_driver32p_copybox(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = call i32 @notimplemented(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"32-bit paged copybox\00"
define void @__svgalib_driver32p_copybox(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @notimplemented(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int getpid();
int /*<<< orphan*/ stderr;
void sig_usr1(int signum) {
  fprintf(stderr, "fils:%d: fin due à la reception du signal SIGUSR1\n",
          getpid());
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<sig_usr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%edx
lea    0xea6(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sig_usr1>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"fils:%d: fin due \C3\A0 la reception du signal SIGUSR1\0A\00"
@EXIT_FAILURE = global i32 0
define void @sig_usr1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 (...) @getpid()
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"fils:%d: fin due \C3\A0 la reception du signal SIGUSR1\0A\00"
@EXIT_FAILURE = global i32 0
define void @sig_usr1(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
void RTMemPageFree(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemPageFree() {
ret void
}
int lenItoA(int i) {
  int len = 0;
  if (i < 0) {
    len++;
    i = -i;
  }
  do {
    len++;
    i /= 10;
  } while (i);
  return len;
}


x86 assembly (clang, -O0):
<lenItoA>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1129 <lenItoA+0x29>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112e <lenItoA+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112e <lenItoA+0x2e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lenItoA>:
mov    %edi,%eax
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
shr    $0x1f,%eax
nopl   0x0(%rax)
add    $0x1,%eax
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    $0x9,%edx
cmp    $0x12,%edx
ja     1110 <lenItoA+0x10>
ret

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

LLVM IR (-O2):
define i32 @lenItoA(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = lshr i32 %0, 31
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ %2, %1 ], [ %8, %4 ]
%6 = phi i32 [ %3, %1 ], [ %7, %4 ]
%7 = add nuw nsw i32 %6, 1
%8 = sdiv i32 %5, 10
%9 = add i32 %5, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func_PrintIntList(void *id) {
  int *table = (int *)id;
  printf("%i\n", *table);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define void @func_PrintIntList(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int *return_depends_on_lshift(int x, int *p) {
  if (x < (1 << 7))
    return 0;
  else
    return p;
}


x86 assembly (clang, -O0):
<return_depends_on_lshift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    1125 <return_depends_on_lshift+0x25>
movq   $0x0,-0x8(%rbp)
jmp    112d <return_depends_on_lshift+0x2d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_depends_on_lshift>:
xor    %eax,%eax
cmp    $0x80,%edi
cmovge %rsi,%rax
ret

LLVM IR (-O0):
define i32* @return_depends_on_lshift(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* %4
%7 = icmp slt i32 %6, 128
br i1 %7, label %8, label %9
8: ; preds = %2
store i32* null, i32** %3
br label %11
9: ; preds = %2
%10 = load i32*, i32** %5
store i32* %10, i32** %3
br label %11
11: ; preds = %9, %8
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
define i32* @return_depends_on_lshift(i32 %0, i32* readnone %1) {
%3 = icmp slt i32 %0, 128
%4 = select i1 %3, i32* null, i32* %1
ret i32* %4
}
void __attribute__((retain)) f0(void) {}


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

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

LLVM IR (-O0):
@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @f0 to i8*)], section "llvm.metadata"
define void @f0() {
ret void
}

LLVM IR (-O2):
@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @f0 to i8*)], section "llvm.metadata"
define void @f0() {
ret void
}
sc() {
  __asm__("movl $1111,%eax\n\t"
          "int $0x80\n\t");
}


x86 assembly (clang, -O0):
<sc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x457,%eax
int    $0x80
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sc() {
tail call void asm sideeffect "movl $$1111,%eax\0A\09int $$0x80\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  if (argc == 2) {
    printf("hello,%s\n", argv[1]);
  } else {
    printf("hello, world\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    114b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1159 <main+0x49>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    113a <main+0x1a>
mov    0x8(%rsi),%rsi
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1146 <main+0x26>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"hello,%s\0A\00"
@.str.1 = [14 x i8] c"hello, world\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [10 x i8] c"hello,%s\0A\00"
@str = [13 x i8] c"hello, world\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %4
ret i32 0
}
void pick_cntrl_str(char *s) {
  char *dst;
  for (dst = s; *s != '\0'; s++) {
    if ((*s < 0) || (0x20 <= *s)) {
      *dst = *s;
      dst++;
    }
  }
  *dst = '\0';
}


x86 assembly (clang, -O0):
<pick_cntrl_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1172 <pick_cntrl_str+0x72>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jl     1144 <pick_cntrl_str+0x44>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x20,%eax
cmp    %ecx,%eax
jg     115c <pick_cntrl_str+0x5c>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1161 <pick_cntrl_str+0x61>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <pick_cntrl_str+0x10>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pick_cntrl_str>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <pick_cntrl_str+0x28>
lea    0x1(%rdi),%rax
jmp    111b <pick_cntrl_str+0x1b>
nopl   0x0(%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1128 <pick_cntrl_str+0x28>
cmp    $0x20,%cl
jb     1110 <pick_cntrl_str+0x10>
mov    %cl,(%rdi)
add    $0x1,%rdi
jmp    1110 <pick_cntrl_str+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @pick_cntrl_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %14, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = phi i8* [ %13, %11 ], [ %0, %1 ]
%8 = icmp ugt i8 %5, 31
br i1 %8, label %9, label %11
9: ; preds = %4
store i8 %5, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 1
br label %11
11: ; preds = %4, %9
%12 = phi i8* [ %10, %9 ], [ %6, %4 ]
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %11, %1
%17 = phi i8* [ %0, %1 ], [ %12, %11 ]
store i8 0, i8* %17
ret void
}
long shift_left(long v, char n) { return v >> n; }


x86 assembly (clang, -O0):
<shift_left>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl -0x9(%rbp),%ecx
mov    %ecx,%ecx
sar    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_left>:
mov    %esi,%ecx
mov    %rdi,%rax
sar    %cl,%rax
ret

LLVM IR (-O0):
define i64 @shift_left(i64 %0, i8 signext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = zext i32 %7 to i64
%9 = ashr i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @shift_left(i64 %0, i8 signext %1) {
%3 = sext i8 %1 to i64
%4 = and i64 %3, 4294967295
%5 = ashr i64 %0, %4
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ responseCode;

/* Variables and functions */
int /*<<< orphan*/ send(int, int *, int, int /*<<< orphan*/);
void handle_put(int fd) {
  int responseCode = 2;
  send(fd, &responseCode, sizeof(responseCode), 0);
}


x86 assembly (clang, -O0):
<handle_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_put>:
push   %rax
movl   $0x2,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @handle_put(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%4 = call i32 @send(i32 %0, i32* %2, i32 4, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void fan_motor_set_pwm(void *fan_address, unsigned int pwm) {
  *((volatile int *)fan_address + 2) = pwm;
  usleep(50);
}


x86 assembly (clang, -O0):
<fan_motor_set_pwm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    $0x32,%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fan_motor_set_pwm>:
mov    %esi,0x8(%rdi)
mov    $0x32,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @fan_motor_set_pwm(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 2
store volatile i32 %5, i32* %8
%9 = call i32 @usleep(i32 50)
ret void
}

LLVM IR (-O2):
define void @fan_motor_set_pwm(i8* %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 8
%4 = bitcast i8* %3 to i32*
store volatile i32 %1, i32* %4
%5 = tail call i32 @usleep(i32 50)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int unicode_write_utf32be(int /*<<< orphan*/, char *);
int unicode_write_utf32(uint32_t code_point, char *string) {
  return unicode_write_utf32be(code_point, string);
}


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

x86 assembly (clang, -O2):
<unicode_write_utf32>:
jmp    1030 <unicode_write_utf32be@plt>

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

LLVM IR (-O2):
define i32 @unicode_write_utf32(i32 %0, i8* %1) {
%3 = tail call i32 @unicode_write_utf32be(i32 %0, i8* %1)
ret i32 %3
}
void SysTickEnable(void) {
  (*((volatile unsigned long *)(0xE000E010))) |= 0x00000004 | 0x00000001;
}


x86 assembly (clang, -O0):
<SysTickEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e010,%eax
mov    (%rax),%rcx
or     $0x5,%rcx
mov    $0xe000e010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysTickEnable>:
mov    $0xe000e010,%eax
orq    $0x5,(%rax)
ret

LLVM IR (-O0):
define void @SysTickEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = or i64 %1, 5
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysTickEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = or i64 %1, 5
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
ret void
}
/* Variables and functions */
scalar_t__ __d_parse_noun(char *, int *);
int _d_parse_noun(char *v, int l, void *s) {
  int n;
  if (__d_parse_noun(v, &n))
    return -1;
  *(int *)s = n;
  return 0;
}


x86 assembly (clang, -O0):
<_d_parse_noun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1030 <__d_parse_noun@plt>
cmp    $0x0,%rax
je     1146 <_d_parse_noun+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <_d_parse_noun+0x46>
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_d_parse_noun>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
lea    0xc(%rsp),%rsi
call   1030 <__d_parse_noun@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1137 <_d_parse_noun+0x27>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_d_parse_noun(i8* %0, i32 %1, i8* nocapture writeonly %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i64 @__d_parse_noun(i8* %0, i32* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* %4
%10 = bitcast i8* %2 to i32*
store i32 %9, i32* %10
br label %11
11: ; preds = %3, %8
%12 = phi i32 [ 0, %8 ], [ -1, %3 ]
ret i32 %12
}
/* Variables and functions */
int consoleGetHistoryMaxCount();
int consoleCmdGetHistory() { return consoleGetHistoryMaxCount(); }


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

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

LLVM IR (-O0):
define i32 @consoleCmdGetHistory() {
%1 = call i32 (...) @consoleGetHistoryMaxCount()
ret i32 %1
}

LLVM IR (-O2):
define i32 @consoleCmdGetHistory() {
%1 = tail call i32 (...) @consoleGetHistoryMaxCount()
ret i32 %1
}
/* Variables and functions */
int f287(int *);
int f288(int *p) { return f287(p); }


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

x86 assembly (clang, -O2):
<f288>:
jmp    1030 <f287@plt>

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

LLVM IR (-O2):
define i32 @f288(i32* %0) {
%2 = tail call i32 @f287(i32* %0)
ret i32 %2
}
void multidim_arr1_Good() {
  int a[2][3];
  a[1][0] = 0;
}


x86 assembly (clang, -O0):
<multidim_arr1_Good>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @multidim_arr1_Good() {
%1 = alloca [2 x [3 x i32]]
%2 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 1
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32 0, i32* %3
ret void
}

LLVM IR (-O2):
define void @multidim_arr1_Good() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xa8() {
  Assert_real((islower(168) == 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_islower.c",
              845, ("islower should be 0 for 0xa8"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xa8>:
push   %rax
mov    $0xa8,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x34d,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xa8\00"
define void @t_islower_0xa8() {
%1 = call i64 @islower(i32 168)
%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 845, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xa8\00"
define void @t_islower_0xa8() {
%1 = tail call i64 @islower(i32 168)
%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 845, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void _pei386_runtime_relocator() { return; }


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

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

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

LLVM IR (-O2):
define void @_pei386_runtime_relocator() {
ret void
}
/* Variables and functions */
scalar_t__ a_cas(int volatile *, int, int);
void *a_cas_p(volatile void *p, void *t, void *s) {
  return (void *)a_cas((volatile int *)p, (int)t, (int)s);
}


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

x86 assembly (clang, -O2):
<a_cas_p>:
jmp    1030 <a_cas@plt>

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

LLVM IR (-O2):
define i8* @a_cas_p(i8* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %0 to i32*
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = ptrtoint i8* %2 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i64 @a_cas(i32* %4, i32 %6, i32 %8)
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
/* Type definitions */
struct cpuusage_jiffies_stat {
  int dummy;
};

/* Variables and functions */
struct cpuusage_jiffies_stat *proc_get_total_jiffies_stat();
struct cpuusage_jiffies_stat *cpuusage_get_total_jiffies_stat() {
  struct cpuusage_jiffies_stat *jiffies_stat = NULL;
  jiffies_stat = proc_get_total_jiffies_stat();
  return jiffies_stat;
}


x86 assembly (clang, -O0):
<cpuusage_get_total_jiffies_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <proc_get_total_jiffies_stat@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cpuusage_jiffies_stat = type { i32 }
define %struct.cpuusage_jiffies_stat* @cpuusage_get_total_jiffies_stat() {
%1 = alloca %struct.cpuusage_jiffies_stat*
store %struct.cpuusage_jiffies_stat* null, %struct.cpuusage_jiffies_stat** %1
%2 = call %struct.cpuusage_jiffies_stat* (...) @proc_get_total_jiffies_stat()
store %struct.cpuusage_jiffies_stat* %2, %struct.cpuusage_jiffies_stat** %1
%3 = load %struct.cpuusage_jiffies_stat*, %struct.cpuusage_jiffies_stat** %1
ret %struct.cpuusage_jiffies_stat* %3
}

LLVM IR (-O2):
%struct.cpuusage_jiffies_stat = type { i32 }
define %struct.cpuusage_jiffies_stat* @cpuusage_get_total_jiffies_stat() {
%1 = tail call %struct.cpuusage_jiffies_stat* (...) @proc_get_total_jiffies_stat()
ret %struct.cpuusage_jiffies_stat* %1
}
/* Variables and functions */
unsigned char *fptr_capi20_get_manufacturer(unsigned int, unsigned char *);
scalar_t__ loadlib();
unsigned char *capi20_get_manufacturer(unsigned Ctrl, unsigned char *Buf) {
  if (loadlib() < 0)
    return "";
  return fptr_capi20_get_manufacturer(Ctrl, Buf);
}


x86 assembly (clang, -O0):
<capi20_get_manufacturer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x0,%al
call   1030 <loadlib@plt>
cmp    $0x0,%rax
jge    1150 <capi20_get_manufacturer+0x30>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <capi20_get_manufacturer+0x40>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <fptr_capi20_get_manufacturer@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capi20_get_manufacturer>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <loadlib@plt>
test   %rax,%rax
js     1144 <capi20_get_manufacturer+0x24>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fptr_capi20_get_manufacturer@plt>
lea    0xeb5(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @capi20_get_manufacturer(i32 %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = call i64 (...) @loadlib()
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = call i8* @fptr_capi20_get_manufacturer(i32 %10, i8* %11)
store i8* %12, i8** %3
br label %13
13: ; preds = %9, %8
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @capi20_get_manufacturer(i32 %0, i8* %1) {
%3 = tail call i64 (...) @loadlib()
%4 = icmp slt i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @fptr_capi20_get_manufacturer(i32 %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %2 ]
ret i8* %8
}
void DRV_AT_SETAPPDAILMODE(unsigned int ulStatus) { return; }


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

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

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

LLVM IR (-O2):
define void @DRV_AT_SETAPPDAILMODE(i32 %0) {
ret void
}
void BIO_number_read(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_number_read() {
ret void
}
int occurrenceLast(char a[], char b[]) {
  int i, m;
  for (i = 0; a[i] != '\0'; i++) {
    if (a[i] == b[0])
      m = i;
  }
  return m;
}


x86 assembly (clang, -O0):
<occurrenceLast>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115c <occurrenceLast+0x5c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1149 <occurrenceLast+0x49>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    114e <occurrenceLast+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <occurrenceLast+0x13>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<occurrenceLast>:
mov    (%rdi),%dl
test   %dl,%dl
je     1123 <occurrenceLast+0x23>
mov    (%rsi),%cl
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
cmp    %cl,%dl
cmove  %esi,%eax
movzbl 0x1(%rdi,%rsi,1),%edx
add    $0x1,%rsi
test   %dl,%dl
jne    1110 <occurrenceLast+0x10>
ret
ret

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

LLVM IR (-O2):
define i32 @occurrenceLast(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = load i8, i8* %1
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %14, %7 ]
%9 = phi i8 [ %3, %5 ], [ %16, %7 ]
%10 = phi i32 [ undef, %5 ], [ %13, %7 ]
%11 = icmp eq i8 %9, %6
%12 = trunc i64 %8 to i32
%13 = select i1 %11, i32 %12, i32 %10
%14 = add nuw nsw i64 %8, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %7
18: ; preds = %7, %2
%19 = phi i32 [ undef, %2 ], [ %13, %7 ]
ret i32 %19
}
void arch_reset(int mode, const char *cmd) {
  printk("RESTART_DEBUG : "
         "%s->%s->%d->mode=%c cmd=%s"
         "\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/371816210/kk44/refs/heads/3.0.8/arch/arm/"
         "mach-rk29/include/mach/system.h",
         __FUNCTION__, 34, mode, cmd);
  rk29_arch_reset(mode, cmd);
}


x86 assembly (clang, -O0):
<arch_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%r8d
mov    -0x10(%rbp),%r9
lea    0xec2(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xf83(%rip),%rdx
mov    $0x22,%ecx
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <rk29_arch_reset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_reset>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
lea    0xef6(%rip),%rsi
lea    0xf92(%rip),%rdx
mov    $0x22,%ecx
mov    %ebp,%r8d
mov    %rbx,%r9
xor    %eax,%eax
call   1030 <printk@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <rk29_arch_reset@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"RESTART_DEBUG : %s->%s->%d->mode=%c cmd=%s\0A\00"
@.str.1 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/371816210/kk44/refs/heads/3.0.8/arch/arm/mach-rk29/include/mach/system.h\00"
@__FUNCTION__.arch_reset = [11 x i8] c"arch_reset\00"
define void @arch_reset(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i8*, i32, i32, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i8*, i32, i32, i8*, ...)*)(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.arch_reset, i64 0, i64 0), i32 34, i32 %5, i8* %6)
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @rk29_arch_reset to i32 (i32, i8*, ...)*)(i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"RESTART_DEBUG : %s->%s->%d->mode=%c cmd=%s\0A\00"
@.str.1 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/371816210/kk44/refs/heads/3.0.8/arch/arm/mach-rk29/include/mach/system.h\00"
@__FUNCTION__.arch_reset = [11 x i8] c"arch_reset\00"
define void @arch_reset(i32 %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, i32, i32, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i8*, i32, i32, i8*, ...)*)(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.arch_reset, i64 0, i64 0), i32 34, i32 %0, i8* %1)
%4 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @rk29_arch_reset to i32 (i32, i8*, ...)*)(i32 %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
int pthread_mutex_lock(int /*<<< orphan*/ *);
void d_mutex_lock(pthread_mutex_t *mutex, char *line) {
  int rv = pthread_mutex_lock(mutex);
  if (rv != 0) {
    printf("error: %s: pthread_mutex_lock == %d\n", line, rv);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<d_mutex_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1173 <d_mutex_lock+0x43>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_mutex_lock>:
push   %rbx
mov    %rsi,%rbx
call   1050 <pthread_mutex_lock@plt>
test   %eax,%eax
jne    113f <d_mutex_lock+0xf>
pop    %rbx
ret
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"error: %s: pthread_mutex_lock == %d\0A\00"
define void @d_mutex_lock(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i32*, i32** %3
%7 = call i32 @pthread_mutex_lock(i32* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"error: %s: pthread_mutex_lock == %d\0A\00"
define void @d_mutex_lock(i32* %0, i8* %1) {
%3 = tail call i32 @pthread_mutex_lock(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %3)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
int test_imm_46uint16_reg(unsigned short val) {
  return ((val) & (-0x46 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_46uint16_reg>:
test   $0xffba,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_46uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -70
%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_46uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -70
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("ola mundo\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"ola mundo\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"ola mundo\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_MediaServer_ConnectionManager_GetProtocolInfo(void *, char *,
                                                           char *);
int /*<<< orphan*/ printf(char *);
void UpnpMediaServer_ConnectionManager_GetProtocolInfo(void *upnptoken) {
  printf("Invoke: UpnpMediaServer_ConnectionManager_GetProtocolInfo();\r\n");
  UpnpResponse_MediaServer_ConnectionManager_GetProtocolInfo(
      upnptoken, "Sample String", "Sample String");
}


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

x86 assembly (clang, -O2):
<UpnpMediaServer_ConnectionManager_GetProtocolInfo>:
push   %rbx
mov    %rdi,%rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdx
mov    %rbx,%rdi
mov    %rdx,%rsi
pop    %rbx
jmp    1040 <UpnpResponse_MediaServer_ConnectionManager_GetProtocolInfo@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"Invoke: UpnpMediaServer_ConnectionManager_GetProtocolInfo();\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UpnpMediaServer_ConnectionManager_GetProtocolInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @UpnpResponse_MediaServer_ConnectionManager_GetProtocolInfo(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Sample String\00"
@str = [62 x i8] c"Invoke: UpnpMediaServer_ConnectionManager_GetProtocolInfo();\0D\00"
define void @UpnpMediaServer_ConnectionManager_GetProtocolInfo(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @UpnpResponse_MediaServer_ConnectionManager_GetProtocolInfo(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char num = 95;
  char num2;
  num2 = 'D';
  printf("%c,%c\n", num, num2);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c,%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext 95, i8 signext 68)
ret i32 0
}