xunge/DecIR huggingface dataset:
char *hash_plugin_detailed(void) {
  return ("ripemd160 - RIPEMD160 plugin\n"
          "------------------------\n"
          "Use this module to crack RIPEMD-160 hashes\n"
          "Input should be in form: \'user:hash\' or just \'hash\'\n"
          "Known software that uses this password hashing method:\n"
          "Unknown\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_detailed>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [258 x i8] c"ripemd160 - RIPEMD160 plugin\0A------------------------\0AUse this module to crack RIPEMD-160 hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0AUnknown\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([258 x i8], [258 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [258 x i8] c"ripemd160 - RIPEMD160 plugin\0A------------------------\0AUse this module to crack RIPEMD-160 hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0AUnknown\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([258 x i8], [258 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
bool nrf52_errata_202(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_202() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ api_beep(int /*<<< orphan*/);
int /*<<< orphan*/ api_end();
int api_getkey(int);
int /*<<< orphan*/ api_settimer(int, int);
void waittimer(int timer, int time) {
  int i;
  api_settimer(timer, time);
  for (;;) {
    i = api_getkey(1);
    if (i == 'Q' || i == 'q') {
      api_beep(0);
      api_end();
    }
    if (i == 128) {
      return;
    }
  }
}


x86 assembly (clang, -O0):
<waittimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <api_settimer@plt>
mov    $0x1,%edi
call   1050 <api_getkey@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x51,-0xc(%rbp)
je     117a <waittimer+0x3a>
cmpl   $0x71,-0xc(%rbp)
jne    1188 <waittimer+0x48>
xor    %edi,%edi
call   1060 <api_beep@plt>
mov    $0x0,%al
call   1030 <api_end@plt>
cmpl   $0x80,-0xc(%rbp)
jne    119b <waittimer+0x5b>
add    $0x10,%rsp
pop    %rbp
ret
jmp    1159 <waittimer+0x19>

x86 assembly (clang, -O2):
<waittimer>:
push   %rbx
call   1040 <api_settimer@plt>
jmp    1158 <waittimer+0x18>
nopl   0x0(%rax,%rax,1)
cmp    $0x80,%ebx
je     117c <waittimer+0x3c>
mov    $0x1,%edi
call   1050 <api_getkey@plt>
mov    %eax,%ebx
and    $0xffffffdf,%eax
cmp    $0x51,%eax
jne    1150 <waittimer+0x10>
xor    %edi,%edi
call   1060 <api_beep@plt>
xor    %eax,%eax
call   1030 <api_end@plt>
jmp    1150 <waittimer+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @waittimer(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @api_settimer(i32 %6, i32 %7)
br label %9
9: ; preds = %23, %2
%10 = call i32 @api_getkey(i32 1)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 81
br i1 %12, label %16, label %13
13: ; preds = %9
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 113
br i1 %15, label %16, label %19
16: ; preds = %13, %9
%17 = call i32 @api_beep(i32 0)
%18 = call i32 (...) @api_end()
br label %19
19: ; preds = %16, %13
%20 = load i32, i32* %5
%21 = icmp eq i32 %20, 128
br i1 %21, label %22, label %23
22: ; preds = %19
ret void
23: ; preds = %19
br label %9
}

LLVM IR (-O2):
define void @waittimer(i32 %0, i32 %1) {
%3 = tail call i32 @api_settimer(i32 %0, i32 %1)
br label %4
4: ; preds = %11, %2
%5 = tail call i32 @api_getkey(i32 1)
%6 = and i32 %5, -33
%7 = icmp eq i32 %6, 81
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = tail call i32 @api_beep(i32 0)
%10 = tail call i32 (...) @api_end()
br label %11
11: ; preds = %4, %8
%12 = icmp eq i32 %5, 128
br i1 %12, label %13, label %4
13: ; preds = %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printNoValueError() {
  fprintf(stderr, "No value given for a keyword in the file\n");
}


x86 assembly (clang, -O0):
<printNoValueError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printNoValueError>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"No value given for a keyword in the file\0A\00"
define void @printNoValueError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"No value given for a keyword in the file\0A\00"
define void @printNoValueError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *sknobs_find_file(char *);
char *sknobs_get_string(char *, char *);
char *sknobs_get_filename(char *name, char *defaultValue) {
  char *s = sknobs_get_string(name, defaultValue);
  return sknobs_find_file(s);
}


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

x86 assembly (clang, -O2):
<sknobs_get_filename>:
push   %rax
call   1040 <sknobs_get_string@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <sknobs_find_file@plt>

LLVM IR (-O0):
define i8* @sknobs_get_filename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @sknobs_get_string(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i8* @sknobs_find_file(i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @sknobs_get_filename(i8* %0, i8* %1) {
%3 = tail call i8* @sknobs_get_string(i8* %0, i8* %1)
%4 = tail call i8* @sknobs_find_file(i8* %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ my_strcpy(char *, char *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  char s[] = "Hola Mundo";
  char *t = NULL;
  my_strcpy(t, s);
  puts(s);
  puts(t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x1b(%rbp)
mov    0xec0(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xeb8(%rip),%al
mov    %al,-0x11(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x1b(%rbp),%rsi
call   1030 <my_strcpy@plt>
lea    -0x1b(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x28(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6e754d20616c6f48,%rax
4d 75 6e
mov    %rax,(%rsp)
movl   $0x6f646e,0x7(%rsp)
mov    %rsp,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <my_strcpy@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [11 x i8] c"Hola Mundo\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [11 x i8]
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [11 x i8]* %6 to i8*
store i8* null, i8** %7
%9 = load i8*, i8** %7
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %6, i64 0, i64 0
%11 = call i32 @my_strcpy(i8* %9, i8* %10)
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %6, i64 0, i64 0
%13 = call i32 @puts(i8* %12)
%14 = load i8*, i8** %7
%15 = call i32 @puts(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [11 x i8] c"Hola Mundo\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [11 x i8]
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%5 = call i32 @my_strcpy(i8* null, i8* %4)
%6 = call i32 @puts(i8* %4)
%7 = call i32 @puts(i8* dereferenceable(1) null)
ret i32 0
}
void gll_weights_order6_square(double *out_4731757004545806116) {
  out_4731757004545806116[0] = 0.0476190476190476;
  out_4731757004545806116[1] = 0.276826047361565;
  out_4731757004545806116[2] = 0.431745381209863;
  out_4731757004545806116[3] = 0.487619047619048;
  out_4731757004545806116[4] = 0.431745381209863;
  out_4731757004545806116[5] = 0.276826047361565;
  out_4731757004545806116[6] = 0.0476190476190476;
}


x86 assembly (clang, -O0):
<gll_weights_order6_square>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xee4(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  0xea0(%rip),%xmm0
movsd  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movsd  0xe87(%rip),%xmm0
movsd  %xmm0,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gll_weights_order6_square>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movaps 0xf04(%rip),%xmm0
movups %xmm0,0x20(%rdi)
movabs $0x3fa8618618618616,%rax
61 a8 3f
mov    %rax,0x30(%rdi)
ret

LLVM IR (-O0):
define void @gll_weights_order6_square(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
store double 0x3FA8618618618616, double* %4
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 1
store double 0x3FD1B784990653DE, double* %6
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 2
store double 0x3FDBA1B7611FB4DF, double* %8
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 3
store double 0x3FDF3526859B8CF3, double* %10
%11 = load double*, double** %2
%12 = getelementptr inbounds double, double* %11, i64 4
store double 0x3FDBA1B7611FB4DF, double* %12
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 5
store double 0x3FD1B784990653DE, double* %14
%15 = load double*, double** %2
%16 = getelementptr inbounds double, double* %15, i64 6
store double 0x3FA8618618618616, double* %16
ret void
}

LLVM IR (-O2):
define void @gll_weights_order6_square(double* nocapture writeonly %0) {
%2 = bitcast double* %0 to <2 x double>*
store <2 x double> <double 0x3FA8618618618616, double 0x3FD1B784990653DE>, <2 x double>* %2
%3 = getelementptr inbounds double, double* %0, i64 2
%4 = bitcast double* %3 to <2 x double>*
store <2 x double> <double 0x3FDBA1B7611FB4DF, double 0x3FDF3526859B8CF3>, <2 x double>* %4
%5 = getelementptr inbounds double, double* %0, i64 4
%6 = bitcast double* %5 to <2 x double>*
store <2 x double> <double 0x3FDBA1B7611FB4DF, double 0x3FD1B784990653DE>, <2 x double>* %6
%7 = getelementptr inbounds double, double* %0, i64 6
store double 0x3FA8618618618616, double* %7
ret void
}
unsigned m_mod(int x, int y) {
  int r = x % y;
  return r < 0 ? (y < 0 ? r - y : r + y) : r;
}


x86 assembly (clang, -O0):
<m_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114a <m_mod+0x4a>
cmpl   $0x0,-0x8(%rbp)
jge    1136 <m_mod+0x36>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    113f <m_mod+0x3f>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1150 <m_mod+0x50>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
test   %edx,%edx
js     110c <m_mod+0xc>
ret
test   %esi,%esi
js     1113 <m_mod+0x13>
add    %esi,%eax
ret
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @m_mod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = sub nsw i32 %15, %16
br label %22
18: ; preds = %11
%19 = load i32, i32* %5
%20 = load i32, i32* %4
%21 = add nsw i32 %19, %20
br label %22
22: ; preds = %18, %14
%23 = phi i32 [ %17, %14 ], [ %21, %18 ]
br label %26
24: ; preds = %2
%25 = load i32, i32* %5
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ %23, %22 ], [ %25, %24 ]
ret i32 %27
}

LLVM IR (-O2):
define i32 @m_mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = icmp slt i32 %1, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = sub nsw i32 %3, %1
br label %11
9: ; preds = %5
%10 = add nsw i32 %3, %1
br label %11
11: ; preds = %2, %7, %9
%12 = phi i32 [ %8, %7 ], [ %10, %9 ], [ %3, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ a(int /*<<< orphan*/);
void c(int arg) {
  (void)arg;
  a(0);
}


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

x86 assembly (clang, -O2):
<c>:
xor    %edi,%edi
jmp    1030 <a@plt>

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

LLVM IR (-O2):
define void @c(i32 %0) {
%2 = tail call i32 @a(i32 0)
ret void
}
float fabsf(float x) { return ((x < 0) ? -x : x); }


x86 assembly (clang, -O0):
<fabsf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <fabsf+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <fabsf+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsf>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fabsf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
br label %10
8: ; preds = %1
%9 = load float, float* %2
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
ret float %11
}

LLVM IR (-O2):
define float @fabsf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ t0_isr();
void interrupt(void) { t0_isr(); }


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

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

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

LLVM IR (-O2):
define void @interrupt() {
%1 = tail call i32 (...) @t0_isr()
ret void
}
int ispowtwo(int n) { return (n) && (!(n & (n - 1))); }


x86 assembly (clang, -O0):
<ispowtwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112c <ispowtwo+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispowtwo>:
test   %edi,%edi
je     110f <ispowtwo+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ispowtwo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @ispowtwo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ delay_tick(int);
int /*<<< orphan*/ serial_putc(int /*<<< orphan*/);
void serial_puts(const char *s) {
  while (*s != '\0') {
    serial_putc(*s++);
  }
  delay_tick(32 * 1000);
}


x86 assembly (clang, -O0):
<serial_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1158 <serial_puts+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1040 <serial_putc@plt>
jmp    112c <serial_puts+0xc>
mov    $0x7d00,%edi
call   1030 <delay_tick@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <serial_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1040 <serial_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <serial_puts+0x10>
mov    $0x7d00,%edi
pop    %rbx
jmp    1030 <delay_tick@plt>

LLVM IR (-O0):
define void @serial_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 @serial_putc(i32 %12)
br label %3
14: ; preds = %3
%15 = call i32 @delay_tick(i32 32000)
ret void
}

LLVM IR (-O2):
define void @serial_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @serial_putc(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @delay_tick(i32 32000)
ret void
}
/* Variables and functions */
size_t roundup(size_t x, size_t y) {
  size_t r = x % y;
  if (r)
    return x + (y - r);
  return x;
}


x86 assembly (clang, -O0):
<roundup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     113f <roundup+0x3f>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    -0x20(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <roundup+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup>:
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1116 <roundup+0x16>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
jmp    111c <roundup+0x1c>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rsi
test   %rdx,%rdx
cmove  %rdx,%rsi
add    %rdi,%rsi
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @roundup(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = icmp eq i64 %3, 0
%5 = sub i64 %1, %3
%6 = select i1 %4, i64 0, i64 %5
%7 = add i64 %6, %0
ret i64 %7
}
void os_trace_idle(void) {}


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

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

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

LLVM IR (-O2):
define void @os_trace_idle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_24() {
  Assert_real((isqrt(24) == 4),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              125, ("Integer square root of 24 should be 4"));
}


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

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

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 24 should be 4\00"
define void @t_sqrt_24() {
%1 = call i32 @isqrt(i32 24)
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 24 should be 4\00"
define void @t_sqrt_24() {
%1 = tail call i32 @isqrt(i32 24)
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void log_debug(char *message) {}


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

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

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

LLVM IR (-O2):
define void @log_debug(i8* nocapture %0) {
ret void
}
unsigned char f0(unsigned char input) { return input; }


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f0(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @f0(i8 returned zeroext %0) {
ret i8 %0
}
double chpl_macro_INFINITY(void) {
  double x;
  *(unsigned long long int *)&x = 0x7ff0000000000000ULL;
  return x;
}


x86 assembly (clang, -O0):
<chpl_macro_INFINITY>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7ff0000000000000,%rax
mov    %rax,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @chpl_macro_INFINITY() {
%1 = alloca double
%2 = bitcast double* %1 to i64*
store i64 9218868437227405312, i64* %2
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @chpl_macro_INFINITY() {
ret double 0x7FF0000000000000
}
void _std_managed_heap_init() {}


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

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

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

LLVM IR (-O2):
define void @_std_managed_heap_init() {
ret void
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
void *malloc(size_t);
void *_tree_malloc(struct libavl_allocator *allocator, size_t libavl_size) {
  return malloc(libavl_size);
}


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

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

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define i8* @_tree_malloc(%struct.libavl_allocator* %0, i64 %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i64
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i8* @malloc(i64 %5)
ret i8* %6
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define noalias i8* @_tree_malloc(%struct.libavl_allocator* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int trap(int *, int);
int main(void) {
  int x[] = {0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1};
  printf("%d\n", trap(x, sizeof(x) / sizeof(int)));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0xc,%esi
call   1050 <trap@plt>
mov    %eax,%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xc,%esi
call   1040 <trap@plt>
lea    0xed5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
@__const.main.x = [12 x i32] [i32 0, i32 1, i32 0, i32 2, i32 1, i32 0, i32 1, i32 3, i32 2, i32 1, i32 2, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [12 x i32]
%2 = bitcast [12 x i32]* %1 to i8*
%3 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%4 = call i32 @trap(i32* %3, i32 12)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int O_WRONLY;
int o_wronly() { return O_WRONLY; }


x86 assembly (clang, -O0):
<o_wronly>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<o_wronly>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@O_WRONLY = global i32 0
define i32 @o_wronly() {
%1 = load i32, i32* @O_WRONLY
ret i32 %1
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
define i32 @o_wronly() {
%1 = load i32, i32* @O_WRONLY
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, long);
char *str_new(char *);
char *str_from_i(long v) {
  char buf[30];
  sprintf(buf, "%li", v);
  return str_new(buf);
}


x86 assembly (clang, -O0):
<str_from_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <str_new@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_from_i>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rdx
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <str_new@plt>
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%li\00"
define i8* @str_from_i(i64 %0) {
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
%5 = call i8* @str_new(i8* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello from Geany on Raspberry Pi 2\n");
  return 0;
}


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)
lea    0xed3(%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 = [36 x i8] c"Hello from Geany on Raspberry Pi 2\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 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"Hello from Geany on Raspberry Pi 2\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pr_debug(char *);
void cleanup_module(void) { pr_debug("I hate to see you leave, but...\n"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"I hate to see you leave, but...\0A\00"
define void @cleanup_module() {
%1 = call i32 @pr_debug(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"I hate to see you leave, but...\0A\00"
define void @cleanup_module() {
%1 = tail call i32 @pr_debug(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
void wczytaj_liczby_calkowite_do_tablicy(int tab[], int len) {}


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

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

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

LLVM IR (-O2):
define void @wczytaj_liczby_calkowite_do_tablicy(i32* nocapture %0, i32 %1) {
ret void
}
void test_struct() {
  int we[] = {1, 0, 0, 0, 2, 0, 0, 0};
  struct {
    int a[3];
    int b;
  } w[] = {{1}, 2};
  verify(we, &w, 8);
}


x86 assembly (clang, -O0):
<test_struct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xeb5(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeb2(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeaf(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeac(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <verify@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct>:
sub    $0x48,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <verify@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
%struct.anon = type { [3 x i32], i32 }
@__const.test_struct.we = [8 x i32] [i32 1, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0, i32 0]
@__const.test_struct.w = [2 x %struct.anon] [%struct.anon { [3 x i32] [i32 1, i32 0, i32 0], i32 0 }, %struct.anon { [3 x i32] [i32 2, i32 0, i32 0], i32 0 }]
define void @test_struct() {
%1 = alloca [8 x i32]
%2 = alloca [2 x %struct.anon]
%3 = bitcast [8 x i32]* %1 to i8*
%4 = bitcast [2 x %struct.anon]* %2 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%6 = call i32 (i32*, [2 x %struct.anon]*, i32, ...) bitcast (i32 (...)* @verify to i32 (i32*, [2 x %struct.anon]*, i32, ...)*)(i32* %5, [2 x %struct.anon]* %2, i32 8)
ret void
}

LLVM IR (-O2):
%struct.anon = type { [3 x i32], i32 }
@__const.test_struct.we = [8 x i32] [i32 1, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0, i32 0]
@__const.test_struct.w = [2 x %struct.anon] [%struct.anon { [3 x i32] [i32 1, i32 0, i32 0], i32 0 }, %struct.anon { [3 x i32] [i32 2, i32 0, i32 0], i32 0 }]
define void @test_struct() {
%1 = alloca [8 x i32]
%2 = alloca [2 x %struct.anon]
%3 = bitcast [8 x i32]* %1 to i8*
%4 = bitcast [2 x %struct.anon]* %2 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%6 = call i32 (i32*, [2 x %struct.anon]*, i32, ...) bitcast (i32 (...)* @verify to i32 (i32*, [2 x %struct.anon]*, i32, ...)*)(i32* %5, [2 x %struct.anon]* %2, i32 8)
ret void
}
int my_strlen(char s[]) {
  int i;
  i = 0;
  while (s[i] != '\0') {
    ++i;
  }
  return i;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <my_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x69() {
  Assert_real((isalnum(105)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              530, ("isalnum should be 1 for i"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x69>:
push   %rbp
mov    %rsp,%rbp
mov    $0x69,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x212,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x69>:
push   %rax
mov    $0x69,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x212,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for i\00"
define void @t_isalnum_0x69() {
%1 = call i32 @isalnum(i32 105)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 530, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for i\00"
define void @t_isalnum_0x69() {
%1 = tail call i32 @isalnum(i32 105)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 530, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ devicetree_find_node_prop(char *, char *);
int /*<<< orphan*/ devicetree_prop_string(scalar_t__, char *, scalar_t__);
uint32_t devicetree_find_string(char *node, char *prop, char *string,
                                uint32_t len) {
  uint32_t result;
  result = devicetree_find_node_prop(node, prop);
  if (result < 0)
    return result;
  devicetree_prop_string(result, string, len);
  return 0;
}


x86 assembly (clang, -O0):
<devicetree_find_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <devicetree_find_node_prop@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jge    1161 <devicetree_find_string+0x41>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117a <devicetree_find_string+0x5a>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <devicetree_prop_string@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devicetree_find_string>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
call   1040 <devicetree_find_node_prop@plt>
test   %rax,%rax
js     1144 <devicetree_find_string+0x24>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <devicetree_prop_string@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @devicetree_find_string(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i64 @devicetree_find_node_prop(i8* %0, i8* %1)
%6 = icmp slt i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @devicetree_prop_string(i64 %5, i8* %2, i64 %3)
br label %9
9: ; preds = %4, %7
%10 = phi i64 [ 0, %7 ], [ %5, %4 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "Usage: jfs_copyout <volumename> <srcfilename> <dstfilename>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"Usage: jfs_copyout <volumename> <srcfilename> <dstfilename>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"Usage: jfs_copyout <volumename> <srcfilename> <dstfilename>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ PSTR(char *);
int /*<<< orphan*/ df_deselect();
int /*<<< orphan*/ df_flush();
int /*<<< orphan*/ df_writeCmd(int);
int /*<<< orphan*/ showString(int /*<<< orphan*/);
void df_wipe() {
  showString(PSTR("DF W\n"));
  df_writeCmd(0xC7);
  df_deselect();
  df_flush();
}


x86 assembly (clang, -O0):
<df_wipe>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1040 <PSTR@plt>
mov    %eax,%edi
call   1060 <showString@plt>
mov    $0xc7,%edi
call   1050 <df_writeCmd@plt>
mov    $0x0,%al
call   1070 <df_deselect@plt>
mov    $0x0,%al
call   1030 <df_flush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<df_wipe>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <PSTR@plt>
mov    %eax,%edi
call   1060 <showString@plt>
mov    $0xc7,%edi
call   1050 <df_writeCmd@plt>
xor    %eax,%eax
call   1070 <df_deselect@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <df_flush@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"DF W\0A\00"
define void @df_wipe() {
%1 = call i32 @PSTR(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @showString(i32 %1)
%3 = call i32 @df_writeCmd(i32 199)
%4 = call i32 (...) @df_deselect()
%5 = call i32 (...) @df_flush()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"DF W\0A\00"
define void @df_wipe() {
%1 = tail call i32 @PSTR(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @showString(i32 %1)
%3 = tail call i32 @df_writeCmd(i32 199)
%4 = tail call i32 (...) @df_deselect()
%5 = tail call i32 (...) @df_flush()
ret void
}
/* Type definitions */
struct wl_subcompositor {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int /*<<< orphan*/);
void wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor) {
  wl_proxy_marshal((struct wl_proxy *)wl_subcompositor, 0);
  wl_proxy_destroy((struct wl_proxy *)wl_subcompositor);
}


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

x86 assembly (clang, -O2):
<wl_subcompositor_destroy>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <wl_proxy_marshal@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <wl_proxy_destroy@plt>

LLVM IR (-O0):
%struct.wl_subcompositor = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_subcompositor_destroy(%struct.wl_subcompositor* %0) {
%2 = alloca %struct.wl_subcompositor*
store %struct.wl_subcompositor* %0, %struct.wl_subcompositor** %2
%3 = load %struct.wl_subcompositor*, %struct.wl_subcompositor** %2
%4 = bitcast %struct.wl_subcompositor* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 0)
%6 = load %struct.wl_subcompositor*, %struct.wl_subcompositor** %2
%7 = bitcast %struct.wl_subcompositor* %6 to %struct.wl_proxy*
%8 = call i32 @wl_proxy_destroy(%struct.wl_proxy* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_subcompositor = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_subcompositor_destroy(%struct.wl_subcompositor* %0) {
%2 = bitcast %struct.wl_subcompositor* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %2, i32 0)
%4 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}