#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 int_min(int, int);
int t1_3d_init_ctxno_sc(unsigned int f) {
  int hc, vc, cc;
  int n = 0;
  hc = int_min(((f & (0x00000020 | 0x0800)) == 0x00000020) +
                   ((f & (0x00000080 | 0x2000)) == 0x00000080),
               1) -
       int_min(((f & (0x00000020 | 0x0800)) == (0x00000020 | 0x0800)) +
                   ((f & (0x00000080 | 0x2000)) == (0x00000080 | 0x2000)),
               1);
  vc = int_min(((f & (0x00000010 | 0x0400)) == 0x00000010) +
                   ((f & (0x00000040 | 0x1000)) == 0x00000040),
               1) -
       int_min(((f & (0x00000010 | 0x0400)) == (0x00000010 | 0x0400)) +
                   ((f & (0x00000040 | 0x1000)) == (0x00000040 | 0x1000)),
               1);
  cc = int_min(((f & (0x00000100 | 0x4000)) == 0x00000100) +
                   ((f & (0x00000200 | 0x8000)) == 0x00000200),
               1) -
       int_min(((f & (0x00000100 | 0x4000)) == (0x00000100 | 0x4000)) +
                   ((f & (0x00000200 | 0x8000)) == (0x00000200 | 0x8000)),
               1);
  if (hc < 0) {
    hc = -hc;
    vc = -vc;
    cc = -cc;
  }
  if (!hc) {
    if (!vc) {
      n = (!cc) ? 0 : 1;
    } else if (vc == -1) {
      n = (!cc) ? 1 : ((cc > 0) ? 2 : 4);
    } else if (vc == 1) {
      n = (!cc) ? 1 : ((cc < 0) ? 2 : 4);
    }
  } else if (hc == 1) {
    if (!vc) {
      n = (!cc) ? 1 : ((cc < 0) ? 2 : 4);
    } else if (vc == 1) {
      n = (!cc) ? 4 : ((cc > 0) ? 5 : 3);
    } else if (vc == -1) {
      n = (!cc) ? 2 : 3;
    }
  } else if (hc == -1) {
    if (!vc) {
      n = (!cc) ? 1 : ((cc > 0) ? 2 : 4);
    } else if (vc == 1) {
      n = (!cc) ? 2 : 3;
    } else if (vc == -1) {
      n = (!cc) ? 4 : ((cc < 0) ? 5 : 3);
    }
  }
  return ((((0 + 1) + 16) + 3) + n);
}


