#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int system_available_physical_mem();
char *system_get_username();
int /*<<< orphan*/ system_has_audiogroup();
scalar_t__ system_has_frequencyscaling();
int /*<<< orphan*/ system_has_rtprio_limits_conf();
scalar_t__ system_memlock_amount();
int /*<<< orphan*/ system_user_can_rtprio();
int /*<<< orphan*/ system_user_in_audiogroup();
scalar_t__ system_uses_frequencyscaling();
int sanitycheck(int care_about_realtime, int care_about_freqscaling) {
  int errors = 0;
  int warnings = 0;
  int relogin = 0;
  if (care_about_realtime && !system_user_can_rtprio()) {
    errors++;
    relogin++;
    fprintf(stderr, "\nJACK is running in realtime mode, but you are not "
                    "allowed to use realtime scheduling.\n");
    if (!system_has_rtprio_limits_conf()) {
      errors++;
      relogin++;
      fprintf(stderr, "Please check your /etc/security/limits.conf for the "
                      "following line\n");
      fprintf(stderr, "and correct/add it if necessary:\n\n");
      fprintf(stderr, "  @audio          -       rtprio          99\n");
    } else if (!system_has_audiogroup()) {
      errors++;
      relogin++;
      fprintf(stderr, "\nYour system has no audio group. Please add it by "
                      "executing (as root):\n");
      fprintf(stderr, "  groupadd -r audio\n");
      fprintf(stderr, "  usermod -a -G audio %s\n", system_get_username());
    } else if (!system_user_in_audiogroup()) {
      errors++;
      relogin++;
      fprintf(stderr, "\nYour system has an audio group, but you are not a "
                      "member of it.\n");
      fprintf(
          stderr,
          "Please add yourself to the audio group by executing (as root):\n");
      fprintf(stderr, "  usermod -a -G audio %s\n", system_get_username());
    }
  }
  if (care_about_freqscaling && system_has_frequencyscaling() &&
      system_uses_frequencyscaling()) {
    warnings++;
    fprintf(stderr, "\n--------------------------------------------------------"
                    "------------------------\n");
    fprintf(stderr, "WARNING: Your system seems to use frequency scaling.\n\n");
    fprintf(stderr, "   This can have a serious impact on audio latency. You "
                    "have two choices:\n");
    fprintf(stderr,
            "\t(1)turn it off, e.g. by chosing the 'performance' governor.\n");
    fprintf(stderr,
            "\t(2)Use the HPET clocksource by passing \"-c h\" to JACK\n");
    fprintf(stderr, "\t   (this second option only works on relatively recent "
                    "computers)\n");
    fprintf(stderr, "----------------------------------------------------------"
                    "----------------------\n\n");
  }
  if (0 == system_memlock_amount()) {
    errors++;
    relogin++;
    fprintf(stderr,
            "\nYou are not allowed to lock memory. Please add a line\n");
    fprintf(stderr, "  @audio   -  memlock    %llu\n",
            (system_available_physical_mem() * 3) / 4096);
    fprintf(stderr, "in your /etc/limits.conf.\n");
  }
  if (0 < relogin) {
    fprintf(stderr, "\nAfter applying these changes, please re-login in order "
                    "for them to take effect.\n");
  }
  if (0 < errors) {
    fprintf(stderr, "\nYou don't appear to have a sane system configuration. "
                    "It is very likely that you\n");
    fprintf(stderr, "encounter xruns. Please apply all the above mentioned "
                    "changes and start jack again!\n");
  }
  return errors;
}


