#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 getgroups(int, unsigned int *);
unsigned int *malloc(int);
scalar_t__ memcmp(unsigned int *, unsigned int *, int);
scalar_t__ setgroups(int, unsigned int *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ test_daemon();
int /*<<< orphan*/ test_init(int, char **);
int /*<<< orphan*/ test_msg(char *, ...);
int /*<<< orphan*/ test_waitsig();
int main(int argc, char **argv) {
  int ng;
  unsigned int *grp, *grp2, i, max;
  test_init(argc, argv);
  ng = getgroups(0, NULL);
  if (ng < 0) {
    test_msg("ERR: %s:%d: "
             "Can't get groups"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/eabatalov/criu/refs/heads/master/test/"
             "zdtm/static/groups.c",
             24, errno, strerror(errno));
    return -1;
  }
  grp = malloc((ng + 1) * sizeof(*grp));
  ng = getgroups(ng, grp);
  if (ng < 0) {
    test_msg("ERR: %s:%d: "
             "Can't get groups2"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/eabatalov/criu/refs/heads/master/test/"
             "zdtm/static/groups.c",
             31, errno, strerror(errno));
    return -1;
  }
  max = 0;
  for (i = 0; i < ng; i++)
    if (max < grp[i])
      max = grp[i];
  grp[ng++] = max + 1;
  if (setgroups(ng, grp) < 0) {
    test_msg("ERR: %s:%d: "
             "Can't set groups"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/eabatalov/criu/refs/heads/master/test/"
             "zdtm/static/groups.c",
             43, errno, strerror(errno));
    return -1;
  }
  test_daemon();
  test_waitsig();
  grp2 = malloc(ng * sizeof(*grp2));
  if (getgroups(ng, grp2) != ng) {
    test_msg("FAIL: %s:%d: "
             "Nr groups changed"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/eabatalov/criu/refs/heads/master/test/"
             "zdtm/static/groups.c",
             53, errno, strerror(errno));
    return -1;
  }
  if (memcmp(grp, grp2, ng * sizeof(*grp))) {
    test_msg("FAIL: %s:%d: "
             "Groups have changed"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/eabatalov/criu/refs/heads/master/test/"
             "zdtm/static/groups.c",
             58, errno, strerror(errno));
    return -1;
  }
  test_msg("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <getgroups@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1210 <main+0x80>
mov    0x2e0f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x34(%rbp),%ecx
mov    %eax,%r8d
lea    0xe0f(%rip),%rdi
lea    0xe38(%rip),%rsi
mov    $0x18,%edx
mov    $0x0,%al
call   1060 <test_msg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1442 <main+0x2b2>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1090 <getgroups@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1286 <main+0xf6>
mov    0x2d99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    0x2d8d(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x38(%rbp),%ecx
mov    %eax,%r8d
lea    0xe5e(%rip),%rdi
lea    0xdc2(%rip),%rsi
mov    $0x1f,%edx
mov    $0x0,%al
call   1060 <test_msg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1442 <main+0x2b2>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    12d3 <main+0x143>
mov    -0x30(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x2c(%rbp),%edx
cmp    (%rcx,%rdx,4),%eax
jae    12c0 <main+0x130>
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x30(%rbp)
jmp    12c5 <main+0x135>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1294 <main+0x104>
mov    -0x30(%rbp),%edx
add    $0x1,%edx
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <setgroups@plt>
cmp    $0x0,%rax
jge    134a <main+0x1ba>
mov    0x2cd5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2cc9(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x3c(%rbp),%ecx
mov    %eax,%r8d
lea    0xdcb(%rip),%rdi
lea    0xcfe(%rip),%rsi
mov    $0x2b,%edx
mov    $0x0,%al
call   1060 <test_msg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1442 <main+0x2b2>
mov    $0x0,%al
call   1040 <test_daemon@plt>
mov    $0x0,%al
call   1080 <test_waitsig@plt>
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1090 <getgroups@plt>
cmp    -0x14(%rbp),%eax
je     13c6 <main+0x236>
mov    0x2c59(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    0x2c4d(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x40(%rbp),%ecx
mov    %eax,%r8d
lea    0xd7f(%rip),%rdi
lea    0xc82(%rip),%rsi
mov    $0x35,%edx
mov    $0x0,%al
call   1060 <test_msg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1442 <main+0x2b2>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1070 <memcmp@plt>
cmp    $0x0,%rax
je     142d <main+0x29d>
mov    0x2bf2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2be6(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x44(%rbp),%ecx
mov    %eax,%r8d
lea    0xd4a(%rip),%rdi
lea    0xc1b(%rip),%rsi
mov    $0x3a,%edx
mov    $0x0,%al
call   1060 <test_msg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1442 <main+0x2b2>
lea    0xd58(%rip),%rdi
mov    $0x0,%al
call   1060 <test_msg@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
call   1030 <test_init@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1090 <getgroups@plt>
test   %eax,%eax
js     11df <main+0x4f>
mov    %eax,%ebp
lea    0x4(,%rbp,4),%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
call   1090 <getgroups@plt>
test   %eax,%eax
js     1207 <main+0x77>
mov    %eax,%r14d
je     122f <main+0x9f>
mov    %r14d,%eax
cmp    $0x8,%r14d
jae    1239 <main+0xa9>
xor    %ecx,%ecx
xor    %edx,%edx
jmp    13f0 <main+0x260>
mov    0x2dfa(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10b0 <strerror@plt>
lea    0xe1a(%rip),%rdi
lea    0xe43(%rip),%rsi
mov    $0x18,%edx
jmp    14d3 <main+0x343>
mov    0x2dd2(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10b0 <strerror@plt>
lea    0xeb7(%rip),%rdi
lea    0xe1b(%rip),%rsi
mov    $0x1f,%edx
jmp    14d3 <main+0x343>
mov    $0x1,%edx
jmp    1404 <main+0x274>
mov    %eax,%ecx
and    $0xfffffff8,%ecx
lea    -0x8(%rcx),%rsi
mov    %rsi,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     14f1 <main+0x361>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
pxor   %xmm0,%xmm0
xor    %esi,%esi
movdqa 0xd94(%rip),%xmm8
pxor   %xmm1,%xmm1
movdqa %xmm0,%xmm4
pxor   %xmm8,%xmm4
movdqu (%rbx,%rsi,4),%xmm2
movdqu 0x10(%rbx,%rsi,4),%xmm7
movdqu 0x20(%rbx,%rsi,4),%xmm6
movdqu 0x30(%rbx,%rsi,4),%xmm3
movdqa %xmm2,%xmm5
pxor   %xmm8,%xmm5
pcmpgtd %xmm5,%xmm4
pand   %xmm4,%xmm0
pandn  %xmm2,%xmm4
por    %xmm0,%xmm4
movdqa %xmm1,%xmm5
pxor   %xmm8,%xmm5
movdqa %xmm7,%xmm0
pxor   %xmm8,%xmm0
pcmpgtd %xmm0,%xmm5
pand   %xmm5,%xmm1
pandn  %xmm7,%xmm5
por    %xmm1,%xmm5
movdqa %xmm4,%xmm0
pxor   %xmm8,%xmm0
movdqa %xmm6,%xmm1
pxor   %xmm8,%xmm1
pcmpgtd %xmm1,%xmm0
pand   %xmm0,%xmm4
pandn  %xmm6,%xmm0
por    %xmm4,%xmm0
movdqa %xmm5,%xmm1
pxor   %xmm8,%xmm1
movdqa %xmm3,%xmm2
pxor   %xmm8,%xmm2
pcmpgtd %xmm2,%xmm1
pand   %xmm1,%xmm5
pandn  %xmm3,%xmm1
por    %xmm5,%xmm1
add    $0x10,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1270 <main+0xe0>
test   $0x1,%dl
je     1371 <main+0x1e1>
movdqu (%rbx,%rsi,4),%xmm2
movdqu 0x10(%rbx,%rsi,4),%xmm3
movdqa 0xccb(%rip),%xmm4
movdqa %xmm0,%xmm5
pxor   %xmm4,%xmm5
movdqa %xmm2,%xmm6
pxor   %xmm4,%xmm6
pcmpgtd %xmm6,%xmm5
pand   %xmm5,%xmm0
pandn  %xmm2,%xmm5
por    %xmm5,%xmm0
movdqa %xmm1,%xmm2
pxor   %xmm4,%xmm2
pxor   %xmm3,%xmm4
pcmpgtd %xmm4,%xmm2
pand   %xmm2,%xmm1
pandn  %xmm3,%xmm2
por    %xmm2,%xmm1
movdqa 0xc87(%rip),%xmm2
movdqa %xmm1,%xmm3
pxor   %xmm2,%xmm3
movdqa %xmm0,%xmm4
pxor   %xmm2,%xmm4
pcmpgtd %xmm3,%xmm4
pand   %xmm4,%xmm0
pandn  %xmm1,%xmm4
por    %xmm0,%xmm4
pshufd $0xee,%xmm4,%xmm0
movdqa %xmm4,%xmm1
pxor   %xmm2,%xmm1
movdqa %xmm0,%xmm3
pxor   %xmm2,%xmm3
pcmpgtd %xmm3,%xmm1
pand   %xmm1,%xmm4
pandn  %xmm0,%xmm1
por    %xmm4,%xmm1
pshufd $0x55,%xmm1,%xmm0
movdqa %xmm1,%xmm3
pxor   %xmm2,%xmm3
pxor   %xmm0,%xmm2
pcmpgtd %xmm2,%xmm3
pand   %xmm3,%xmm1
pandn  %xmm0,%xmm3
por    %xmm1,%xmm3
movd   %xmm3,%edx
cmp    %rax,%rcx
je     1401 <main+0x271>
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rcx,4),%esi
cmp    %esi,%edx
cmovb  %esi,%edx
add    $0x1,%rcx
cmp    %rcx,%rax
jne    13f0 <main+0x260>
add    $0x1,%edx
movslq %r14d,%rax
add    $0x1,%r14d
mov    %edx,(%rbx,%rax,4)
mov    %r14d,%edi
mov    %rbx,%rsi
call   1050 <setgroups@plt>
test   %rax,%rax
js     148b <main+0x2fb>
xor    %eax,%eax
call   1040 <test_daemon@plt>
xor    %eax,%eax
call   1080 <test_waitsig@plt>
lea    0x0(,%r14,4),%r15d
mov    %r15d,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbp
mov    %r14d,%edi
mov    %rax,%rsi
call   1090 <getgroups@plt>
cmp    %r14d,%eax
jne    14b0 <main+0x320>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15d,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     1509 <main+0x379>
mov    0x2b73(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10b0 <strerror@plt>
lea    0xceb(%rip),%rdi
lea    0xbbc(%rip),%rsi
mov    $0x3a,%edx
jmp    14d3 <main+0x343>
mov    0x2b4e(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10b0 <strerror@plt>
lea    0xc64(%rip),%rdi
lea    0xb97(%rip),%rsi
mov    $0x2b,%edx
jmp    14d3 <main+0x343>
mov    0x2b29(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10b0 <strerror@plt>
lea    0xc6f(%rip),%rdi
lea    0xb72(%rip),%rsi
mov    $0x35,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1060 <test_msg@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
pxor   %xmm0,%xmm0
xor    %esi,%esi
pxor   %xmm1,%xmm1
test   $0x1,%dl
jne    1322 <main+0x192>
jmp    1371 <main+0x1e1>
lea    0xc8c(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <test_msg@plt>
jmp    14e4 <main+0x354>

LLVM IR (-O0):
@.str = [48 x i8] c"ERR: %s:%d: Can't get groups (errno = %d (%s))\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/eabatalov/criu/refs/heads/master/test/zdtm/static/groups.c\00"
@errno = global i32 0
@.str.2 = [49 x i8] c"ERR: %s:%d: Can't get groups2 (errno = %d (%s))\0A\00"
@.str.3 = [48 x i8] c"ERR: %s:%d: Can't set groups (errno = %d (%s))\0A\00"
@.str.4 = [50 x i8] c"FAIL: %s:%d: Nr groups changed (errno = %d (%s))\0A\00"
@.str.5 = [52 x i8] c"FAIL: %s:%d: Groups have changed (errno = %d (%s))\0A\00"
@.str.6 = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @test_init(i32 %11, i8** %12)
%14 = call i32 @getgroups(i32 0, i32* null)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %2
%18 = load i32, i32* @errno
%19 = load i32, i32* @errno
%20 = call i32 @strerror(i32 %19)
%21 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 24, i32 %18, i32 %20)
store i32 -1, i32* %3
br label %113
22: ; preds = %2
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = mul i64 %25, 4
%27 = trunc i64 %26 to i32
%28 = call i32* @malloc(i32 %27)
store i32* %28, i32** %7
%29 = load i32, i32* %6
%30 = load i32*, i32** %7
%31 = call i32 @getgroups(i32 %29, i32* %30)
store i32 %31, i32* %6
%32 = load i32, i32* %6
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %22
%35 = load i32, i32* @errno
%36 = load i32, i32* @errno
%37 = call i32 @strerror(i32 %36)
%38 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 31, i32 %35, i32 %37)
store i32 -1, i32* %3
br label %113
39: ; preds = %22
store i32 0, i32* %10
store i32 0, i32* %9
br label %40
40: ; preds = %59, %39
%41 = load i32, i32* %9
%42 = load i32, i32* %6
%43 = icmp ult i32 %41, %42
br i1 %43, label %44, label %62
44: ; preds = %40
%45 = load i32, i32* %10
%46 = load i32*, i32** %7
%47 = load i32, i32* %9
%48 = zext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %46, i64 %48
%50 = load i32, i32* %49
%51 = icmp ult i32 %45, %50
br i1 %51, label %52, label %58
52: ; preds = %44
%53 = load i32*, i32** %7
%54 = load i32, i32* %9
%55 = zext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %53, i64 %55
%57 = load i32, i32* %56
store i32 %57, i32* %10
br label %58
58: ; preds = %52, %44
br label %59
59: ; preds = %58
%60 = load i32, i32* %9
%61 = add i32 %60, 1
store i32 %61, i32* %9
br label %40
62: ; preds = %40
%63 = load i32, i32* %10
%64 = add i32 %63, 1
%65 = load i32*, i32** %7
%66 = load i32, i32* %6
%67 = add nsw i32 %66, 1
store i32 %67, i32* %6
%68 = sext i32 %66 to i64
%69 = getelementptr inbounds i32, i32* %65, i64 %68
store i32 %64, i32* %69
%70 = load i32, i32* %6
%71 = load i32*, i32** %7
%72 = call i64 @setgroups(i32 %70, i32* %71)
%73 = icmp slt i64 %72, 0
br i1 %73, label %74, label %79
74: ; preds = %62
%75 = load i32, i32* @errno
%76 = load i32, i32* @errno
%77 = call i32 @strerror(i32 %76)
%78 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 43, i32 %75, i32 %77)
store i32 -1, i32* %3
br label %113
79: ; preds = %62
%80 = call i32 (...) @test_daemon()
%81 = call i32 (...) @test_waitsig()
%82 = load i32, i32* %6
%83 = sext i32 %82 to i64
%84 = mul i64 %83, 4
%85 = trunc i64 %84 to i32
%86 = call i32* @malloc(i32 %85)
store i32* %86, i32** %8
%87 = load i32, i32* %6
%88 = load i32*, i32** %8
%89 = call i32 @getgroups(i32 %87, i32* %88)
%90 = load i32, i32* %6
%91 = icmp ne i32 %89, %90
br i1 %91, label %92, label %97
92: ; preds = %79
%93 = load i32, i32* @errno
%94 = load i32, i32* @errno
%95 = call i32 @strerror(i32 %94)
%96 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 53, i32 %93, i32 %95)
store i32 -1, i32* %3
br label %113
97: ; preds = %79
%98 = load i32*, i32** %7
%99 = load i32*, i32** %8
%100 = load i32, i32* %6
%101 = sext i32 %100 to i64
%102 = mul i64 %101, 4
%103 = trunc i64 %102 to i32
%104 = call i64 @memcmp(i32* %98, i32* %99, i32 %103)
%105 = icmp ne i64 %104, 0
br i1 %105, label %106, label %111
106: ; preds = %97
%107 = load i32, i32* @errno
%108 = load i32, i32* @errno
%109 = call i32 @strerror(i32 %108)
%110 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 58, i32 %107, i32 %109)
store i32 -1, i32* %3
br label %113
111: ; preds = %97
%112 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %3
br label %113
113: ; preds = %111, %106, %92, %74, %34, %17
%114 = load i32, i32* %3
ret i32 %114
}

LLVM IR (-O2):
@.str = [48 x i8] c"ERR: %s:%d: Can't get groups (errno = %d (%s))\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/eabatalov/criu/refs/heads/master/test/zdtm/static/groups.c\00"
@errno = global i32 0
@.str.2 = [49 x i8] c"ERR: %s:%d: Can't get groups2 (errno = %d (%s))\0A\00"
@.str.3 = [48 x i8] c"ERR: %s:%d: Can't set groups (errno = %d (%s))\0A\00"
@.str.4 = [50 x i8] c"FAIL: %s:%d: Nr groups changed (errno = %d (%s))\0A\00"
@.str.5 = [52 x i8] c"FAIL: %s:%d: Groups have changed (errno = %d (%s))\0A\00"
@.str.6 = [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 i32 @getgroups(i32 0, i32* null)
%5 = icmp slt i32 %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 ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 24, i32 %7, i32 %8)
br label %134
10: ; preds = %2
%11 = shl i32 %4, 2
%12 = add i32 %11, 4
%13 = tail call i32* @malloc(i32 %12)
%14 = tail call i32 @getgroups(i32 %4, i32* %13)
%15 = icmp slt i32 %14, 0
br i1 %15, label %87, label %16
16: ; preds = %10
%17 = icmp eq i32 %14, 0
br i1 %17, label %103, label %18
18: ; preds = %16
%19 = zext i32 %14 to i64
%20 = icmp ult i32 %14, 8
br i1 %20, label %84, label %21
21: ; preds = %18
%22 = and i64 %19, 4294967288
%23 = add nsw i64 %22, -8
%24 = lshr exact i64 %23, 3
%25 = add nuw nsw i64 %24, 1
%26 = and i64 %25, 1
%27 = icmp eq i64 %23, 0
br i1 %27, label %59, label %28
28: ; preds = %21
%29 = and i64 %25, 4611686018427387902
br label %30
30: ; preds = %30, %28
%31 = phi i64 [ 0, %28 ], [ %56, %30 ]
%32 = phi <4 x i32> [ zeroinitializer, %28 ], [ %54, %30 ]
%33 = phi <4 x i32> [ zeroinitializer, %28 ], [ %55, %30 ]
%34 = phi i64 [ 0, %28 ], [ %57, %30 ]
%35 = getelementptr inbounds i32, i32* %13, i64 %31
%36 = bitcast i32* %35 to <4 x i32>*
%37 = load <4 x i32>, <4 x i32>* %36
%38 = getelementptr inbounds i32, i32* %35, i64 4
%39 = bitcast i32* %38 to <4 x i32>*
%40 = load <4 x i32>, <4 x i32>* %39
%41 = icmp ult <4 x i32> %32, %37
%42 = icmp ult <4 x i32> %33, %40
%43 = select <4 x i1> %41, <4 x i32> %37, <4 x i32> %32
%44 = select <4 x i1> %42, <4 x i32> %40, <4 x i32> %33
%45 = or i64 %31, 8
%46 = getelementptr inbounds i32, i32* %13, i64 %45
%47 = bitcast i32* %46 to <4 x i32>*
%48 = load <4 x i32>, <4 x i32>* %47
%49 = getelementptr inbounds i32, i32* %46, i64 4
%50 = bitcast i32* %49 to <4 x i32>*
%51 = load <4 x i32>, <4 x i32>* %50
%52 = icmp ult <4 x i32> %43, %48
%53 = icmp ult <4 x i32> %44, %51
%54 = select <4 x i1> %52, <4 x i32> %48, <4 x i32> %43
%55 = select <4 x i1> %53, <4 x i32> %51, <4 x i32> %44
%56 = add nuw i64 %31, 16
%57 = add i64 %34, 2
%58 = icmp eq i64 %57, %29
br i1 %58, label %59, label %30
59: ; preds = %30, %21
%60 = phi <4 x i32> [ undef, %21 ], [ %54, %30 ]
%61 = phi <4 x i32> [ undef, %21 ], [ %55, %30 ]
%62 = phi i64 [ 0, %21 ], [ %56, %30 ]
%63 = phi <4 x i32> [ zeroinitializer, %21 ], [ %54, %30 ]
%64 = phi <4 x i32> [ zeroinitializer, %21 ], [ %55, %30 ]
%65 = icmp eq i64 %26, 0
br i1 %65, label %77, label %66
66: ; preds = %59
%67 = getelementptr inbounds i32, i32* %13, i64 %62
%68 = bitcast i32* %67 to <4 x i32>*
%69 = load <4 x i32>, <4 x i32>* %68
%70 = getelementptr inbounds i32, i32* %67, i64 4
%71 = bitcast i32* %70 to <4 x i32>*
%72 = load <4 x i32>, <4 x i32>* %71
%73 = icmp ult <4 x i32> %63, %69
%74 = icmp ult <4 x i32> %64, %72
%75 = select <4 x i1> %73, <4 x i32> %69, <4 x i32> %63
%76 = select <4 x i1> %74, <4 x i32> %72, <4 x i32> %64
br label %77
77: ; preds = %59, %66
%78 = phi <4 x i32> [ %60, %59 ], [ %75, %66 ]
%79 = phi <4 x i32> [ %61, %59 ], [ %76, %66 ]
%80 = icmp ugt <4 x i32> %78, %79
%81 = select <4 x i1> %80, <4 x i32> %78, <4 x i32> %79
%82 = call i32 @llvm.vector.reduce.umax.v4i32(<4 x i32> %81)
%83 = icmp eq i64 %22, %19
br i1 %83, label %100, label %84
84: ; preds = %18, %77
%85 = phi i64 [ 0, %18 ], [ %22, %77 ]
%86 = phi i32 [ 0, %18 ], [ %82, %77 ]
br label %91
87: ; preds = %10
%88 = load i32, i32* @errno
%89 = tail call i32 @strerror(i32 %88)
%90 = tail call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 31, i32 %88, i32 %89)
br label %134
91: ; preds = %84, %91
%92 = phi i64 [ %98, %91 ], [ %85, %84 ]
%93 = phi i32 [ %97, %91 ], [ %86, %84 ]
%94 = getelementptr inbounds i32, i32* %13, i64 %92
%95 = load i32, i32* %94
%96 = icmp ult i32 %93, %95
%97 = select i1 %96, i32 %95, i32 %93
%98 = add nuw nsw i64 %92, 1
%99 = icmp eq i64 %98, %19
br i1 %99, label %100, label %91
100: ; preds = %91, %77
%101 = phi i32 [ %82, %77 ], [ %97, %91 ]
%102 = add i32 %101, 1
br label %103
103: ; preds = %100, %16
%104 = phi i32 [ 1, %16 ], [ %102, %100 ]
%105 = add nsw i32 %14, 1
%106 = sext i32 %14 to i64
%107 = getelementptr inbounds i32, i32* %13, i64 %106
store i32 %104, i32* %107
%108 = tail call i64 @setgroups(i32 %105, i32* %13)
%109 = icmp slt i64 %108, 0
br i1 %109, label %110, label %114
110: ; preds = %103
%111 = load i32, i32* @errno
%112 = tail call i32 @strerror(i32 %111)
%113 = tail call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 43, i32 %111, i32 %112)
br label %134
114: ; preds = %103
%115 = tail call i32 (...) @test_daemon()
%116 = tail call i32 (...) @test_waitsig()
%117 = shl i32 %105, 2
%118 = tail call i32* @malloc(i32 %117)
%119 = tail call i32 @getgroups(i32 %105, i32* %118)
%120 = icmp eq i32 %119, %105
br i1 %120, label %125, label %121
121: ; preds = %114
%122 = load i32, i32* @errno
%123 = tail call i32 @strerror(i32 %122)
%124 = tail call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 53, i32 %122, i32 %123)
br label %134
125: ; preds = %114
%126 = tail call i64 @memcmp(i32* %13, i32* %118, i32 %117)
%127 = icmp eq i64 %126, 0
br i1 %127, label %132, label %128
128: ; preds = %125
%129 = load i32, i32* @errno
%130 = tail call i32 @strerror(i32 %129)
%131 = tail call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 58, i32 %129, i32 %130)
br label %134
132: ; preds = %125
%133 = tail call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %134
134: ; preds = %132, %128, %121, %110, %87, %6
%135 = phi i32 [ -1, %6 ], [ -1, %87 ], [ -1, %110 ], [ -1, %121 ], [ -1, %128 ], [ 0, %132 ]
ret i32 %135
}