xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *);
int main(int argc, char **argv) {
  char buf[5];
  snprintf(buf, 50, "Que tipo de error de memoria soy");
  printf("%s\n", buf);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x15(%rbp),%rdi
mov    $0x32,%esi
lea    0xeba(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x15(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdx
lea    0xb(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x32,%esi
call   1040 <snprintf@plt>
lea    0xedc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Que tipo de error de memoria soy\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%8 = call i32 @snprintf(i8* %7, i32 50, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 1
}

LLVM IR (-O2):
@.str = [33 x i8] c"Que tipo de error de memoria soy\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 50, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}
void reverse(char str[], int start, int end) {
  if (start >= end) {
    return;
  }
  char temp = str[start];
  str[start] = str[end];
  str[end] = temp;
  reverse(str, start + 1, end - 1);
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1133 <reverse+0x23>
jmp    117a <reverse+0x6a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
call   1030 <reverse@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    %edx,%esi
jge    1131 <reverse+0x31>
movslq %edx,%rax
movslq %esi,%rcx
add    $0xffffffffffffffff,%rax
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%esi
movzbl 0x1(%rdi,%rax,1),%edx
mov    %dl,(%rdi,%rcx,1)
mov    %sil,0x1(%rdi,%rax,1)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define void @reverse(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %15, %8 ]
%10 = phi i64 [ %6, %5 ], [ %16, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %10
%14 = load i8, i8* %13
store i8 %14, i8* %11
store i8 %12, i8* %13
%15 = add nsw i64 %9, 1
%16 = add nsw i64 %10, -1
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void idrnet_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<idrnet_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @idrnet_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int MenuFontToHandle(int);
int trap_R_Font_HeightPixels(int, float);
int Text_Height(const char *text, float scale, int iMenuFont) {
  int iFontIndex = MenuFontToHandle(iMenuFont);
  return trap_R_Font_HeightPixels(iFontIndex, scale);
}


x86 assembly (clang, -O0):
<Text_Height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <MenuFontToHandle@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
movss  -0xc(%rbp),%xmm0
call   1030 <trap_R_Font_HeightPixels@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Text_Height>:
push   %rax
mov    %esi,%edi
movss  %xmm0,0x4(%rsp)
call   1040 <MenuFontToHandle@plt>
mov    %eax,%edi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <trap_R_Font_HeightPixels@plt>

LLVM IR (-O0):
define i32 @Text_Height(i8* %0, float %1, i32 %2) {
%4 = alloca i8*
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store float %1, float* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @MenuFontToHandle(i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load float, float* %5
%12 = call i32 @trap_R_Font_HeightPixels(i32 %10, float %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @Text_Height(i8* nocapture readnone %0, float %1, i32 %2) {
%4 = tail call i32 @MenuFontToHandle(i32 %2)
%5 = tail call i32 @trap_R_Font_HeightPixels(i32 %4, float %1)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *popen(char const *, char *);
FILE *piperead(const char *cmd) { return popen(cmd, "r"); }


x86 assembly (clang, -O0):
<piperead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <popen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piperead>:
lea    0xee9(%rip),%rsi
jmp    1030 <popen@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i32* @piperead(i8* nocapture %0) {
%2 = tail call i32* @popen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
/* Type definitions */
struct Mutex {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ my_unlock();
int /*<<< orphan*/ pthread_mutex_unlock();
int foo(int i, int j, struct Mutex *mu) {
  int *q;
  int t = *q;
  *q = 4;
  pthread_mutex_unlock();
  my_unlock();
  return t;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    $0x0,%al
call   1040 <pthread_mutex_unlock@plt>
mov    $0x0,%al
call   1030 <my_unlock@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
%struct.Mutex = type { i32 }
define i32 @foo(i32 %0, i32 %1, %struct.Mutex* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.Mutex*
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.Mutex* %2, %struct.Mutex** %6
%9 = load i32*, i32** %7
%10 = load i32, i32* %9
store i32 %10, i32* %8
%11 = load i32*, i32** %7
store i32 4, i32* %11
%12 = call i32 (...) @pthread_mutex_unlock()
%13 = call i32 (...) @my_unlock()
%14 = load i32, i32* %8
ret i32 %14
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ vafunction(char *, int, int, int, int, int, int, int, int,
                              int, int, int, int, int, int, int, int, int, int);
int main(void) {
  vafunction("", 1, 2., 3, 4., 5, 6., 7, 8., 9, 10., 11, 12., 13, 14., 15, 16.,
             17, 18.);
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
movl   $0x6,(%rsp)
movl   $0x7,0x8(%rsp)
movl   $0x8,0x10(%rsp)
movl   $0x9,0x18(%rsp)
movl   $0xa,0x20(%rsp)
movl   $0xb,0x28(%rsp)
movl   $0xc,0x30(%rsp)
movl   $0xd,0x38(%rsp)
movl   $0xe,0x40(%rsp)
movl   $0xf,0x48(%rsp)
movl   $0x10,0x50(%rsp)
movl   $0x11,0x58(%rsp)
movl   $0x12,0x60(%rsp)
call   1030 <vafunction@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
lea    0xed4(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
push   $0x12
push   $0x11
push   $0x10
push   $0xf
push   $0xe
push   $0xd
push   $0xc
push   $0xb
push   $0xa
push   $0x9
push   $0x8
push   $0x7
push   $0x6
call   1030 <vafunction@plt>
add    $0x70,%rsp
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @vafunction(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @vafunction(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18)
%2 = tail call i32 @exit(i32 0)
unreachable
}
void bch_btree_verify(struct btree *b, struct bset *i) {}


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

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

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

LLVM IR (-O2):
%struct.btree = type opaque
%struct.bset = type opaque
define void @bch_btree_verify(%struct.btree* nocapture %0, %struct.bset* nocapture %1) {
ret void
}
int main() {
  int i;
  i = 0;
  return 0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ print_bytes(char const *, int /*<<< orphan*/ const *,
                               unsigned int, char *);
void println_bytes(const char m[], const uint8_t *buf, unsigned int size) {
  print_bytes(m, buf, size, "\n");
}


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

x86 assembly (clang, -O2):
<println_bytes>:
lea    0xee9(%rip),%rcx
jmp    1030 <print_bytes@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @println_bytes(i8* %0, i32* %1, i32 %2) {
%4 = tail call i32 @print_bytes(i8* %0, i32* %1, i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float **newmat(int);
float **mat_translate(float tx, float ty, float tz) {
  float **mat = newmat(1);
  mat[0][3] = tx;
  mat[1][3] = ty;
  mat[2][3] = tz;
  return mat;
}


x86 assembly (clang, -O0):
<mat_translate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <newmat@plt>
mov    %rax,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movss  %xmm0,0xc(%rax)
movss  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
movss  %xmm0,0xc(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
movss  %xmm0,0xc(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_translate>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
mov    $0x1,%edi
call   1030 <newmat@plt>
mov    (%rax),%rcx
movss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rcx)
mov    0x8(%rax),%rcx
movss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rcx)
mov    0x10(%rax),%rcx
movss  0x14(%rsp),%xmm0
movss  %xmm0,0xc(%rcx)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float** @mat_translate(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float**
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = call float** @newmat(i32 1)
store float** %8, float*** %7
%9 = load float, float* %4
%10 = load float**, float*** %7
%11 = getelementptr inbounds float*, float** %10, i64 0
%12 = load float*, float** %11
%13 = getelementptr inbounds float, float* %12, i64 3
store float %9, float* %13
%14 = load float, float* %5
%15 = load float**, float*** %7
%16 = getelementptr inbounds float*, float** %15, i64 1
%17 = load float*, float** %16
%18 = getelementptr inbounds float, float* %17, i64 3
store float %14, float* %18
%19 = load float, float* %6
%20 = load float**, float*** %7
%21 = getelementptr inbounds float*, float** %20, i64 2
%22 = load float*, float** %21
%23 = getelementptr inbounds float, float* %22, i64 3
store float %19, float* %23
%24 = load float**, float*** %7
ret float** %24
}

LLVM IR (-O2):
define float** @mat_translate(float %0, float %1, float %2) {
%4 = tail call float** @newmat(i32 1)
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 3
store float %0, float* %6
%7 = getelementptr inbounds float*, float** %4, i64 1
%8 = load float*, float** %7
%9 = getelementptr inbounds float, float* %8, i64 3
store float %1, float* %9
%10 = getelementptr inbounds float*, float** %4, i64 2
%11 = load float*, float** %10
%12 = getelementptr inbounds float, float* %11, i64 3
store float %2, float* %12
ret float** %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x11() {
  Assert_real((islower(17) == 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",
              90, ("islower should be 0 for 0x11"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x11>:
push   %rax
mov    $0x11,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x5a,%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 0x11\00"
define void @t_islower_0x11() {
%1 = call i64 @islower(i32 17)
%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 90, 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 0x11\00"
define void @t_islower_0x11() {
%1 = tail call i64 @islower(i32 17)
%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 90, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int get_salt_size(void) { return 14; }


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

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

LLVM IR (-O0):
define i32 @get_salt_size() {
ret i32 14
}

LLVM IR (-O2):
define i32 @get_salt_size() {
ret i32 14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void cleanup(void *cleanup_should_fail) {
  printf("Main thread got cancelled and is being cleaned up now\n");
  exit(*(int *)cleanup_should_fail);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"Main thread got cancelled and is being cleaned up now\0A\00"
define void @cleanup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@str = [54 x i8] c"Main thread got cancelled and is being cleaned up now\00"
define void @cleanup(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int drv_PICGraphic_GPI(const int num) {
  char __attribute__((unused)) cmd[3];
  int ret = 0;
  cmd[0] = 'g';
  cmd[1] = 'r';
  cmd[2] = num;
  if (ret)
    return -1;
  else
    return cmd[0];
}


x86 assembly (clang, -O0):
<drv_PICGraphic_GPI>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movb   $0x67,-0xb(%rbp)
movb   $0x72,-0xa(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1132 <drv_PICGraphic_GPI+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1139 <drv_PICGraphic_GPI+0x39>
movsbl -0xb(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @drv_PICGraphic_GPI(i32 %0) {
ret i32 103
}
void pp(char *input) {
  char *output[strlen(input) + 3];
  sprintf(output, "\n%s\n", input);
  printf("%s", output);
}


x86 assembly (clang, -O0):
<pp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    %rcx,%rax
add    $0x3,%rax
mov    %rsp,%rdx
mov    %rdx,-0x10(%rbp)
lea    0x27(,%rcx,8),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xe82(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pp>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rsp,%rbx
lea    0x27(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <sprintf@plt>
lea    0xe96(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @pp(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = add i64 %6, 3
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8*, i64 %7
store i64 %7, i64* %4
%10 = bitcast i8** %9 to i8*
%11 = load i8*, i8** %2
%12 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %9)
%14 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @pp(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 3
%4 = alloca i8*, i64 %3
%5 = bitcast i8** %4 to i8*
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4)
ret void
}
int dev_add_param(struct device_d *dev, char *name,
                  int (*set)(struct device_d *dev, struct param_d *p,
                             const char *val),
                  char *(*get)(struct device_d *, struct param_d *p),
                  unsigned long flags) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.device_d = type opaque
%struct.param_d = type opaque
%struct.param_d.0 = type opaque
define i32 @dev_add_param(%struct.device_d* %0, i8* %1, i32 (%struct.device_d*, %struct.param_d*, i8*)* %2, i8* (%struct.device_d*, %struct.param_d.0*)* %3, i64 %4) {
%6 = alloca %struct.device_d*
%7 = alloca i8*
%8 = alloca i32 (%struct.device_d*, %struct.param_d*, i8*)*
%9 = alloca i8* (%struct.device_d*, %struct.param_d.0*)*
%10 = alloca i64
store %struct.device_d* %0, %struct.device_d** %6
store i8* %1, i8** %7
store i32 (%struct.device_d*, %struct.param_d*, i8*)* %2, i32 (%struct.device_d*, %struct.param_d*, i8*)** %8
store i8* (%struct.device_d*, %struct.param_d.0*)* %3, i8* (%struct.device_d*, %struct.param_d.0*)** %9
store i64 %4, i64* %10
ret i32 0
}

LLVM IR (-O2):
%struct.device_d = type opaque
%struct.param_d = type opaque
%struct.param_d.0 = type opaque
define i32 @dev_add_param(%struct.device_d* nocapture readnone %0, i8* nocapture readnone %1, i32 (%struct.device_d*, %struct.param_d*, i8*)* nocapture readnone %2, i8* (%struct.device_d*, %struct.param_d.0*)* nocapture readnone %3, i64 %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check_pointer(void *);
void *malloc(size_t);
void *safe_malloc(size_t size) {
  void *ptr = malloc(size);
  check_pointer(ptr);
  return ptr;
}


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

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <check_pointer@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @check_pointer(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @check_pointer(i8* %2)
ret i8* %2
}
int can_access(const char *path, const struct ucred *who) { return 1; }


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

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

LLVM IR (-O0):
%struct.ucred = type opaque
define i32 @can_access(i8* %0, %struct.ucred* %1) {
%3 = alloca i8*
%4 = alloca %struct.ucred*
store i8* %0, i8** %3
store %struct.ucred* %1, %struct.ucred** %4
ret i32 1
}

LLVM IR (-O2):
%struct.ucred = type opaque
define i32 @can_access(i8* nocapture readnone %0, %struct.ucred* nocapture readnone %1) {
ret i32 1
}
int gate_remote_enter(void *ghandle) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gate_remote_enter(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int /*<<< orphan*/ mtrace();
int /*<<< orphan*/ regcomp(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ regfree(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  regex_t r;
  mtrace();
  regcomp(&r, "[a]\\{-2,}", 0);
  regfree(&r);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <mtrace@plt>
lea    -0x14(%rbp),%rdi
lea    0xeaf(%rip),%rsi
xor    %edx,%edx
call   1040 <regcomp@plt>
lea    -0x14(%rbp),%rdi
call   1030 <regfree@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1050 <mtrace@plt>
lea    0xebd(%rip),%rsi
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
xor    %edx,%edx
call   1040 <regcomp@plt>
mov    %rbx,%rdi
call   1030 <regfree@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"[a]\\{-2,}\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (...) @mtrace()
%7 = call i32 @regcomp(i32* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%8 = call i32 @regfree(i32* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"[a]\\{-2,}\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (...) @mtrace()
%6 = call i32 @regcomp(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%7 = call i32 @regfree(i32* %3)
ret i32 0
}
int dir_shares_ref_func(const struct cmd_info *ci) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.cmd_info = type opaque
define i32 @dir_shares_ref_func(%struct.cmd_info* nocapture readnone %0) {
ret i32 1
}
int misspace(int c) {
  if (c == ' ' || c == '\n' || c == '\r' || c == '\t')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<misspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     112f <misspace+0x2f>
cmpl   $0xa,-0x8(%rbp)
je     112f <misspace+0x2f>
cmpl   $0xd,-0x8(%rbp)
je     112f <misspace+0x2f>
cmpl   $0x9,-0x8(%rbp)
jne    113b <misspace+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <misspace+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<misspace>:
cmp    $0x20,%edi
ja     111d <misspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    111d <misspace+0x1d>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @misspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 13, label %3
i32 10, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void ble_evt_hardware_analog_comparator_status(
    const struct ble_msg_hardware_analog_comparator_status_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_hardware_analog_comparator_status_evt_t = type opaque
define void @ble_evt_hardware_analog_comparator_status(%struct.ble_msg_hardware_analog_comparator_status_evt_t* nocapture %0) {
ret void
}
/* Variables and functions */
int dolmmode(int, int /*<<< orphan*/);
int tn_clearmode(int bit) { return dolmmode(bit, 0); }


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

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

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

LLVM IR (-O2):
define i32 @tn_clearmode(i32 %0) {
%2 = tail call i32 @dolmmode(i32 %0, i32 0)
ret i32 %2
}
unsigned long unsignedlong_ignoring_unsignedshortint(unsigned long x,
                                                     unsigned short int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedlong_ignoring_unsignedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedlong_ignoring_unsignedshortint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlong_ignoring_unsignedshortint(i64 %0, i16 zeroext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlong_ignoring_unsignedshortint(i64 returned %0, i16 zeroext %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ spi_init();
int /*<<< orphan*/ spi_write16(int, int);
int MCP23s17_Init(void) {
  spi_init();
  spi_write16((0x0A), (0x08));
  spi_write16((0x0B), (0x08));
  spi_write16((0x00), 0x00);
  spi_write16((0x01), 0x00);
  return 0;
}


x86 assembly (clang, -O0):
<MCP23s17_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <spi_init@plt>
mov    $0xa,%edi
mov    $0x8,%esi
call   1040 <spi_write16@plt>
mov    $0xb,%edi
mov    $0x8,%esi
call   1040 <spi_write16@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <spi_write16@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <spi_write16@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MCP23s17_Init>:
push   %rax
xor    %eax,%eax
call   1030 <spi_init@plt>
mov    $0xa,%edi
mov    $0x8,%esi
call   1040 <spi_write16@plt>
mov    $0xb,%edi
mov    $0x8,%esi
call   1040 <spi_write16@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <spi_write16@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <spi_write16@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @MCP23s17_Init() {
%1 = call i32 (...) @spi_init()
%2 = call i32 @spi_write16(i32 10, i32 8)
%3 = call i32 @spi_write16(i32 11, i32 8)
%4 = call i32 @spi_write16(i32 0, i32 0)
%5 = call i32 @spi_write16(i32 1, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @MCP23s17_Init() {
%1 = tail call i32 (...) @spi_init()
%2 = tail call i32 @spi_write16(i32 10, i32 8)
%3 = tail call i32 @spi_write16(i32 11, i32 8)
%4 = tail call i32 @spi_write16(i32 0, i32 0)
%5 = tail call i32 @spi_write16(i32 1, i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ close(int);
int ftruncate(int, int /*<<< orphan*/);
int open(char const *, int /*<<< orphan*/);
int truncate(const char *path, off_t length) {
  int fd = open(path, O_WRONLY);
  if (fd == -1)
    return -1;
  int status = ftruncate(fd, length);
  close(fd);
  return status;
}


x86 assembly (clang, -O0):
<truncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    116a <truncate+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1186 <truncate+0x56>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <ftruncate@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <close@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncate>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
cmp    $0xffffffff,%eax
je     1160 <truncate+0x30>
mov    %eax,%ebp
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <ftruncate@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1040 <close@plt>
mov    %ebx,%eax
jmp    1165 <truncate+0x35>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_WRONLY = global i32 0
define i32 @truncate(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
%9 = load i32, i32* @O_WRONLY
%10 = call i32 @open(i8* %8, i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %21
14: ; preds = %2
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = call i32 @ftruncate(i32 %15, i32 %16)
store i32 %17, i32* %7
%18 = load i32, i32* %6
%19 = call i32 @close(i32 %18)
%20 = load i32, i32* %7
store i32 %20, i32* %3
br label %21
21: ; preds = %14, %13
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
define i32 @truncate(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_WRONLY
%4 = tail call i32 @open(i8* %0, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @ftruncate(i32 %4, i32 %1)
%8 = tail call i32 @close(i32 %4)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %7, %6 ], [ -1, %2 ]
ret i32 %10
}
int f(int x[32]) {
  int a[23];
  if (sizeof(x) == 3) {
    return 1;
  }
  return sizeof(a);
}


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

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

LLVM IR (-O0):
define i32 @f(i32* %0) {
%2 = alloca i32*
%3 = alloca [23 x i32]
store i32* %0, i32** %2
ret i32 92
}

LLVM IR (-O2):
define i32 @f(i32* nocapture readnone %0) {
ret i32 92
}
/* Variables and functions */
int /*<<< orphan*/ api3(int, int, int, int);
void update_char(int sid, int x, int y) { api3(1004, sid, x, y); }


x86 assembly (clang, -O0):
<update_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x3ec,%edi
call   1030 <api3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_char>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x3ec,%edi
jmp    1030 <api3@plt>

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

LLVM IR (-O2):
define void @update_char(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @api3(i32 1004, i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  c = getchar();
  while (c != EOF) {
    putchar(c);
    c = getchar();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
je     1162 <main+0x42>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getchar()
store i32 %3, i32* %2
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @putchar(i32 %9)
%11 = call i32 (...) @getchar()
store i32 %11, i32* %2
br label %4
12: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
void rop3_250_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D | T;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_250_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%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    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_250_1_0>:
mov    (%rdi),%al
or     %al,%dl
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_250_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = xor i8 %1, -1
%7 = and i8 %5, %6
%8 = and i8 %4, %1
%9 = or i8 %7, %8
store i8 %9, i8* %0
ret void
}
unsigned getcycles() {
  volatile unsigned *iomem0 = (unsigned *)0xb0000000;
  unsigned cycles = *iomem0;
  return cycles;
}


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

x86 assembly (clang, -O2):
<getcycles>:
mov    $0xb0000000,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @getcycles() {
%1 = alloca i32*
%2 = alloca i32
store i32* inttoptr (i64 2952790016 to i32*), i32** %1
%3 = load i32*, i32** %1
%4 = load volatile i32, i32* %3
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @getcycles() {
%1 = load volatile i32, i32* inttoptr (i64 2952790016 to i32*)
ret i32 %1
}
int hash_func(int value) { return value % (10000 * 2); }


x86 assembly (clang, -O0):
<hash_func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4e20,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_func>:
movslq %edi,%rax
imul   $0x68db8bad,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2d,%rcx
add    %edx,%ecx
imul   $0x4e20,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_func(i32 %0) {
%2 = srem i32 %0, 20000
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ main();
int /*<<< orphan*/ sys_exit(int /*<<< orphan*/);
__attribute__((noreturn)) void _start(void) { sys_exit(main()); }


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <main@plt>
mov    %eax,%edi
call   1030 <sys_exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %eax,%eax
call   1040 <main@plt>
mov    %eax,%edi
call   1030 <sys_exit@plt>

LLVM IR (-O0):
define void @_start() {
%1 = call i32 (...) @main()
%2 = call i32 @sys_exit(i32 %1)
unreachable
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 (...) @main()
%2 = tail call i32 @sys_exit(i32 %1)
unreachable
}
/* Type definitions */
struct vehicle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct vehicle *);
void *delete_vehicle(struct vehicle *this) {
  free(this);
  return NULL;
}


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

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

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

LLVM IR (-O2):
%struct.vehicle = type { i32 }
define noalias i8* @delete_vehicle(%struct.vehicle* nocapture %0) {
%2 = tail call i32 @free(%struct.vehicle* %0)
ret i8* null
}
/* Variables and functions */
int strcmp(char *, char *);
int stringsort(const void *e1, const void *e2) {
  return strcmp(*(char **)e1, *(char **)e2);
}


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

x86 assembly (clang, -O2):
<stringsort>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @stringsort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}