void action_ready(char *path) {
  _singularity_message(5, __func__,
                       "/scratch/repos/new/home/jordi_armengol_estape/"
                       "c-scraper/outputs/2022-01-22/02-19-57/repos/Trophime/"
                       "singularity/refs/heads/master/src/action-lib/ready.c",
                       38, "Checking if container is valid at: %s\n", path);
  if (is_exec(joinpath(path, "/bin/sh")) != 0 &&
      is_link(joinpath(path, "/bin/sh")) != 0) {
    _singularity_message(-3, __func__,
                         "/scratch/repos/new/home/jordi_armengol_estape/"
                         "c-scraper/outputs/2022-01-22/02-19-57/repos/Trophime/"
                         "singularity/refs/heads/master/src/action-lib/ready.c",
                         41, "No valid /bin/sh in container\n");
    do {
      _singularity_message(
          -4, __func__,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/Trophime/singularity/refs/heads/master/"
          "src/action-lib/ready.c",
          42, "Retval = %d\n", 255);
      exit(255);
    } while (0);
  }
  return;
}


x86 assembly (clang, -O0):
<action_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
mov    $0x5,%edi
lea    0xe94(%rip),%rsi
lea    0xe9a(%rip),%rdx
mov    $0x26,%ecx
lea    0xf26(%rip),%r8
mov    $0x0,%al
call   1040 <_singularity_message@plt>
mov    -0x8(%rbp),%rdi
lea    0xf3b(%rip),%rsi
mov    $0x0,%al
call   1060 <joinpath@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1050 <is_exec@plt>
cmp    $0x0,%eax
je     122a <action_ready+0xda>
mov    -0x8(%rbp),%rdi
lea    0xf17(%rip),%rsi
mov    $0x0,%al
call   1060 <joinpath@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1030 <is_link@plt>
cmp    $0x0,%eax
je     122a <action_ready+0xda>
mov    $0xfffffffd,%edi
lea    0xe26(%rip),%rsi
lea    0xe2c(%rip),%rdx
mov    $0x29,%ecx
lea    0xee7(%rip),%r8
mov    $0x0,%al
call   1040 <_singularity_message@plt>
mov    $0xfffffffc,%edi
lea    0xe00(%rip),%rsi
lea    0xe06(%rip),%rdx
mov    $0x2a,%ecx
lea    0xee0(%rip),%r8
mov    $0xff,%r9d
mov    $0x0,%al
call   1040 <_singularity_message@plt>
mov    $0xff,%edi
call   1070 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<action_ready>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xea2(%rip),%rsi
lea    0xea8(%rip),%rdx
lea    0xf39(%rip),%r8
mov    $0x5,%edi
mov    $0x26,%ecx
mov    %rbx,%r9
xor    %eax,%eax
call   1040 <_singularity_message@plt>
lea    0xf45(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <joinpath@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1050 <is_exec@plt>
test   %eax,%eax
je     11bc <action_ready+0x6c>
lea    0xf27(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <joinpath@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1030 <is_link@plt>
test   %eax,%eax
jne    11c4 <action_ready+0x74>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe35(%rip),%rbx
lea    0xe3b(%rip),%r14
lea    0xefb(%rip),%r8
mov    $0xfffffffd,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x29,%ecx
xor    %eax,%eax
call   1040 <_singularity_message@plt>
lea    0xefc(%rip),%r8
mov    $0xfffffffc,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x2a,%ecx
mov    $0xff,%r9d
xor    %eax,%eax
call   1040 <_singularity_message@plt>
mov    $0xff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@__func__.action_ready = [13 x i8] c"action_ready\00"
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Trophime/singularity/refs/heads/master/src/action-lib/ready.c\00"
@.str.1 = [39 x i8] c"Checking if container is valid at: %s\0A\00"
@.str.2 = [8 x i8] c"/bin/sh\00"
@.str.3 = [31 x i8] c"No valid /bin/sh in container\0A\00"
@.str.4 = [13 x i8] c"Retval = %d\0A\00"
define void @action_ready(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i32, i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_singularity_message to i32 (i32, i8*, i8*, i32, i8*, i8*, ...)*)(i32 5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.action_ready, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 38, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @joinpath to i32 (i8*, i8*, ...)*)(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i32, ...) bitcast (i32 (...)* @is_exec to i32 (i32, ...)*)(i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @joinpath to i32 (i8*, i8*, ...)*)(i8* %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i32, ...) bitcast (i32 (...)* @is_link to i32 (i32, ...)*)(i32 %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %9
%15 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_singularity_message to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 -3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.action_ready, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 41, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %14
%17 = call i32 (i32, i8*, i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @_singularity_message to i32 (i32, i8*, i8*, i32, i8*, i32, ...)*)(i32 -4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.action_ready, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 255)
unreachable
18: ; No predecessors!
br label %19
19: ; preds = %18, %9, %1
ret void
}

LLVM IR (-O2):
@__func__.action_ready = [13 x i8] c"action_ready\00"
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Trophime/singularity/refs/heads/master/src/action-lib/ready.c\00"
@.str.1 = [39 x i8] c"Checking if container is valid at: %s\0A\00"
@.str.2 = [8 x i8] c"/bin/sh\00"
@.str.3 = [31 x i8] c"No valid /bin/sh in container\0A\00"
@.str.4 = [13 x i8] c"Retval = %d\0A\00"
define void @action_ready(i8* %0) {
%2 = tail call i32 (i32, i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_singularity_message to i32 (i32, i8*, i8*, i32, i8*, i8*, ...)*)(i32 5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.action_ready, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 38, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @joinpath to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @is_exec to i32 (i32, ...)*)(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @joinpath to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @is_link to i32 (i32, ...)*)(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = tail call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_singularity_message to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 -3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.action_ready, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 41, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i32 (i32, i8*, i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @_singularity_message to i32 (i32, i8*, i8*, i32, i8*, i32, ...)*)(i32 -4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.action_ready, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 255)
tail call void @exit(i32 255)
unreachable
13: ; preds = %6, %1
ret void
}