#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ glp_lib_insist(char *, char *, int);
scalar_t__ isgraph(unsigned char);
void write_name(FILE *fp, char *name) {
  int k;
  ((void)((name != NULL) ||
          (glp_lib_insist(
               "name != NULL",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ecotox/pacfm/refs/heads/"
               "master/pacfm/tools/minpath-1.2/glpk-4.6/src/glplpx8e.c",
               459),
           1)));
  for (k = 0; name[k] != '\0'; k++) {
    if (isgraph((unsigned char)name[k]))
      fprintf(fp, "%c", name[k]);
    else
      fprintf(fp, "_");
  }
  return;
}


x86 assembly (clang, -O0):
<write_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x15(%rbp)
jne    116d <write_name+0x3d>
lea    0xea9(%rip),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x1cb,%edx
call   1040 <glp_lib_insist@plt>
mov    $0x1,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11ef <write_name+0xbf>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1050 <isgraph@plt>
cmp    $0x0,%rax
je     11ca <write_name+0x9a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xef8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11dc <write_name+0xac>
mov    -0x8(%rbp),%rdi
lea    0xee4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11e1 <write_name+0xb1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1177 <write_name+0x47>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_name>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
jne    1157 <write_name+0x27>
lea    0xeba(%rip),%rdi
lea    0xec0(%rip),%rsi
mov    $0x1cb,%edx
call   1040 <glp_lib_insist@plt>
mov    (%rbx),%al
test   %al,%al
je     119b <write_name+0x6b>
add    $0x1,%rbx
jmp    1187 <write_name+0x57>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl -0x1(%rbx),%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     119b <write_name+0x6b>
movzbl %al,%edi
call   1050 <isgraph@plt>
test   %rax,%rax
jne    1170 <write_name+0x40>
mov    $0x5f,%edi
jmp    1174 <write_name+0x44>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"name != NULL\00"
@.str.1 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ecotox/pacfm/refs/heads/master/pacfm/tools/minpath-1.2/glpk-4.6/src/glplpx8e.c\00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [2 x i8] c"_\00"
define void @write_name(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @glp_lib_insist(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 459)
br label %10
10: ; preds = %8, %2
%11 = phi i1 [ true, %2 ], [ true, %8 ]
%12 = zext i1 %11 to i32
store i32 0, i32* %5
br label %13
13: ; preds = %42, %10
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %45
21: ; preds = %13
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = call i64 @isgraph(i8 zeroext %26)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %38
29: ; preds = %21
%30 = load i32*, i32** %3
%31 = load i8*, i8** %4
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %36)
br label %41
38: ; preds = %21
%39 = load i32*, i32** %3
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %41
41: ; preds = %38, %29
br label %42
42: ; preds = %41
%43 = load i32, i32* %5
%44 = add nsw i32 %43, 1
store i32 %44, i32* %5
br label %13
45: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"name != NULL\00"
@.str.1 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ecotox/pacfm/refs/heads/master/pacfm/tools/minpath-1.2/glpk-4.6/src/glplpx8e.c\00"
define void @write_name(i32* nocapture %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @glp_lib_insist(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 459)
br label %6
6: ; preds = %4, %2
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 0
br i1 %8, label %25, label %9
9: ; preds = %6, %18
%10 = phi i64 [ %21, %18 ], [ 0, %6 ]
%11 = phi i8 [ %23, %18 ], [ %7, %6 ]
%12 = phi i8* [ %22, %18 ], [ %1, %6 ]
%13 = tail call i64 @isgraph(i8 zeroext %11)
%14 = icmp eq i64 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %9
%16 = load i8, i8* %12
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %9, %15
%19 = phi i32 [ %17, %15 ], [ 95, %9 ]
%20 = tail call i32 @fputc(i32 %19, i32* %0)
%21 = add nuw i64 %10, 1
%22 = getelementptr inbounds i8, i8* %1, i64 %21
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 0
br i1 %24, label %25, label %9
25: ; preds = %18, %6
ret void
}