x86 assembly (clang, -O0):
<t1_3d_init_ctxno_sc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x820,%eax
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x4(%rbp),%eax
and    $0x2080,%eax
cmp    $0x80,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
and    $0x820,%eax
cmp    $0x820,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x4(%rbp),%eax
and    $0x2080,%eax
cmp    $0x2080,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x410,%eax
cmp    $0x10,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x4(%rbp),%eax
and    $0x1040,%eax
cmp    $0x40,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
and    $0x410,%eax
cmp    $0x410,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x4(%rbp),%eax
and    $0x1040,%eax
cmp    $0x1040,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4100,%eax
cmp    $0x100,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x4(%rbp),%eax
and    $0x8200,%eax
cmp    $0x200,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4100,%eax
cmp    $0x4100,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x4(%rbp),%eax
and    $0x8200,%eax
cmp    $0x8200,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    12a9 <t1_3d_init_ctxno_sc+0x199>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    136a <t1_3d_init_ctxno_sc+0x25a>
cmpl   $0x0,-0xc(%rbp)
jne    12dc <t1_3d_init_ctxno_sc+0x1cc>
cmpl   $0x0,-0x10(%rbp)
setne  %dl
xor    $0xff,%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1365 <t1_3d_init_ctxno_sc+0x255>
cmpl   $0xffffffff,-0xc(%rbp)
jne    131e <t1_3d_init_ctxno_sc+0x20e>
cmpl   $0x0,-0x10(%rbp)
jne    12fd <t1_3d_init_ctxno_sc+0x1ed>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1313 <t1_3d_init_ctxno_sc+0x203>
mov    -0x10(%rbp),%edx
mov    $0x4,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1360 <t1_3d_init_ctxno_sc+0x250>
cmpl   $0x1,-0xc(%rbp)
jne    135b <t1_3d_init_ctxno_sc+0x24b>
cmpl   $0x0,-0x10(%rbp)
jne    133f <t1_3d_init_ctxno_sc+0x22f>
mov    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1355 <t1_3d_init_ctxno_sc+0x245>
mov    -0x10(%rbp),%edx
mov    $0x4,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1360 <t1_3d_init_ctxno_sc+0x250>
jmp    1365 <t1_3d_init_ctxno_sc+0x255>
jmp    14fc <t1_3d_init_ctxno_sc+0x3ec>
cmpl   $0x1,-0x8(%rbp)
jne    142e <t1_3d_init_ctxno_sc+0x31e>
cmpl   $0x0,-0xc(%rbp)
jne    13b6 <t1_3d_init_ctxno_sc+0x2a6>
cmpl   $0x0,-0x10(%rbp)
jne    1395 <t1_3d_init_ctxno_sc+0x285>
mov    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13ab <t1_3d_init_ctxno_sc+0x29b>
mov    -0x10(%rbp),%edx
mov    $0x4,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1429 <t1_3d_init_ctxno_sc+0x319>
cmpl   $0x1,-0xc(%rbp)
jne    13f8 <t1_3d_init_ctxno_sc+0x2e8>
cmpl   $0x0,-0x10(%rbp)
jne    13d7 <t1_3d_init_ctxno_sc+0x2c7>
mov    $0x4,%eax
mov    %eax,-0x30(%rbp)
jmp    13ed <t1_3d_init_ctxno_sc+0x2dd>
mov    -0x10(%rbp),%edx
mov    $0x3,%eax
mov    $0x5,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1424 <t1_3d_init_ctxno_sc+0x314>
cmpl   $0xffffffff,-0xc(%rbp)
jne    141f <t1_3d_init_ctxno_sc+0x30f>
cmpl   $0x0,-0x10(%rbp)
setne  %dl
xor    $0xff,%dl
mov    $0x3,%eax
mov    $0x2,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1424 <t1_3d_init_ctxno_sc+0x314>
jmp    1429 <t1_3d_init_ctxno_sc+0x319>
jmp    14f7 <t1_3d_init_ctxno_sc+0x3e7>
cmpl   $0xffffffff,-0x8(%rbp)
jne    14f2 <t1_3d_init_ctxno_sc+0x3e2>
cmpl   $0x0,-0xc(%rbp)
jne    147a <t1_3d_init_ctxno_sc+0x36a>
cmpl   $0x0,-0x10(%rbp)
jne    1459 <t1_3d_init_ctxno_sc+0x349>
mov    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    146f <t1_3d_init_ctxno_sc+0x35f>
mov    -0x10(%rbp),%edx
mov    $0x4,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    14ed <t1_3d_init_ctxno_sc+0x3dd>
cmpl   $0x1,-0xc(%rbp)
jne    14a6 <t1_3d_init_ctxno_sc+0x396>
cmpl   $0x0,-0x10(%rbp)
setne  %dl
xor    $0xff,%dl
mov    $0x3,%eax
mov    $0x2,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    14e8 <t1_3d_init_ctxno_sc+0x3d8>
cmpl   $0xffffffff,-0xc(%rbp)
jne    14e3 <t1_3d_init_ctxno_sc+0x3d3>
cmpl   $0x0,-0x10(%rbp)
jne    14c7 <t1_3d_init_ctxno_sc+0x3b7>
mov    $0x4,%eax
mov    %eax,-0x38(%rbp)
jmp    14dd <t1_3d_init_ctxno_sc+0x3cd>
mov    -0x10(%rbp),%edx
mov    $0x3,%eax
mov    $0x5,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    14e8 <t1_3d_init_ctxno_sc+0x3d8>
jmp    14ed <t1_3d_init_ctxno_sc+0x3dd>
jmp    14f2 <t1_3d_init_ctxno_sc+0x3e2>
jmp    14f7 <t1_3d_init_ctxno_sc+0x3e7>
jmp    14fc <t1_3d_init_ctxno_sc+0x3ec>
mov    -0x14(%rbp),%eax
add    $0x14,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1_3d_init_ctxno_sc>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%r12d
mov    %edi,%ebp
and    $0x820,%ebp
xor    %eax,%eax
cmp    $0x20,%ebp
sete   %al
mov    %edi,%ebx
and    $0x2080,%ebx
xor    %edi,%edi
cmp    $0x80,%ebx
sete   %dil
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,%r14d
xor    %eax,%eax
cmp    $0x820,%ebp
sete   %al
xor    %edi,%edi
cmp    $0x2080,%ebx
sete   %dil
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
sub    %eax,%r14d
mov    %r12d,%ebx
and    $0x410,%ebx
xor    %eax,%eax
cmp    $0x10,%ebx
sete   %al
mov    %r12d,%ebp
and    $0x1040,%ebp
xor    %edi,%edi
cmp    $0x40,%ebp
sete   %dil
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,%r15d
xor    %eax,%eax
cmp    $0x410,%ebx
sete   %al
xor    %edi,%edi
cmp    $0x1040,%ebp
sete   %dil
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
sub    %eax,%r15d
mov    %r12d,%ebx
and    $0x4100,%ebx
xor    %eax,%eax
cmp    $0x100,%ebx
sete   %al
and    $0x8200,%r12d
xor    %edi,%edi
cmp    $0x200,%r12d
sete   %dil
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,%ebp
xor    %eax,%eax
cmp    $0x4100,%ebx
sete   %al
xor    %edi,%edi
cmp    $0x8200,%r12d
sete   %dil
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
sub    %eax,%ebp
mov    %r15d,%edx
neg    %edx
mov    %ebp,%ecx
neg    %ecx
mov    %r14d,%esi
neg    %esi
cmovs  %r14d,%esi
test   %r14d,%r14d
cmovns %r15d,%edx
cmovns %ebp,%ecx
xor    %eax,%eax
cmp    $0x1,%esi
je     1266 <t1_3d_init_ctxno_sc+0x156>
test   %esi,%esi
jne    12b1 <t1_3d_init_ctxno_sc+0x1a1>
cmp    $0xffffffff,%edx
je     127f <t1_3d_init_ctxno_sc+0x16f>
cmp    $0x1,%edx
je     1274 <t1_3d_init_ctxno_sc+0x164>
test   %edx,%edx
jne    12b1 <t1_3d_init_ctxno_sc+0x1a1>
xor    %eax,%eax
test   %ebp,%ebp
setne  %al
jmp    12b1 <t1_3d_init_ctxno_sc+0x1a1>
cmp    $0xffffffff,%edx
je     1291 <t1_3d_init_ctxno_sc+0x181>
cmp    $0x1,%edx
je     129e <t1_3d_init_ctxno_sc+0x18e>
test   %edx,%edx
jne    12b1 <t1_3d_init_ctxno_sc+0x1a1>
mov    %ecx,%eax
not    %eax
shr    $0x1f,%eax
test   %ecx,%ecx
jmp    1286 <t1_3d_init_ctxno_sc+0x176>
xor    %eax,%eax
test   %ecx,%ecx
setle  %al
lea    0x2(%rax,%rax,1),%ecx
mov    $0x1,%eax
jmp    12ae <t1_3d_init_ctxno_sc+0x19e>
cmp    $0x1,%ecx
mov    $0x3,%eax
sbb    $0x0,%eax
jmp    12b1 <t1_3d_init_ctxno_sc+0x1a1>
xor    %eax,%eax
test   %ecx,%ecx
setg   %al
lea    0x3(%rax,%rax,1),%ecx
mov    $0x4,%eax
cmovne %ecx,%eax
add    $0x14,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @t1_3d_init_ctxno_sc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %6
%7 = load i32, i32* %2
%8 = and i32 %7, 2080
%9 = icmp eq i32 %8, 32
%10 = zext i1 %9 to i32
%11 = load i32, i32* %2
%12 = and i32 %11, 8320
%13 = icmp eq i32 %12, 128
%14 = zext i1 %13 to i32
%15 = add nsw i32 %10, %14
%16 = call i32 @int_min(i32 %15, i32 1)
%17 = load i32, i32* %2
%18 = and i32 %17, 2080
%19 = icmp eq i32 %18, 2080
%20 = zext i1 %19 to i32
%21 = load i32, i32* %2
%22 = and i32 %21, 8320
%23 = icmp eq i32 %22, 8320
%24 = zext i1 %23 to i32
%25 = add nsw i32 %20, %24
%26 = call i32 @int_min(i32 %25, i32 1)
%27 = sub nsw i32 %16, %26
store i32 %27, i32* %3
%28 = load i32, i32* %2
%29 = and i32 %28, 1040
%30 = icmp eq i32 %29, 16
%31 = zext i1 %30 to i32
%32 = load i32, i32* %2
%33 = and i32 %32, 4160
%34 = icmp eq i32 %33, 64
%35 = zext i1 %34 to i32
%36 = add nsw i32 %31, %35
%37 = call i32 @int_min(i32 %36, i32 1)
%38 = load i32, i32* %2
%39 = and i32 %38, 1040
%40 = icmp eq i32 %39, 1040
%41 = zext i1 %40 to i32
%42 = load i32, i32* %2
%43 = and i32 %42, 4160
%44 = icmp eq i32 %43, 4160
%45 = zext i1 %44 to i32
%46 = add nsw i32 %41, %45
%47 = call i32 @int_min(i32 %46, i32 1)
%48 = sub nsw i32 %37, %47
store i32 %48, i32* %4
%49 = load i32, i32* %2
%50 = and i32 %49, 16640
%51 = icmp eq i32 %50, 256
%52 = zext i1 %51 to i32
%53 = load i32, i32* %2
%54 = and i32 %53, 33280
%55 = icmp eq i32 %54, 512
%56 = zext i1 %55 to i32
%57 = add nsw i32 %52, %56
%58 = call i32 @int_min(i32 %57, i32 1)
%59 = load i32, i32* %2
%60 = and i32 %59, 16640
%61 = icmp eq i32 %60, 16640
%62 = zext i1 %61 to i32
%63 = load i32, i32* %2
%64 = and i32 %63, 33280
%65 = icmp eq i32 %64, 33280
%66 = zext i1 %65 to i32
%67 = add nsw i32 %62, %66
%68 = call i32 @int_min(i32 %67, i32 1)
%69 = sub nsw i32 %58, %68
store i32 %69, i32* %5
%70 = load i32, i32* %3
%71 = icmp slt i32 %70, 0
br i1 %71, label %72, label %79
72: ; preds = %1
%73 = load i32, i32* %3
%74 = sub nsw i32 0, %73
store i32 %74, i32* %3
%75 = load i32, i32* %4
%76 = sub nsw i32 0, %75
store i32 %76, i32* %4
%77 = load i32, i32* %5
%78 = sub nsw i32 0, %77
store i32 %78, i32* %5
br label %79
79: ; preds = %72, %1
%80 = load i32, i32* %3
%81 = icmp ne i32 %80, 0
br i1 %81, label %122, label %82
82: ; preds = %79
%83 = load i32, i32* %4
%84 = icmp ne i32 %83, 0
br i1 %84, label %91, label %85
85: ; preds = %82
%86 = load i32, i32* %5
%87 = icmp ne i32 %86, 0
%88 = xor i1 %87, true
%89 = zext i1 %88 to i64
%90 = select i1 %88, i32 0, i32 1
store i32 %90, i32* %6
br label %121
91: ; preds = %82
%92 = load i32, i32* %4
%93 = icmp eq i32 %92, -1
br i1 %93, label %94, label %105
94: ; preds = %91
%95 = load i32, i32* %5
%96 = icmp ne i32 %95, 0
br i1 %96, label %98, label %97
97: ; preds = %94
br label %103
98: ; preds = %94
%99 = load i32, i32* %5
%100 = icmp sgt i32 %99, 0
%101 = zext i1 %100 to i64
%102 = select i1 %100, i32 2, i32 4
br label %103
103: ; preds = %98, %97
%104 = phi i32 [ 1, %97 ], [ %102, %98 ]
store i32 %104, i32* %6
br label %120
105: ; preds = %91
%106 = load i32, i32* %4
%107 = icmp eq i32 %106, 1
br i1 %107, label %108, label %119
108: ; preds = %105
%109 = load i32, i32* %5
%110 = icmp ne i32 %109, 0
br i1 %110, label %112, label %111
111: ; preds = %108
br label %117
112: ; preds = %108
%113 = load i32, i32* %5
%114 = icmp slt i32 %113, 0
%115 = zext i1 %114 to i64
%116 = select i1 %114, i32 2, i32 4
br label %117
117: ; preds = %112, %111
%118 = phi i32 [ 1, %111 ], [ %116, %112 ]
store i32 %118, i32* %6
br label %119
119: ; preds = %117, %105
br label %120
120: ; preds = %119, %103
br label %121
121: ; preds = %120, %85
br label %210
122: ; preds = %79
%123 = load i32, i32* %3
%124 = icmp eq i32 %123, 1
br i1 %124, label %125, label %165
125: ; preds = %122
%126 = load i32, i32* %4
%127 = icmp ne i32 %126, 0
br i1 %127, label %139, label %128
128: ; preds = %125
%129 = load i32, i32* %5
%130 = icmp ne i32 %129, 0
br i1 %130, label %132, label %131
131: ; preds = %128
br label %137
132: ; preds = %128
%133 = load i32, i32* %5
%134 = icmp slt i32 %133, 0
%135 = zext i1 %134 to i64
%136 = select i1 %134, i32 2, i32 4
br label %137
137: ; preds = %132, %131
%138 = phi i32 [ 1, %131 ], [ %136, %132 ]
store i32 %138, i32* %6
br label %164
139: ; preds = %125
%140 = load i32, i32* %4
%141 = icmp eq i32 %140, 1
br i1 %141, label %142, label %153
142: ; preds = %139
%143 = load i32, i32* %5
%144 = icmp ne i32 %143, 0
br i1 %144, label %146, label %145
145: ; preds = %142
br label %151
146: ; preds = %142
%147 = load i32, i32* %5
%148 = icmp sgt i32 %147, 0
%149 = zext i1 %148 to i64
%150 = select i1 %148, i32 5, i32 3
br label %151
151: ; preds = %146, %145
%152 = phi i32 [ 4, %145 ], [ %150, %146 ]
store i32 %152, i32* %6
br label %163
153: ; preds = %139
%154 = load i32, i32* %4
%155 = icmp eq i32 %154, -1
br i1 %155, label %156, label %162
156: ; preds = %153
%157 = load i32, i32* %5
%158 = icmp ne i32 %157, 0
%159 = xor i1 %158, true
%160 = zext i1 %159 to i64
%161 = select i1 %159, i32 2, i32 3
store i32 %161, i32* %6
br label %162
162: ; preds = %156, %153
br label %163
163: ; preds = %162, %151
br label %164
164: ; preds = %163, %137
br label %209
165: ; preds = %122
%166 = load i32, i32* %3
%167 = icmp eq i32 %166, -1
br i1 %167, label %168, label %208
168: ; preds = %165
%169 = load i32, i32* %4
%170 = icmp ne i32 %169, 0
br i1 %170, label %182, label %171
171: ; preds = %168
%172 = load i32, i32* %5
%173 = icmp ne i32 %172, 0
br i1 %173, label %175, label %174
174: ; preds = %171
br label %180
175: ; preds = %171
%176 = load i32, i32* %5
%177 = icmp sgt i32 %176, 0
%178 = zext i1 %177 to i64
%179 = select i1 %177, i32 2, i32 4
br label %180
180: ; preds = %175, %174
%181 = phi i32 [ 1, %174 ], [ %179, %175 ]
store i32 %181, i32* %6
br label %207
182: ; preds = %168
%183 = load i32, i32* %4
%184 = icmp eq i32 %183, 1
br i1 %184, label %185, label %191
185: ; preds = %182
%186 = load i32, i32* %5
%187 = icmp ne i32 %186, 0
%188 = xor i1 %187, true
%189 = zext i1 %188 to i64
%190 = select i1 %188, i32 2, i32 3
store i32 %190, i32* %6
br label %206
191: ; preds = %182
%192 = load i32, i32* %4
%193 = icmp eq i32 %192, -1
br i1 %193, label %194, label %205
194: ; preds = %191
%195 = load i32, i32* %5
%196 = icmp ne i32 %195, 0
br i1 %196, label %198, label %197
197: ; preds = %194
br label %203
198: ; preds = %194
%199 = load i32, i32* %5
%200 = icmp slt i32 %199, 0
%201 = zext i1 %200 to i64
%202 = select i1 %200, i32 5, i32 3
br label %203
203: ; preds = %198, %197
%204 = phi i32 [ 4, %197 ], [ %202, %198 ]
store i32 %204, i32* %6
br label %205
205: ; preds = %203, %191
br label %206
206: ; preds = %205, %185
br label %207
207: ; preds = %206, %180
br label %208
208: ; preds = %207, %165
br label %209
209: ; preds = %208, %164
br label %210
210: ; preds = %209, %121
%211 = load i32, i32* %6
%212 = add nsw i32 20, %211
ret i32 %212
}

