#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 */
struct mq_attr {
  int mq_flags;
  int mq_maxmsg;
  int mq_msgsize;
  int mq_curmsgs;
};

/* Variables and functions */
int LONG_MAX;
int LONG_MIN;
int /*<<< orphan*/ printf(char *, ...);
int main() {
  struct mq_attr mqs;
  do {
    printf("%s..\n", "mqs.mq_flags");
    printf("\t.. -LONG_MIN\n");
    mqs.mq_flags = -LONG_MIN;
    if (mqs.mq_flags != -LONG_MIN) {
      return (1);
    }
    printf("\t.. LONG_MAX\n");
    mqs.mq_flags = LONG_MAX;
    if (mqs.mq_flags != LONG_MAX) {
      return (1);
    }
    printf("\t.. -(LONG_MIN+1)\n");
    mqs.mq_flags = -(LONG_MIN + 1);
    if (mqs.mq_flags != LONG_MAX) {
      return (1);
    }
    mqs.mq_flags = LONG_MAX + 1;
    printf("\t.. (LONG_MAX+1)\n");
    if (mqs.mq_flags != LONG_MIN) {
      return (1);
    }
  } while (0);
  do {
    printf("%s..\n", "mqs.mq_maxmsg");
    printf("\t.. -LONG_MIN\n");
    mqs.mq_maxmsg = -LONG_MIN;
    if (mqs.mq_maxmsg != -LONG_MIN) {
      return (1);
    }
    printf("\t.. LONG_MAX\n");
    mqs.mq_maxmsg = LONG_MAX;
    if (mqs.mq_maxmsg != LONG_MAX) {
      return (1);
    }
    printf("\t.. -(LONG_MIN+1)\n");
    mqs.mq_maxmsg = -(LONG_MIN + 1);
    if (mqs.mq_maxmsg != LONG_MAX) {
      return (1);
    }
    mqs.mq_maxmsg = LONG_MAX + 1;
    printf("\t.. (LONG_MAX+1)\n");
    if (mqs.mq_maxmsg != LONG_MIN) {
      return (1);
    }
  } while (0);
  do {
    printf("%s..\n", "mqs.mq_msgsize");
    printf("\t.. -LONG_MIN\n");
    mqs.mq_msgsize = -LONG_MIN;
    if (mqs.mq_msgsize != -LONG_MIN) {
      return (1);
    }
    printf("\t.. LONG_MAX\n");
    mqs.mq_msgsize = LONG_MAX;
    if (mqs.mq_msgsize != LONG_MAX) {
      return (1);
    }
    printf("\t.. -(LONG_MIN+1)\n");
    mqs.mq_msgsize = -(LONG_MIN + 1);
    if (mqs.mq_msgsize != LONG_MAX) {
      return (1);
    }
    mqs.mq_msgsize = LONG_MAX + 1;
    printf("\t.. (LONG_MAX+1)\n");
    if (mqs.mq_msgsize != LONG_MIN) {
      return (1);
    }
  } while (0);
  do {
    printf("%s..\n", "mqs.mq_curmsgs");
    printf("\t.. -LONG_MIN\n");
    mqs.mq_curmsgs = -LONG_MIN;
    if (mqs.mq_curmsgs != -LONG_MIN) {
      return (1);
    }
    printf("\t.. LONG_MAX\n");
    mqs.mq_curmsgs = LONG_MAX;
    if (mqs.mq_curmsgs != LONG_MAX) {
      return (1);
    }
    printf("\t.. -(LONG_MIN+1)\n");
    mqs.mq_curmsgs = -(LONG_MIN + 1);
    if (mqs.mq_curmsgs != LONG_MAX) {
      return (1);
    }
    mqs.mq_curmsgs = LONG_MAX + 1;
    printf("\t.. (LONG_MAX+1)\n");
    if (mqs.mq_curmsgs != LONG_MIN) {
      return (1);
    }
  } while (0);
  printf("PASSED!\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    0x2e9d(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    %ecx,%ecx
mov    0x2e8c(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
je     1172 <main+0x62>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    0x2e42(%rip),%rcx
cmp    (%rcx),%eax
je     11aa <main+0x9a>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    0x2e03(%rip),%rcx
cmp    (%rcx),%eax
je     11e9 <main+0xd9>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
mov    0x2de8(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
mov    0x2dd8(%rip),%rcx
cmp    (%rcx),%eax
je     1224 <main+0x114>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
jmp    1229 <main+0x119>
jmp    122e <main+0x11e>
lea    0xdcb(%rip),%rdi
lea    0xe19(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    0x2d8e(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    %ecx,%ecx
mov    0x2d7d(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
je     1281 <main+0x171>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
lea    0xd9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d42(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2d33(%rip),%rcx
cmp    (%rcx),%eax
je     12b9 <main+0x1a9>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
lea    0xd70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d1a(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2cf4(%rip),%rcx
cmp    (%rcx),%eax
je     12f8 <main+0x1e8>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
mov    0x2cd9(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xd35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    0x2cc9(%rip),%rcx
cmp    (%rcx),%eax
je     1333 <main+0x223>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
jmp    1338 <main+0x228>
jmp    133d <main+0x22d>
lea    0xcbc(%rip),%rdi
lea    0xd18(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    0x2c7f(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    %ecx,%ecx
mov    0x2c6e(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
je     1390 <main+0x280>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
lea    0xc8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2c33(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    0x2c24(%rip),%rcx
cmp    (%rcx),%eax
je     13c8 <main+0x2b8>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
lea    0xc61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2c0b(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    0x2be5(%rip),%rcx
cmp    (%rcx),%eax
je     1407 <main+0x2f7>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
mov    0x2bca(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
lea    0xc26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    0x2bba(%rip),%rcx
cmp    (%rcx),%eax
je     1442 <main+0x332>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
jmp    1447 <main+0x337>
jmp    144c <main+0x33c>
lea    0xbad(%rip),%rdi
lea    0xc18(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xbab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    0x2b70(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    %ecx,%ecx
mov    0x2b5f(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
je     149f <main+0x38f>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
lea    0xb7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2b24(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2b15(%rip),%rcx
cmp    (%rcx),%eax
je     14d7 <main+0x3c7>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
lea    0xb52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2afc(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ad6(%rip),%rcx
cmp    (%rcx),%eax
je     1516 <main+0x406>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
mov    0x2abb(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xb17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    0x2aab(%rip),%rcx
cmp    (%rcx),%eax
je     1551 <main+0x441>
movl   $0x1,-0x4(%rbp)
jmp    156b <main+0x45b>
jmp    1556 <main+0x446>
lea    0xb24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
lea    0xed1(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e81(%rip),%r14
mov    (%r14),%ebp
mov    %ebp,%eax
not    %eax
mov    0x2e63(%rip),%r15
mov    $0x1,%ebx
cmp    %eax,(%r15)
jne    12b0 <main+0x190>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
add    (%r14),%ebp
jne    12b0 <main+0x190>
lea    0xe61(%rip),%rdi
lea    0xe6d(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%ebp
mov    %ebp,%eax
not    %eax
cmp    %eax,(%r15)
jne    12b0 <main+0x190>
lea    0xe84(%rip),%rdi
call   1030 <puts@plt>
add    (%r14),%ebp
jne    12b0 <main+0x190>
lea    0xe03(%rip),%rdi
lea    0xe1d(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe2d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe2f(%rip),%rdi
call   1030 <puts@plt>
lea    0xe30(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%ebp
mov    %ebp,%eax
not    %eax
cmp    %eax,(%r15)
jne    12b0 <main+0x190>
lea    0xe2a(%rip),%rdi
call   1030 <puts@plt>
add    (%r14),%ebp
jne    12b0 <main+0x190>
lea    0xdad(%rip),%rdi
lea    0xdd6(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdd7(%rip),%rdi
call   1030 <puts@plt>
lea    0xdd9(%rip),%rdi
call   1030 <puts@plt>
lea    0xdda(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%ebp
mov    %ebp,%eax
not    %eax
cmp    %eax,(%r15)
jne    12b0 <main+0x190>
lea    0xdd4(%rip),%rdi
call   1030 <puts@plt>
add    (%r14),%ebp
jne    12b0 <main+0x190>
lea    0xdd4(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.mq_attr = type { i32, i32, i32, i32 }
@.str = [6 x i8] c"%s..\0A\00"
@.str.1 = [13 x i8] c"mqs.mq_flags\00"
@.str.2 = [15 x i8] c"\09.. -LONG_MIN\0A\00"
@LONG_MIN = global i32 0
@.str.3 = [14 x i8] c"\09.. LONG_MAX\0A\00"
@LONG_MAX = global i32 0
@.str.4 = [19 x i8] c"\09.. -(LONG_MIN+1)\0A\00"
@.str.5 = [18 x i8] c"\09.. (LONG_MAX+1)\0A\00"
@.str.6 = [14 x i8] c"mqs.mq_maxmsg\00"
@.str.7 = [15 x i8] c"mqs.mq_msgsize\00"
@.str.8 = [15 x i8] c"mqs.mq_curmsgs\00"
@.str.9 = [9 x i8] c"PASSED!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.mq_attr
store i32 0, i32* %1
br label %3
3: ; preds = %0
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* @LONG_MIN
%7 = sub nsw i32 0, %6
%8 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 0
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 0
%10 = load i32, i32* %9
%11 = load i32, i32* @LONG_MIN
%12 = sub nsw i32 0, %11
%13 = icmp ne i32 %10, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 1, i32* %1
br label %180
15: ; preds = %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%17 = load i32, i32* @LONG_MAX
%18 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 0
store i32 %17, i32* %18
%19 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 0
%20 = load i32, i32* %19
%21 = load i32, i32* @LONG_MAX
%22 = icmp ne i32 %20, %21
br i1 %22, label %23, label %24
23: ; preds = %15
store i32 1, i32* %1
br label %180
24: ; preds = %15
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%26 = load i32, i32* @LONG_MIN
%27 = add nsw i32 %26, 1
%28 = sub nsw i32 0, %27
%29 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 0
store i32 %28, i32* %29
%30 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 0
%31 = load i32, i32* %30
%32 = load i32, i32* @LONG_MAX
%33 = icmp ne i32 %31, %32
br i1 %33, label %34, label %35
34: ; preds = %24
store i32 1, i32* %1
br label %180
35: ; preds = %24
%36 = load i32, i32* @LONG_MAX
%37 = add nsw i32 %36, 1
%38 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 0
store i32 %37, i32* %38
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%40 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 0
%41 = load i32, i32* %40
%42 = load i32, i32* @LONG_MIN
%43 = icmp ne i32 %41, %42
br i1 %43, label %44, label %45
44: ; preds = %35
store i32 1, i32* %1
br label %180
45: ; preds = %35
br label %46
46: ; preds = %45
br label %47
47: ; preds = %46
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%50 = load i32, i32* @LONG_MIN
%51 = sub nsw i32 0, %50
%52 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 1
store i32 %51, i32* %52
%53 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 1
%54 = load i32, i32* %53
%55 = load i32, i32* @LONG_MIN
%56 = sub nsw i32 0, %55
%57 = icmp ne i32 %54, %56
br i1 %57, label %58, label %59
58: ; preds = %47
store i32 1, i32* %1
br label %180
59: ; preds = %47
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%61 = load i32, i32* @LONG_MAX
%62 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 1
store i32 %61, i32* %62
%63 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 1
%64 = load i32, i32* %63
%65 = load i32, i32* @LONG_MAX
%66 = icmp ne i32 %64, %65
br i1 %66, label %67, label %68
67: ; preds = %59
store i32 1, i32* %1
br label %180
68: ; preds = %59
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%70 = load i32, i32* @LONG_MIN
%71 = add nsw i32 %70, 1
%72 = sub nsw i32 0, %71
%73 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 1
store i32 %72, i32* %73
%74 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 1
%75 = load i32, i32* %74
%76 = load i32, i32* @LONG_MAX
%77 = icmp ne i32 %75, %76
br i1 %77, label %78, label %79
78: ; preds = %68
store i32 1, i32* %1
br label %180
79: ; preds = %68
%80 = load i32, i32* @LONG_MAX
%81 = add nsw i32 %80, 1
%82 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 1
store i32 %81, i32* %82
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%84 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 1
%85 = load i32, i32* %84
%86 = load i32, i32* @LONG_MIN
%87 = icmp ne i32 %85, %86
br i1 %87, label %88, label %89
88: ; preds = %79
store i32 1, i32* %1
br label %180
89: ; preds = %79
br label %90
90: ; preds = %89
br label %91
91: ; preds = %90
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%94 = load i32, i32* @LONG_MIN
%95 = sub nsw i32 0, %94
%96 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 2
store i32 %95, i32* %96
%97 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 2
%98 = load i32, i32* %97
%99 = load i32, i32* @LONG_MIN
%100 = sub nsw i32 0, %99
%101 = icmp ne i32 %98, %100
br i1 %101, label %102, label %103
102: ; preds = %91
store i32 1, i32* %1
br label %180
103: ; preds = %91
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%105 = load i32, i32* @LONG_MAX
%106 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 2
store i32 %105, i32* %106
%107 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 2
%108 = load i32, i32* %107
%109 = load i32, i32* @LONG_MAX
%110 = icmp ne i32 %108, %109
br i1 %110, label %111, label %112
111: ; preds = %103
store i32 1, i32* %1
br label %180
112: ; preds = %103
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%114 = load i32, i32* @LONG_MIN
%115 = add nsw i32 %114, 1
%116 = sub nsw i32 0, %115
%117 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 2
store i32 %116, i32* %117
%118 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 2
%119 = load i32, i32* %118
%120 = load i32, i32* @LONG_MAX
%121 = icmp ne i32 %119, %120
br i1 %121, label %122, label %123
122: ; preds = %112
store i32 1, i32* %1
br label %180
123: ; preds = %112
%124 = load i32, i32* @LONG_MAX
%125 = add nsw i32 %124, 1
%126 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 2
store i32 %125, i32* %126
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%128 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 2
%129 = load i32, i32* %128
%130 = load i32, i32* @LONG_MIN
%131 = icmp ne i32 %129, %130
br i1 %131, label %132, label %133
132: ; preds = %123
store i32 1, i32* %1
br label %180
133: ; preds = %123
br label %134
134: ; preds = %133
br label %135
135: ; preds = %134
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%138 = load i32, i32* @LONG_MIN
%139 = sub nsw i32 0, %138
%140 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 3
store i32 %139, i32* %140
%141 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 3
%142 = load i32, i32* %141
%143 = load i32, i32* @LONG_MIN
%144 = sub nsw i32 0, %143
%145 = icmp ne i32 %142, %144
br i1 %145, label %146, label %147
146: ; preds = %135
store i32 1, i32* %1
br label %180
147: ; preds = %135
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%149 = load i32, i32* @LONG_MAX
%150 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 3
store i32 %149, i32* %150
%151 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 3
%152 = load i32, i32* %151
%153 = load i32, i32* @LONG_MAX
%154 = icmp ne i32 %152, %153
br i1 %154, label %155, label %156
155: ; preds = %147
store i32 1, i32* %1
br label %180
156: ; preds = %147
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%158 = load i32, i32* @LONG_MIN
%159 = add nsw i32 %158, 1
%160 = sub nsw i32 0, %159
%161 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 3
store i32 %160, i32* %161
%162 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 3
%163 = load i32, i32* %162
%164 = load i32, i32* @LONG_MAX
%165 = icmp ne i32 %163, %164
br i1 %165, label %166, label %167
166: ; preds = %156
store i32 1, i32* %1
br label %180
167: ; preds = %156
%168 = load i32, i32* @LONG_MAX
%169 = add nsw i32 %168, 1
%170 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 3
store i32 %169, i32* %170
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%172 = getelementptr inbounds %struct.mq_attr, %struct.mq_attr* %2, i32 0, i32 3
%173 = load i32, i32* %172
%174 = load i32, i32* @LONG_MIN
%175 = icmp ne i32 %173, %174
br i1 %175, label %176, label %177
176: ; preds = %167
store i32 1, i32* %1
br label %180
177: ; preds = %167
br label %178
178: ; preds = %177
%179 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %1
br label %180
180: ; preds = %178, %176, %166, %155, %146, %132, %122, %111, %102, %88, %78, %67, %58, %44, %34, %23, %14
%181 = load i32, i32* %1
ret i32 %181
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s..\0A\00"
@.str.1 = [13 x i8] c"mqs.mq_flags\00"
@LONG_MIN = global i32 0
@LONG_MAX = global i32 0
@.str.6 = [14 x i8] c"mqs.mq_maxmsg\00"
@.str.7 = [15 x i8] c"mqs.mq_msgsize\00"
@.str.8 = [15 x i8] c"mqs.mq_curmsgs\00"
@str.21 = [14 x i8] c"\09.. -LONG_MIN\00"
@str.22 = [13 x i8] c"\09.. LONG_MAX\00"
@str.23 = [18 x i8] c"\09.. -(LONG_MIN+1)\00"
@str.24 = [17 x i8] c"\09.. (LONG_MAX+1)\00"
@str.25 = [8 x i8] c"PASSED!\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.21, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.22, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.23, i64 0, i64 0))
%5 = load i32, i32* @LONG_MIN
%6 = xor i32 %5, -1
%7 = load i32, i32* @LONG_MAX
%8 = icmp eq i32 %7, %6
br i1 %8, label %9, label %58
9: ; preds = %0
%10 = sub i32 0, %5
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.24, i64 0, i64 0))
%12 = load i32, i32* @LONG_MIN
%13 = icmp eq i32 %12, %10
br i1 %13, label %14, label %58
14: ; preds = %9
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.21, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.22, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.23, i64 0, i64 0))
%19 = load i32, i32* @LONG_MIN
%20 = xor i32 %19, -1
%21 = load i32, i32* @LONG_MAX
%22 = icmp eq i32 %21, %20
br i1 %22, label %23, label %58
23: ; preds = %14
%24 = sub i32 0, %19
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.24, i64 0, i64 0))
%26 = load i32, i32* @LONG_MIN
%27 = icmp eq i32 %26, %24
br i1 %27, label %28, label %58
28: ; preds = %23
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.21, i64 0, i64 0))
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.22, i64 0, i64 0))
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.23, i64 0, i64 0))
%33 = load i32, i32* @LONG_MIN
%34 = xor i32 %33, -1
%35 = load i32, i32* @LONG_MAX
%36 = icmp eq i32 %35, %34
br i1 %36, label %37, label %58
37: ; preds = %28
%38 = sub i32 0, %33
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.24, i64 0, i64 0))
%40 = load i32, i32* @LONG_MIN
%41 = icmp eq i32 %40, %38
br i1 %41, label %42, label %58
42: ; preds = %37
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%44 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.21, i64 0, i64 0))
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.22, i64 0, i64 0))
%46 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.23, i64 0, i64 0))
%47 = load i32, i32* @LONG_MIN
%48 = xor i32 %47, -1
%49 = load i32, i32* @LONG_MAX
%50 = icmp eq i32 %49, %48
br i1 %50, label %51, label %58
51: ; preds = %42
%52 = sub i32 0, %47
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.24, i64 0, i64 0))
%54 = load i32, i32* @LONG_MIN
%55 = icmp eq i32 %54, %52
br i1 %55, label %56, label %58
56: ; preds = %51
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.25, i64 0, i64 0))
br label %58
58: ; preds = %51, %42, %37, %28, %23, %14, %9, %0, %56
%59 = phi i32 [ 0, %56 ], [ 1, %0 ], [ 1, %9 ], [ 1, %14 ], [ 1, %23 ], [ 1, %28 ], [ 1, %37 ], [ 1, %42 ], [ 1, %51 ]
ret i32 %59
}