char *socket_name() {
  char *socket_name = create_file_name("socket2");
  if (strlen(socket_name) > 108)
    internal_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/"
                   "heads/lyrics/protocol.c",
                   51, __FUNCTION__, "Can't create socket name!");
  return socket_name;
}


x86 assembly (clang, -O0):
<socket_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <create_file_name@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x6c,%rax
jbe    1180 <socket_name+0x50>
lea    0xea2(%rip),%rdi
mov    $0x33,%esi
lea    0xf20(%rip),%rdx
lea    0xf25(%rip),%rcx
mov    $0x0,%al
call   1050 <internal_fatal@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_name>:
push   %rbx
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <create_file_name@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x6d,%rax
jb     1171 <socket_name+0x41>
lea    0xeb1(%rip),%rdi
lea    0xf34(%rip),%rdx
lea    0xf39(%rip),%rcx
mov    $0x33,%esi
xor    %eax,%eax
call   1050 <internal_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"socket2\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/protocol.c\00"
@__FUNCTION__.socket_name = [12 x i8] c"socket_name\00"
@.str.2 = [26 x i8] c"Can't create socket name!\00"
define i8* @socket_name() {
%1 = alloca i8*
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @create_file_name to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = call i64 @strlen(i8* %5)
%7 = icmp ugt i64 %6, 108
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @internal_fatal to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 51, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.socket_name, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"socket2\00"
@.str.1 = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/protocol.c\00"
@__FUNCTION__.socket_name = [12 x i8] c"socket_name\00"
@.str.2 = [26 x i8] c"Can't create socket name!\00"
define i8* @socket_name() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @create_file_name to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%5 = icmp ugt i64 %4, 108
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @internal_fatal to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i32 51, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.socket_name, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret i8* %3
}