#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 */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ isspace(char);
int /*<<< orphan*/ stderr;
int contains_whitespace(char *value) {
  do {
    if ((value == NULL)) {
      fprintf(stderr,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/sebgod/docker-mercury/refs/heads/"
              "master/src/mmc-docker.c"
              ":"
              "78"
              ": "
              "%s is NULL",
              ("value"));
      exit(EXIT_FAILURE);
    }
  } while (0);
  for (; *value != '\0'; value++) {
    if (isspace(*value)) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<contains_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <contains_whitespace+0x41>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
lea    0xf44(%rip),%rdx
call   1040 <fprintf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
jmp    1176 <contains_whitespace+0x46>
jmp    117b <contains_whitespace+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11c3 <contains_whitespace+0x93>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     11ad <contains_whitespace+0x7d>
movl   $0x1,-0x4(%rbp)
jmp    11ca <contains_whitespace+0x9a>
jmp    11b2 <contains_whitespace+0x82>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    117b <contains_whitespace+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains_whitespace>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1178 <contains_whitespace+0x48>
mov    %rdi,%rbx
mov    (%rdi),%al
xor    %ebp,%ebp
test   %al,%al
je     116f <contains_whitespace+0x3f>
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    116a <contains_whitespace+0x3a>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1150 <contains_whitespace+0x20>
jmp    116f <contains_whitespace+0x3f>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
lea    0xe78(%rip),%rsi
lea    0xf13(%rip),%rdx
call   1040 <fprintf@plt>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sebgod/docker-mercury/refs/heads/master/src/mmc-docker.c:78: %s is NULL\00"
@.str.1 = [6 x i8] c"value\00"
@EXIT_FAILURE = global i32 0
define i32 @contains_whitespace(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %1
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %4
br label %13
13: ; preds = %12
br label %14
14: ; preds = %26, %13
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %29
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = call i64 @isspace(i8 signext %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %19
store i32 1, i32* %2
br label %30
25: ; preds = %19
br label %26
26: ; preds = %25
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
br label %14
29: ; preds = %14
store i32 0, i32* %2
br label %30
30: ; preds = %29, %24
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sebgod/docker-mercury/refs/heads/master/src/mmc-docker.c:78: %s is NULL\00"
@.str.1 = [6 x i8] c"value\00"
@EXIT_FAILURE = global i32 0
define i32 @contains_whitespace(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %20, label %14
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %14
%12 = load i8, i8* %19
%13 = icmp eq i8 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %3, %11
%15 = phi i8 [ %12, %11 ], [ %4, %3 ]
%16 = phi i8* [ %19, %11 ], [ %0, %3 ]
%17 = tail call i64 @isspace(i8 signext %15)
%18 = icmp eq i64 %17, 0
%19 = getelementptr inbounds i8, i8* %16, i64 1
br i1 %18, label %11, label %20
20: ; preds = %14, %11, %3
%21 = phi i32 [ 0, %3 ], [ 0, %11 ], [ 1, %14 ]
ret i32 %21
}