#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_spb(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);
  n = ((hc + vc + cc) < 0);
  return n;
}


x86 assembly (clang, -O0):
<t1_3d_init_spb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    $0x0,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1_3d_init_spb>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,%r14d
mov    %edi,%ebx
and    $0x820,%ebx
xor    %eax,%eax
cmp    $0x20,%ebx
sete   %al
mov    %edi,%ebp
and    $0x2080,%ebp
xor    %edi,%edi
cmp    $0x80,%ebp
sete   %dil
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,0x4(%rsp)
xor    %eax,%eax
cmp    $0x820,%ebx
sete   %al
xor    %edi,%edi
cmp    $0x2080,%ebp
sete   %dil
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,%r15d
mov    %r14d,%r13d
and    $0x410,%r13d
xor    %eax,%eax
cmp    $0x10,%r13d
sete   %al
mov    %r14d,%ebx
and    $0x1040,%ebx
xor    %edi,%edi
cmp    $0x40,%ebx
sete   %dil
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,%ebp
xor    %eax,%eax
cmp    $0x410,%r13d
sete   %al
xor    %edi,%edi
cmp    $0x1040,%ebx
sete   %dil
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,%ebx
mov    %r14d,%r12d
and    $0x4100,%r12d
xor    %eax,%eax
cmp    $0x100,%r12d
sete   %al
and    $0x8200,%r14d
xor    %edi,%edi
cmp    $0x200,%r14d
sete   %dil
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
mov    %eax,%r13d
xor    %eax,%eax
cmp    $0x4100,%r12d
sete   %al
xor    %edi,%edi
cmp    $0x8200,%r14d
sete   %dil
add    %eax,%edi
mov    $0x1,%esi
call   1030 <int_min@plt>
add    0x4(%rsp),%ebp
add    %r15d,%ebx
add    %r13d,%ebp
add    %eax,%ebx
sub    %ebx,%ebp
shr    $0x1f,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @t1_3d_init_spb(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 = load i32, i32* %4
%72 = add nsw i32 %70, %71
%73 = load i32, i32* %5
%74 = add nsw i32 %72, %73
%75 = icmp slt i32 %74, 0
%76 = zext i1 %75 to i32
store i32 %76, i32* %6
%77 = load i32, i32* %6
ret i32 %77
}

LLVM IR (-O2):
define i32 @t1_3d_init_spb(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 = and i32 %0, 1040
%17 = icmp eq i32 %16, 16
%18 = zext i1 %17 to i32
%19 = and i32 %0, 4160
%20 = icmp eq i32 %19, 64
%21 = zext i1 %20 to i32
%22 = add nuw nsw i32 %18, %21
%23 = tail call i32 @int_min(i32 %22, i32 1)
%24 = icmp eq i32 %16, 1040
%25 = zext i1 %24 to i32
%26 = icmp eq i32 %19, 4160
%27 = zext i1 %26 to i32
%28 = add nuw nsw i32 %25, %27
%29 = tail call i32 @int_min(i32 %28, i32 1)
%30 = and i32 %0, 16640
%31 = icmp eq i32 %30, 256
%32 = zext i1 %31 to i32
%33 = and i32 %0, 33280
%34 = icmp eq i32 %33, 512
%35 = zext i1 %34 to i32
%36 = add nuw nsw i32 %32, %35
%37 = tail call i32 @int_min(i32 %36, i32 1)
%38 = icmp eq i32 %30, 16640
%39 = zext i1 %38 to i32
%40 = icmp eq i32 %33, 33280
%41 = zext i1 %40 to i32
%42 = add nuw nsw i32 %39, %41
%43 = tail call i32 @int_min(i32 %42, i32 1)
%44 = add i32 %9, %23
%45 = add i32 %15, %29
%46 = add i32 %44, %37
%47 = add i32 %45, %43
%48 = sub i32 %46, %47
%49 = lshr i32 %48, 31
ret i32 %49
}