#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;
unsigned int getgroups(unsigned int, unsigned int *);
unsigned int *malloc(unsigned int);
scalar_t__ memcmp(unsigned int *, unsigned int *, unsigned int);
scalar_t__ setgroups(unsigned 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) {
  unsigned int ng, *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/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/groups.c",
             23, 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/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/groups.c",
             30, 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/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/groups.c",
             42, 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/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/groups.c",
             52, 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/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/groups.c",
             57, 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)
jae    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    $0x17,%edx
mov    $0x0,%al
call   1060 <test_msg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    143f <main+0x2af>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
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)
jae    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    0xe5f(%rip),%rdi
lea    0xdc2(%rip),%rsi
mov    $0x1e,%edx
mov    $0x0,%al
call   1060 <test_msg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    143f <main+0x2af>
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)
mov    %ecx,%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <setgroups@plt>
cmp    $0x0,%rax
jge    1349 <main+0x1b9>
mov    0x2cd6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2cca(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x3c(%rbp),%ecx
mov    %eax,%r8d
lea    0xdcd(%rip),%rdi
lea    0xcff(%rip),%rsi
mov    $0x2a,%edx
mov    $0x0,%al
call   1060 <test_msg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    143f <main+0x2af>
mov    $0x0,%al
call   1040 <test_daemon@plt>
mov    $0x0,%al
call   1080 <test_waitsig@plt>
mov    -0x14(%rbp),%eax
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     13c4 <main+0x234>
mov    0x2c5b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    0x2c4f(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x40(%rbp),%ecx
mov    %eax,%r8d
lea    0xd82(%rip),%rdi
lea    0xc84(%rip),%rsi
mov    $0x34,%edx
mov    $0x0,%al
call   1060 <test_msg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    143f <main+0x2af>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x2,%rax
mov    %eax,%edx
call   1070 <memcmp@plt>
cmp    $0x0,%rax
je     142a <main+0x29a>
mov    0x2bf5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2be9(%rip),%rax
mov    (%rax),%edi
call   10b0 <strerror@plt>
mov    -0x44(%rbp),%ecx
mov    %eax,%r8d
lea    0xd4e(%rip),%rdi
lea    0xc1e(%rip),%rsi
mov    $0x39,%edx
mov    $0x0,%al
call   1060 <test_msg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    143f <main+0x2af>
lea    0xd5c(%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    %ebp,%ebp
xor    %edi,%edi
xor    %esi,%esi
call   1090 <getgroups@plt>
mov    %eax,%r14d
lea    0x4(,%r14,4),%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
mov    %r14d,%edi
mov    %rax,%rsi
call   1090 <getgroups@plt>
mov    %eax,%r14d
test   %eax,%eax
je     11dc <main+0x4c>
mov    %r14d,%eax
cmp    $0x8,%r14d
jae    11e8 <main+0x58>
xor    %ecx,%ecx
jmp    13a0 <main+0x210>
mov    $0x1,%ebp
xor    %eax,%eax
jmp    13b4 <main+0x224>
mov    %eax,%ecx
and    $0xfffffff8,%ecx
lea    -0x8(%rcx),%rsi
mov    %rsi,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     149e <main+0x30e>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
pxor   %xmm0,%xmm0
xor    %esi,%esi
movdqa 0xde5(%rip),%xmm8
pxor   %xmm1,%xmm1
nop
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    1220 <main+0x90>
test   $0x1,%dl
je     1321 <main+0x191>
movdqu (%rbx,%rsi,4),%xmm2
movdqu 0x10(%rbx,%rsi,4),%xmm3
movdqa 0xd1b(%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 0xcd7(%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,%ebp
cmp    %rax,%rcx
je     13b1 <main+0x221>
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rcx,4),%edx
cmp    %edx,%ebp
cmovb  %edx,%ebp
add    $0x1,%rcx
cmp    %rcx,%rax
jne    13a0 <main+0x210>
add    $0x1,%ebp
add    $0x1,%r14d
mov    %ebp,(%rbx,%rax,4)
mov    %r14d,%edi
mov    %rbx,%rsi
call   1050 <setgroups@plt>
test   %rax,%rax
js     1438 <main+0x2a8>
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    145d <main+0x2cd>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15d,%edx
call   1070 <memcmp@plt>
test   %rax,%rax
je     14b6 <main+0x326>
mov    0x2bc6(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10b0 <strerror@plt>
lea    0xcde(%rip),%rdi
lea    0xbdf(%rip),%rsi
mov    $0x39,%edx
jmp    1480 <main+0x2f0>
mov    0x2ba1(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10b0 <strerror@plt>
lea    0xc57(%rip),%rdi
lea    0xbba(%rip),%rsi
mov    $0x2a,%edx
jmp    1480 <main+0x2f0>
mov    0x2b7c(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10b0 <strerror@plt>
lea    0xc62(%rip),%rdi
lea    0xb95(%rip),%rsi
mov    $0x34,%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    12d2 <main+0x142>
jmp    1321 <main+0x191>
lea    0xc7f(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <test_msg@plt>
jmp    1491 <main+0x301>

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