x86 assembly (clang, -O0):
<sanitycheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1374 <sanitycheck+0x1d4>
mov    $0x0,%al
call   10c0 <system_user_can_rtprio@plt>
cmp    $0x0,%eax
jne    1374 <sanitycheck+0x1d4>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    0x2dea(%rip),%rax
mov    (%rax),%edi
lea    0xe01(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1070 <system_has_rtprio_limits_conf@plt>
cmp    $0x0,%eax
jne    1272 <sanitycheck+0xd2>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
lea    0xe20(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d9a(%rip),%rax
mov    (%rax),%edi
lea    0xe4d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d83(%rip),%rax
mov    (%rax),%edi
lea    0xe59(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    136f <sanitycheck+0x1cf>
mov    $0x0,%al
call   1090 <system_has_audiogroup@plt>
cmp    $0x0,%eax
jne    12ee <sanitycheck+0x14e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    0x2d45(%rip),%rax
mov    (%rax),%edi
lea    0xe49(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d2e(%rip),%rax
mov    (%rax),%edi
lea    0xe7a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d17(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1080 <system_get_username@plt>
mov    -0x18(%rbp),%edi
mov    %rax,%rdx
lea    0xe68(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    136a <sanitycheck+0x1ca>
mov    $0x0,%al
call   1040 <system_user_in_audiogroup@plt>
cmp    $0x0,%eax
jne    1365 <sanitycheck+0x1c5>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    0x2cc9(%rip),%rax
mov    (%rax),%edi
lea    0xe44(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2cb2(%rip),%rax
mov    (%rax),%edi
lea    0xe6f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2c9b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1080 <system_get_username@plt>
mov    -0x1c(%rbp),%edi
mov    %rax,%rdx
lea    0xdec(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    136a <sanitycheck+0x1ca>
jmp    136f <sanitycheck+0x1cf>
jmp    1374 <sanitycheck+0x1d4>
cmpl   $0x0,-0x8(%rbp)
je     144a <sanitycheck+0x2aa>
mov    $0x0,%al
call   1030 <system_has_frequencyscaling@plt>
cmp    $0x0,%rax
je     144a <sanitycheck+0x2aa>
mov    $0x0,%al
call   10b0 <system_uses_frequencyscaling@plt>
cmp    $0x0,%rax
je     144a <sanitycheck+0x2aa>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    0x2c30(%rip),%rax
mov    (%rax),%edi
lea    0xe2d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2c19(%rip),%rax
mov    (%rax),%edi
lea    0xe69(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2c02(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2beb(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2bd4(%rip),%rax
mov    (%rax),%edi
lea    0xee4(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2bbd(%rip),%rax
mov    (%rax),%edi
lea    0xf05(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2ba6(%rip),%rax
mov    (%rax),%edi
lea    0xf32(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1060 <system_memlock_amount@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    14d0 <sanitycheck+0x330>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    0x2b68(%rip),%rax
mov    (%rax),%edi
lea    0xf47(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2b51(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   10a0 <system_available_physical_mem@plt>
mov    -0x20(%rbp),%edi
imul   $0x3,%eax,%eax
mov    $0x1000,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xf4e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2b20(%rip),%rax
mov    (%rax),%edi
lea    0xf56(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
jge    14f2 <sanitycheck+0x352>
mov    0x2afe(%rip),%rax
mov    (%rax),%edi
lea    0xf4f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jge    152b <sanitycheck+0x38b>
mov    0x2adc(%rip),%rax
mov    (%rax),%edi
lea    0xf7f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2ac5(%rip),%rax
mov    (%rax),%edi
lea    0xfbb(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanitycheck>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
xor    %r14d,%r14d
test   %edi,%edi
je     125e <sanitycheck+0xbe>
xor    %eax,%eax
call   10c0 <system_user_can_rtprio@plt>
mov    $0x0,%ebx
test   %eax,%eax
jne    1260 <sanitycheck+0xc0>
mov    0x2e11(%rip),%r15
mov    (%r15),%edi
lea    0xe27(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1070 <system_has_rtprio_limits_conf@plt>
test   %eax,%eax
je     13cf <sanitycheck+0x22f>
xor    %eax,%eax
call   1090 <system_has_audiogroup@plt>
test   %eax,%eax
je     1404 <sanitycheck+0x264>
xor    %eax,%eax
call   1040 <system_user_in_audiogroup@plt>
mov    $0x1,%ebx
mov    $0x1,%r14b
test   %eax,%eax
jne    1260 <sanitycheck+0xc0>
mov    (%r15),%edi
lea    0xf49(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xf7a(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%ebx
xor    %eax,%eax
call   1080 <system_get_username@plt>
lea    0xf06(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x2,%ebx
test   %ebp,%ebp
jne    1268 <sanitycheck+0xc8>
jmp    1302 <sanitycheck+0x162>
xor    %ebx,%ebx
test   %ebp,%ebp
je     1302 <sanitycheck+0x162>
xor    %eax,%eax
call   1030 <system_has_frequencyscaling@plt>
test   %rax,%rax
je     1302 <sanitycheck+0x162>
xor    %eax,%eax
call   10b0 <system_uses_frequencyscaling@plt>
test   %rax,%rax
je     1302 <sanitycheck+0x162>
mov    0x2d55(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xf51(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xf93(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xfb9(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xff3(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0x1020(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0x1047(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0x107a(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1060 <system_memlock_amount@plt>
test   %rax,%rax
je     1351 <sanitycheck+0x1b1>
test   %r14b,%r14b
jne    13ab <sanitycheck+0x20b>
test   %ebx,%ebx
je     1344 <sanitycheck+0x1a4>
mov    0x2cbe(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0x1160(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0x11a2(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
add    $0x1,%ebx
mov    0x2c85(%rip),%r14
mov    (%r14),%edi
lea    0x1063(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%ebp
xor    %eax,%eax
call   10a0 <system_available_physical_mem@plt>
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rax,2),%edx
add    $0xfff,%edx
test   %ecx,%ecx
cmovns %ecx,%edx
sar    $0xc,%edx
lea    0x106f(%rip),%rsi
mov    %ebp,%edi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%edi
lea    0x107b(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2c2e(%rip),%rax
mov    (%rax),%edi
lea    0x107f(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %ebx,%ebx
jne    131b <sanitycheck+0x17b>
jmp    1344 <sanitycheck+0x1a4>
mov    (%r15),%edi
lea    0xc7f(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xcb2(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xcc4(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1443 <sanitycheck+0x2a3>
mov    (%r15),%edi
lea    0xcdf(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xd16(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%ebx
xor    %eax,%eax
call   1080 <system_get_username@plt>
lea    0xd13(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x2,%ebx
mov    $0x1,%r14b
test   %ebp,%ebp
jne    1268 <sanitycheck+0xc8>
jmp    1302 <sanitycheck+0x162>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [88 x i8] c"\0AJACK is running in realtime mode, but you are not allowed to use realtime scheduling.\0A\00"
@.str.1 = [68 x i8] c"Please check your /etc/security/limits.conf for the following line\0A\00"
@.str.2 = [35 x i8] c"and correct/add it if necessary:\0A\0A\00"
@.str.3 = [46 x i8] c" @audio - rtprio 99\0A\00"
@.str.4 = [72 x i8] c"\0AYour system has no audio group. Please add it by executing (as root):\0A\00"
@.str.5 = [21 x i8] c" groupadd -r audio\0A\00"
@.str.6 = [26 x i8] c" usermod -a -G audio %s\0A\00"
@.str.7 = [66 x i8] c"\0AYour system has an audio group, but you are not a member of it.\0A\00"
@.str.8 = [64 x i8] c"Please add yourself to the audio group by executing (as root):\0A\00"
@.str.9 = [83 x i8] c"\0A--------------------------------------------------------------------------------\0A\00"
@.str.10 = [55 x i8] c"WARNING: Your system seems to use frequency scaling.\0A\0A\00"
@.str.11 = [75 x i8] c" This can have a serious impact on audio latency. You have two choices:\0A\00"
@.str.12 = [62 x i8] c"\09(1)turn it off, e.g. by chosing the 'performance' governor.\0A\00"
@.str.13 = [56 x i8] c"\09(2)Use the HPET clocksource by passing \22-c h\22 to JACK\0A\00"
@.str.14 = [68 x i8] c"\09 (this second option only works on relatively recent computers)\0A\00"
@.str.15 = [83 x i8] c"--------------------------------------------------------------------------------\0A\0A\00"
@.str.16 = [56 x i8] c"\0AYou are not allowed to lock memory. Please add a line\0A\00"
@.str.17 = [31 x i8] c" @audio - memlock %llu\0A\00"
@.str.18 = [27 x i8] c"in your /etc/limits.conf.\0A\00"
@.str.19 = [82 x i8] c"\0AAfter applying these changes, please re-login in order for them to take effect.\0A\00"
@.str.20 = [83 x i8] c"\0AYou don't appear to have a sane system configuration. It is very likely that you\0A\00"
@.str.21 = [85 x i8] c"encounter xruns. Please apply all the above mentioned changes and start jack again!\0A\00"
define i32 @sanitycheck(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %66
10: ; preds = %2
%11 = call i32 (...) @system_user_can_rtprio()
%12 = icmp ne i32 %11, 0
br i1 %12, label %66, label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 1
store i32 %17, i32* %7
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%20 = call i32 (...) @system_has_rtprio_limits_conf()
%21 = icmp ne i32 %20, 0
br i1 %21, label %33, label %22
22: ; preds = %13
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
%27 = load i32, i32* @stderr
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%29 = load i32, i32* @stderr
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
br label %65
33: ; preds = %13
%34 = call i32 (...) @system_has_audiogroup()
%35 = icmp ne i32 %34, 0
br i1 %35, label %48, label %36
36: ; preds = %33
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
%41 = load i32, i32* @stderr
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.4, i64 0, i64 0))
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%45 = load i32, i32* @stderr
%46 = call i8* (...) @system_get_username()
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %46)
br label %64
48: ; preds = %33
%49 = call i32 (...) @system_user_in_audiogroup()
%50 = icmp ne i32 %49, 0
br i1 %50, label %63, label %51
51: ; preds = %48
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 1
store i32 %53, i32* %5
%54 = load i32, i32* %7
%55 = add nsw i32 %54, 1
store i32 %55, i32* %7
%56 = load i32, i32* @stderr
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.7, i64 0, i64 0))
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.8, i64 0, i64 0))
%60 = load i32, i32* @stderr
%61 = call i8* (...) @system_get_username()
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %61)
br label %63
63: ; preds = %51, %48
br label %64
64: ; preds = %63, %36
br label %65
65: ; preds = %64, %22
br label %66
66: ; preds = %65, %10, %2
%67 = load i32, i32* %4
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %92
69: ; preds = %66
%70 = call i64 (...) @system_has_frequencyscaling()
%71 = icmp ne i64 %70, 0
br i1 %71, label %72, label %92
72: ; preds = %69
%73 = call i64 (...) @system_uses_frequencyscaling()
%74 = icmp ne i64 %73, 0
br i1 %74, label %75, label %92
75: ; preds = %72
%76 = load i32, i32* %6
%77 = add nsw i32 %76, 1
store i32 %77, i32* %6
%78 = load i32, i32* @stderr
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.9, i64 0, i64 0))
%80 = load i32, i32* @stderr
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0))
%82 = load i32, i32* @stderr
%83 = call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.11, i64 0, i64 0))
%84 = load i32, i32* @stderr
%85 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.12, i64 0, i64 0))
%86 = load i32, i32* @stderr
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.13, i64 0, i64 0))
%88 = load i32, i32* @stderr
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.14, i64 0, i64 0))
%90 = load i32, i32* @stderr
%91 = call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.15, i64 0, i64 0))
br label %92
92: ; preds = %75, %72, %69, %66
%93 = call i64 (...) @system_memlock_amount()
%94 = icmp eq i64 0, %93
br i1 %94, label %95, label %109
95: ; preds = %92
%96 = load i32, i32* %5
%97 = add nsw i32 %96, 1
store i32 %97, i32* %5
%98 = load i32, i32* %7
%99 = add nsw i32 %98, 1
store i32 %99, i32* %7
%100 = load i32, i32* @stderr
%101 = call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.16, i64 0, i64 0))
%102 = load i32, i32* @stderr
%103 = call i32 (...) @system_available_physical_mem()
%104 = mul nsw i32 %103, 3
%105 = sdiv i32 %104, 4096
%106 = call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.17, i64 0, i64 0), i32 %105)
%107 = load i32, i32* @stderr
%108 = call i32 (i32, i8*, ...) @fprintf(i32 %107, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0))
br label %109
109: ; preds = %95, %92
%110 = load i32, i32* %7
%111 = icmp slt i32 0, %110
br i1 %111, label %112, label %115
112: ; preds = %109
%113 = load i32, i32* @stderr
%114 = call i32 (i32, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.19, i64 0, i64 0))
br label %115
115: ; preds = %112, %109
%116 = load i32, i32* %5
%117 = icmp slt i32 0, %116
br i1 %117, label %118, label %123
118: ; preds = %115
%119 = load i32, i32* @stderr
%120 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.20, i64 0, i64 0))
%121 = load i32, i32* @stderr
%122 = call i32 (i32, i8*, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.21, i64 0, i64 0))
br label %123
123: ; preds = %118, %115
%124 = load i32, i32* %5
ret i32 %124
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [88 x i8] c"\0AJACK is running in realtime mode, but you are not allowed to use realtime scheduling.\0A\00"
@.str.1 = [68 x i8] c"Please check your /etc/security/limits.conf for the following line\0A\00"
@.str.2 = [35 x i8] c"and correct/add it if necessary:\0A\0A\00"
@.str.3 = [46 x i8] c" @audio - rtprio 99\0A\00"
@.str.4 = [72 x i8] c"\0AYour system has no audio group. Please add it by executing (as root):\0A\00"
@.str.5 = [21 x i8] c" groupadd -r audio\0A\00"
@.str.6 = [26 x i8] c" usermod -a -G audio %s\0A\00"
@.str.7 = [66 x i8] c"\0AYour system has an audio group, but you are not a member of it.\0A\00"
@.str.8 = [64 x i8] c"Please add yourself to the audio group by executing (as root):\0A\00"
@.str.9 = [83 x i8] c"\0A--------------------------------------------------------------------------------\0A\00"
@.str.10 = [55 x i8] c"WARNING: Your system seems to use frequency scaling.\0A\0A\00"
@.str.11 = [75 x i8] c" This can have a serious impact on audio latency. You have two choices:\0A\00"
@.str.12 = [62 x i8] c"\09(1)turn it off, e.g. by chosing the 'performance' governor.\0A\00"
@.str.13 = [56 x i8] c"\09(2)Use the HPET clocksource by passing \22-c h\22 to JACK\0A\00"
@.str.14 = [68 x i8] c"\09 (this second option only works on relatively recent computers)\0A\00"
@.str.15 = [83 x i8] c"--------------------------------------------------------------------------------\0A\0A\00"
@.str.16 = [56 x i8] c"\0AYou are not allowed to lock memory. Please add a line\0A\00"
@.str.17 = [31 x i8] c" @audio - memlock %llu\0A\00"
@.str.18 = [27 x i8] c"in your /etc/limits.conf.\0A\00"
@.str.19 = [82 x i8] c"\0AAfter applying these changes, please re-login in order for them to take effect.\0A\00"
@.str.20 = [83 x i8] c"\0AYou don't appear to have a sane system configuration. It is very likely that you\0A\00"
@.str.21 = [85 x i8] c"encounter xruns. Please apply all the above mentioned changes and start jack again!\0A\00"
define i32 @sanitycheck(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %41, label %4
4: ; preds = %2
%5 = tail call i32 (...) @system_user_can_rtprio()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %41
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (...) @system_has_rtprio_limits_conf()
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
br label %41
19: ; preds = %7
%20 = tail call i32 (...) @system_has_audiogroup()
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %30
22: ; preds = %19
%23 = load i32, i32* @stderr
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.4, i64 0, i64 0))
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%27 = load i32, i32* @stderr
%28 = tail call i8* (...) @system_get_username()
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %28)
br label %41
30: ; preds = %19
%31 = tail call i32 (...) @system_user_in_audiogroup()
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %41
33: ; preds = %30
%34 = load i32, i32* @stderr
%35 = tail call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.7, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.8, i64 0, i64 0))
%38 = load i32, i32* @stderr
%39 = tail call i8* (...) @system_get_username()
%40 = tail call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %39)
br label %41
41: ; preds = %12, %30, %33, %22, %4, %2
%42 = phi i1 [ true, %12 ], [ true, %30 ], [ true, %33 ], [ true, %22 ], [ false, %4 ], [ false, %2 ]
%43 = phi i32 [ 2, %12 ], [ 1, %30 ], [ 2, %33 ], [ 2, %22 ], [ 0, %4 ], [ 0, %2 ]
%44 = icmp eq i32 %1, 0
br i1 %44, label %66, label %45
45: ; preds = %41
%46 = tail call i64 (...) @system_has_frequencyscaling()
%47 = icmp eq i64 %46, 0
br i1 %47, label %66, label %48
48: ; preds = %45
%49 = tail call i64 (...) @system_uses_frequencyscaling()
%50 = icmp eq i64 %49, 0
br i1 %50, label %66, label %51
51: ; preds = %48
%52 = load i32, i32* @stderr
%53 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.9, i64 0, i64 0))
%54 = load i32, i32* @stderr
%55 = tail call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0))
%56 = load i32, i32* @stderr
%57 = tail call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.11, i64 0, i64 0))
%58 = load i32, i32* @stderr
%59 = tail call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.12, i64 0, i64 0))
%60 = load i32, i32* @stderr
%61 = tail call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.13, i64 0, i64 0))
%62 = load i32, i32* @stderr
%63 = tail call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.14, i64 0, i64 0))
%64 = load i32, i32* @stderr
%65 = tail call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.15, i64 0, i64 0))
br label %66
66: ; preds = %51, %48, %45, %41
%67 = tail call i64 (...) @system_memlock_amount()
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %80
69: ; preds = %66
%70 = add nuw nsw i32 %43, 1
%71 = load i32, i32* @stderr
%72 = tail call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.16, i64 0, i64 0))
%73 = load i32, i32* @stderr
%74 = tail call i32 (...) @system_available_physical_mem()
%75 = mul nsw i32 %74, 3
%76 = sdiv i32 %75, 4096
%77 = tail call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.17, i64 0, i64 0), i32 %76)
%78 = load i32, i32* @stderr
%79 = tail call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0))
br label %81
80: ; preds = %66
br i1 %42, label %81, label %85
81: ; preds = %69, %80
%82 = phi i32 [ %70, %69 ], [ %43, %80 ]
%83 = load i32, i32* @stderr
%84 = tail call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.19, i64 0, i64 0))
br label %85
85: ; preds = %81, %80
%86 = phi i32 [ %82, %81 ], [ %43, %80 ]
%87 = icmp eq i32 %86, 0
br i1 %87, label %93, label %88
88: ; preds = %85
%89 = load i32, i32* @stderr
%90 = tail call i32 (i32, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.20, i64 0, i64 0))
%91 = load i32, i32* @stderr
%92 = tail call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.21, i64 0, i64 0))
br label %93
93: ; preds = %88, %85
ret i32 %86
}