#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*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int particle_structure(int numZ, int numN) {
  if ((numZ != 0) && (numN == 0))
    return 0;
  if ((numZ == 0) && (numN != 0))
    return 1;
  if ((numZ == 1) && (numN == 1))
    return 2;
  if ((numZ == 1) && (numN > 1))
    return 3;
  if ((numZ > 1) && (numN == 1))
    return 4;
  if ((numZ > 1) && (numN > 1))
    return 5;
  printf("\n\nError in function particle_structure():");
  printf("\nWrong proton - neutron numbers: ");
  printf(" proton number = %d  neutron number = %d \n", numZ, numN);
  exit(1);
}


x86 assembly (clang, -O0):
<particle_structure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114e <particle_structure+0x2e>
cmpl   $0x0,-0xc(%rbp)
jne    114e <particle_structure+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1228 <particle_structure+0x108>
cmpl   $0x0,-0x8(%rbp)
jne    116e <particle_structure+0x4e>
cmpl   $0x0,-0xc(%rbp)
je     116e <particle_structure+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1228 <particle_structure+0x108>
cmpl   $0x1,-0x8(%rbp)
jne    118e <particle_structure+0x6e>
cmpl   $0x1,-0xc(%rbp)
jne    118e <particle_structure+0x6e>
movl   $0x2,-0x4(%rbp)
jmp    1228 <particle_structure+0x108>
cmpl   $0x1,-0x8(%rbp)
jne    11ae <particle_structure+0x8e>
cmpl   $0x1,-0xc(%rbp)
jle    11ae <particle_structure+0x8e>
movl   $0x3,-0x4(%rbp)
jmp    1228 <particle_structure+0x108>
cmpl   $0x1,-0x8(%rbp)
jle    11ce <particle_structure+0xae>
cmpl   $0x1,-0xc(%rbp)
jne    11ce <particle_structure+0xae>
movl   $0x4,-0x4(%rbp)
jmp    1228 <particle_structure+0x108>
cmpl   $0x1,-0x8(%rbp)
jle    11ee <particle_structure+0xce>
cmpl   $0x1,-0xc(%rbp)
jle    11ee <particle_structure+0xce>
movl   $0x5,-0x4(%rbp)
jmp    1228 <particle_structure+0x108>
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<particle_structure>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   %edi,%edi
je     1131 <particle_structure+0x11>
xor    %eax,%eax
test   %ebx,%ebx
je     117a <particle_structure+0x5a>
test   %ebp,%ebp
jne    113e <particle_structure+0x1e>
mov    $0x1,%eax
test   %ebx,%ebx
jne    117a <particle_structure+0x5a>
cmp    $0x1,%ebp
jne    114d <particle_structure+0x2d>
mov    $0x2,%eax
cmp    $0x1,%ebx
je     117a <particle_structure+0x5a>
cmp    $0x1,%ebp
jne    115c <particle_structure+0x3c>
mov    $0x3,%eax
cmp    $0x1,%ebx
jg     117a <particle_structure+0x5a>
cmp    $0x2,%ebp
jl     116b <particle_structure+0x4b>
mov    $0x4,%eax
cmp    $0x1,%ebx
je     117a <particle_structure+0x5a>
cmp    $0x2,%ebp
jl     1181 <particle_structure+0x61>
mov    $0x5,%eax
cmp    $0x1,%ebx
jle    1181 <particle_structure+0x61>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe78(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe94(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"\0A\0AError in function particle_structure():\00"
@.str.1 = [34 x i8] c"\0AWrong proton - neutron numbers: \00"
@.str.2 = [43 x i8] c" proton number = %d neutron number = %d \0A\00"
define i32 @particle_structure(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 0, i32* %3
br label %54
12: ; preds = %8, %2
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %5
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 1, i32* %3
br label %54
19: ; preds = %15, %12
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load i32, i32* %5
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 2, i32* %3
br label %54
26: ; preds = %22, %19
%27 = load i32, i32* %4
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = load i32, i32* %5
%31 = icmp sgt i32 %30, 1
br i1 %31, label %32, label %33
32: ; preds = %29
store i32 3, i32* %3
br label %54
33: ; preds = %29, %26
%34 = load i32, i32* %4
%35 = icmp sgt i32 %34, 1
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = load i32, i32* %5
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %40
39: ; preds = %36
store i32 4, i32* %3
br label %54
40: ; preds = %36, %33
%41 = load i32, i32* %4
%42 = icmp sgt i32 %41, 1
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = load i32, i32* %5
%45 = icmp sgt i32 %44, 1
br i1 %45, label %46, label %47
46: ; preds = %43
store i32 5, i32* %3
br label %54
47: ; preds = %43, %40
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%50 = load i32, i32* %4
%51 = load i32, i32* %5
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %50, i32 %51)
%53 = call i32 @exit(i32 1)
unreachable
54: ; preds = %46, %39, %32, %25, %18, %11
%55 = load i32, i32* %3
ret i32 %55
}

LLVM IR (-O2):
@.str = [42 x i8] c"\0A\0AError in function particle_structure():\00"
@.str.1 = [34 x i8] c"\0AWrong proton - neutron numbers: \00"
@.str.2 = [43 x i8] c" proton number = %d neutron number = %d \0A\00"
define i32 @particle_structure(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %27, label %6
6: ; preds = %2
%7 = icmp eq i32 %0, 0
%8 = icmp ne i32 %1, 0
%9 = and i1 %7, %8
br i1 %9, label %27, label %10
10: ; preds = %6
%11 = icmp eq i32 %0, 1
%12 = icmp eq i32 %1, 1
%13 = and i1 %11, %12
br i1 %13, label %27, label %14
14: ; preds = %10
%15 = icmp sgt i32 %1, 1
%16 = and i1 %11, %15
br i1 %16, label %27, label %17
17: ; preds = %14
%18 = icmp sgt i32 %0, 1
%19 = and i1 %18, %12
br i1 %19, label %27, label %20
20: ; preds = %17
%21 = and i1 %18, %15
br i1 %21, label %27, label %22
22: ; preds = %20
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %0, i32 %1)
%26 = tail call i32 @exit(i32 1)
unreachable
27: ; preds = %20, %17, %14, %10, %6, %2
%28 = phi i32 [ 0, %2 ], [ 1, %6 ], [ 2, %10 ], [ 3, %14 ], [ 4, %17 ], [ 5, %20 ]
ret i32 %28
}