#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*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ test_daemon();
int /*<<< orphan*/ test_init(int, char **);
int /*<<< orphan*/ test_msg(char *, ...);
int /*<<< orphan*/ test_waitsig();
scalar_t__ umount(char *);
int main(int argc, char **argv) {
  test_init(argc, argv);
  if (umount("/proc") < 0)
    test_msg("ERR: %s:%d: "
             "Can't umount proc\n"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/clean_mntns.c",
             15, errno, strerror(errno));
  if (umount("/dev/pts") < 0)
    test_msg("ERR: %s:%d: "
             "Can't umount devpts\n"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/clean_mntns.c",
             18, errno, strerror(errno));
  test_daemon();
  test_waitsig();
  test_msg("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_init@plt>
lea    0xe77(%rip),%rdi
call   1040 <umount@plt>
cmp    $0x0,%rax
jge    11d2 <main+0x72>
mov    0x2e41(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
call   1080 <strerror@plt>
mov    -0x14(%rbp),%ecx
mov    %eax,%r8d
lea    0xe47(%rip),%rdi
lea    0xe72(%rip),%rsi
mov    $0xf,%edx
mov    $0x0,%al
call   1060 <test_msg@plt>
lea    0xefa(%rip),%rdi
call   1040 <umount@plt>
cmp    $0x0,%rax
jge    1222 <main+0xc2>
mov    0x2df1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    0x2de5(%rip),%rax
mov    (%rax),%edi
call   1080 <strerror@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%r8d
lea    0xecd(%rip),%rdi
lea    0xe22(%rip),%rsi
mov    $0x12,%edx
mov    $0x0,%al
call   1060 <test_msg@plt>
mov    $0x0,%al
call   1050 <test_daemon@plt>
mov    $0x0,%al
call   1070 <test_waitsig@plt>
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1060 <test_msg@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1030 <test_init@plt>
lea    0xe93(%rip),%rdi
call   1040 <umount@plt>
test   %rax,%rax
jns    11a6 <main+0x46>
mov    0x2e62(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1080 <strerror@plt>
lea    0xe78(%rip),%rdi
lea    0xea3(%rip),%rsi
mov    $0xf,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1060 <test_msg@plt>
lea    0xf26(%rip),%rdi
call   1040 <umount@plt>
test   %rax,%rax
jns    11e6 <main+0x86>
mov    0x2e22(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1080 <strerror@plt>
lea    0xf0e(%rip),%rdi
lea    0xe63(%rip),%rsi
mov    $0x12,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1060 <test_msg@plt>
xor    %eax,%eax
call   1050 <test_daemon@plt>
xor    %eax,%eax
call   1070 <test_waitsig@plt>
lea    0xf15(%rip),%rdi
xor    %eax,%eax
call   1060 <test_msg@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"/proc\00"
@.str.1 = [50 x i8] c"ERR: %s:%d: Can't umount proc\0A (errno = %d (%s))\0A\00"
@.str.2 = [155 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/live/static/clean_mntns.c\00"
@errno = global i32 0
@.str.3 = [9 x i8] c"/dev/pts\00"
@.str.4 = [52 x i8] c"ERR: %s:%d: Can't umount devpts\0A (errno = %d (%s))\0A\00"
@.str.5 = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @test_init(i32 %6, i8** %7)
%9 = call i64 @umount(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = load i32, i32* @errno
%14 = call i32 @strerror(i32 %13)
%15 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.2, i64 0, i64 0), i32 15, i32 %12, i32 %14)
br label %16
16: ; preds = %11, %2
%17 = call i64 @umount(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* @errno
%21 = load i32, i32* @errno
%22 = call i32 @strerror(i32 %21)
%23 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.2, i64 0, i64 0), i32 18, i32 %20, i32 %22)
br label %24
24: ; preds = %19, %16
%25 = call i32 (...) @test_daemon()
%26 = call i32 (...) @test_waitsig()
%27 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"/proc\00"
@.str.1 = [50 x i8] c"ERR: %s:%d: Can't umount proc\0A (errno = %d (%s))\0A\00"
@.str.2 = [155 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/live/static/clean_mntns.c\00"
@errno = global i32 0
@.str.3 = [9 x i8] c"/dev/pts\00"
@.str.4 = [52 x i8] c"ERR: %s:%d: Can't umount devpts\0A (errno = %d (%s))\0A\00"
@.str.5 = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_init(i32 %0, i8** %1)
%4 = tail call i64 @umount(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.2, i64 0, i64 0), i32 15, i32 %7, i32 %8)
br label %10
10: ; preds = %6, %2
%11 = tail call i64 @umount(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* @errno
%15 = tail call i32 @strerror(i32 %14)
%16 = tail call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.2, i64 0, i64 0), i32 18, i32 %14, i32 %15)
br label %17
17: ; preds = %13, %10
%18 = tail call i32 (...) @test_daemon()
%19 = tail call i32 (...) @test_waitsig()
%20 = tail call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}