#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ mu__malloc(char *, int, size_t);
char *astrfillch(size_t len, char c) {
  char *buffer = NULL;
  size_t ii;
  buffer = (char *)mu__malloc(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/kaiaie/bile/refs/heads/master/src/astring.c",
      158, (len + 1) * sizeof(char));
  for (ii = 0; ii < len; ++ii) {
    buffer[ii] = c;
    buffer[ii + 1] = '\0';
  }
  return buffer;
}


x86 assembly (clang, -O0):
<astrfillch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
add    $0x1,%rdx
shl    $0x0,%rdx
lea    0xec3(%rip),%rdi
mov    $0x9e,%esi
call   1030 <mu__malloc@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    118d <astrfillch+0x7d>
mov    -0x9(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,0x1(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1153 <astrfillch+0x43>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<astrfillch>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x1(%rdi),%rdx
lea    0xedc(%rip),%rdi
mov    $0x9e,%esi
call   1030 <mu__malloc@plt>
test   %r14,%r14
je     1191 <astrfillch+0x81>
lea    -0x1(%r14),%rdx
mov    %r14d,%ecx
and    $0x3,%ecx
cmp    $0x3,%rdx
jae    1147 <astrfillch+0x37>
xor    %edx,%edx
jmp    116d <astrfillch+0x5d>
and    $0xfffffffffffffffc,%r14
xor    %edx,%edx
nopl   (%rax)
mov    %bl,(%rax,%rdx,1)
mov    %bl,0x1(%rax,%rdx,1)
mov    %bl,0x2(%rax,%rdx,1)
mov    %bl,0x3(%rax,%rdx,1)
movb   $0x0,0x4(%rax,%rdx,1)
add    $0x4,%rdx
cmp    %rdx,%r14
jne    1150 <astrfillch+0x40>
test   %rcx,%rcx
je     1191 <astrfillch+0x81>
add    %rax,%rdx
add    $0x1,%rdx
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
mov    %bl,-0x1(%rdx,%rsi,1)
movb   $0x0,(%rdx,%rsi,1)
add    $0x1,%rsi
cmp    %rsi,%rcx
jne    1180 <astrfillch+0x70>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kaiaie/bile/refs/heads/master/src/astring.c\00"
define i8* @astrfillch(i64 %0, i8 signext %1) {
%3 = alloca i64
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %3
store i8 %1, i8* %4
store i8* null, i8** %5
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = mul i64 %8, 1
%10 = call i64 @mu__malloc(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 158, i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %5
store i64 0, i64* %6
br label %12
12: ; preds = %25, %2
%13 = load i64, i64* %6
%14 = load i64, i64* %3
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %28
16: ; preds = %12
%17 = load i8, i8* %4
%18 = load i8*, i8** %5
%19 = load i64, i64* %6
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 %17, i8* %20
%21 = load i8*, i8** %5
%22 = load i64, i64* %6
%23 = add i64 %22, 1
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 0, i8* %24
br label %25
25: ; preds = %16
%26 = load i64, i64* %6
%27 = add i64 %26, 1
store i64 %27, i64* %6
br label %12
28: ; preds = %12
%29 = load i8*, i8** %5
ret i8* %29
}

LLVM IR (-O2):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kaiaie/bile/refs/heads/master/src/astring.c\00"
define i8* @astrfillch(i64 %0, i8 signext %1) {
%3 = add i64 %0, 1
%4 = tail call i64 @mu__malloc(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 158, i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %0, 0
br i1 %6, label %38, label %7
7: ; preds = %2
%8 = add i64 %0, -1
%9 = and i64 %0, 3
%10 = icmp ult i64 %8, 3
br i1 %10, label %27, label %11
11: ; preds = %7
%12 = and i64 %0, -4
br label %13
13: ; preds = %13, %11
%14 = phi i64 [ 0, %11 ], [ %23, %13 ]
%15 = phi i64 [ 0, %11 ], [ %25, %13 ]
%16 = getelementptr inbounds i8, i8* %5, i64 %14
store i8 %1, i8* %16
%17 = or i64 %14, 1
%18 = getelementptr inbounds i8, i8* %5, i64 %17
store i8 %1, i8* %18
%19 = or i64 %14, 2
%20 = getelementptr inbounds i8, i8* %5, i64 %19
store i8 %1, i8* %20
%21 = or i64 %14, 3
%22 = getelementptr inbounds i8, i8* %5, i64 %21
store i8 %1, i8* %22
%23 = add nuw i64 %14, 4
%24 = getelementptr inbounds i8, i8* %5, i64 %23
store i8 0, i8* %24
%25 = add i64 %15, 4
%26 = icmp eq i64 %25, %12
br i1 %26, label %27, label %13
27: ; preds = %13, %7
%28 = phi i64 [ 0, %7 ], [ %23, %13 ]
%29 = icmp eq i64 %9, 0
br i1 %29, label %38, label %30
30: ; preds = %27, %30
%31 = phi i64 [ %34, %30 ], [ %28, %27 ]
%32 = phi i64 [ %36, %30 ], [ 0, %27 ]
%33 = getelementptr inbounds i8, i8* %5, i64 %31
store i8 %1, i8* %33
%34 = add nuw i64 %31, 1
%35 = getelementptr inbounds i8, i8* %5, i64 %34
store i8 0, i8* %35
%36 = add i64 %32, 1
%37 = icmp eq i64 %36, %9
br i1 %37, label %38, label %30
38: ; preds = %27, %30, %2
ret i8* %5
}