LLVM IR (-O2):
define i32 @t1_3d_init_ctxno_sc(i32 %0) {
%2 = and i32 %0, 2080
%3 = icmp eq i32 %2, 32
%4 = zext i1 %3 to i32
%5 = and i32 %0, 8320
%6 = icmp eq i32 %5, 128
%7 = zext i1 %6 to i32
%8 = add nuw nsw i32 %4, %7
%9 = tail call i32 @int_min(i32 %8, i32 1)
%10 = icmp eq i32 %2, 2080
%11 = zext i1 %10 to i32
%12 = icmp eq i32 %5, 8320
%13 = zext i1 %12 to i32
%14 = add nuw nsw i32 %11, %13
%15 = tail call i32 @int_min(i32 %14, i32 1)
%16 = sub nsw i32 %9, %15
%17 = and i32 %0, 1040
%18 = icmp eq i32 %17, 16
%19 = zext i1 %18 to i32
%20 = and i32 %0, 4160
%21 = icmp eq i32 %20, 64
%22 = zext i1 %21 to i32
%23 = add nuw nsw i32 %19, %22
%24 = tail call i32 @int_min(i32 %23, i32 1)
%25 = icmp eq i32 %17, 1040
%26 = zext i1 %25 to i32
%27 = icmp eq i32 %20, 4160
%28 = zext i1 %27 to i32
%29 = add nuw nsw i32 %26, %28
%30 = tail call i32 @int_min(i32 %29, i32 1)
%31 = sub nsw i32 %24, %30
%32 = and i32 %0, 16640
%33 = icmp eq i32 %32, 256
%34 = zext i1 %33 to i32
%35 = and i32 %0, 33280
%36 = icmp eq i32 %35, 512
%37 = zext i1 %36 to i32
%38 = add nuw nsw i32 %34, %37
%39 = tail call i32 @int_min(i32 %38, i32 1)
%40 = icmp eq i32 %32, 16640
%41 = zext i1 %40 to i32
%42 = icmp eq i32 %35, 33280
%43 = zext i1 %42 to i32
%44 = add nuw nsw i32 %41, %43
%45 = tail call i32 @int_min(i32 %44, i32 1)
%46 = sub nsw i32 %39, %45
%47 = icmp slt i32 %16, 0
%48 = sub nsw i32 0, %16
%49 = sub nsw i32 0, %31
%50 = sub nsw i32 0, %46
%51 = select i1 %47, i32 %48, i32 %16
%52 = select i1 %47, i32 %49, i32 %31
%53 = select i1 %47, i32 %50, i32 %46
switch i32 %51, label %82 [
i32 0, label %54
i32 1, label %68
]
54: ; preds = %1
switch i32 %52, label %82 [
i32 0, label %55
i32 -1, label %58
i32 1, label %63
]
55: ; preds = %54
%56 = icmp ne i32 %46, 0
%57 = zext i1 %56 to i32
br label %82
58: ; preds = %54
%59 = icmp eq i32 %53, 0
%60 = icmp sgt i32 %53, 0
%61 = select i1 %60, i32 2, i32 4
%62 = select i1 %59, i32 1, i32 %61
br label %82
63: ; preds = %54
%64 = icmp eq i32 %53, 0
%65 = icmp slt i32 %53, 0
%66 = select i1 %65, i32 2, i32 4
%67 = select i1 %64, i32 1, i32 %66
br label %82
68: ; preds = %1
switch i32 %52, label %82 [
i32 0, label %69
i32 1, label %74
i32 -1, label %79
]
69: ; preds = %68
%70 = icmp eq i32 %53, 0
%71 = icmp slt i32 %53, 0
%72 = select i1 %71, i32 2, i32 4
%73 = select i1 %70, i32 1, i32 %72
br label %82
74: ; preds = %68
%75 = icmp eq i32 %53, 0
%76 = icmp sgt i32 %53, 0
%77 = select i1 %76, i32 5, i32 3
%78 = select i1 %75, i32 4, i32 %77
br label %82
79: ; preds = %68
%80 = icmp eq i32 %53, 0
%81 = select i1 %80, i32 2, i32 3
br label %82
82: ; preds = %1, %68, %54, %74, %79, %69, %55, %63, %58
%83 = phi i32 [ %78, %74 ], [ %81, %79 ], [ %73, %69 ], [ %62, %58 ], [ %67, %63 ], [ %57, %55 ], [ 0, %54 ], [ 0, %68 ], [ 0, %1 ]
%84 = add nuw nsw i32 %83, 20
ret i32 %84
}