#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 domain {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ boundary_zerograd_rinn(struct domain *, int /*<<< orphan*/);
int /*<<< orphan*/ boundary_zerograd_rout(struct domain *, int /*<<< orphan*/);
int /*<<< orphan*/ boundary_zerograd_zbot(struct domain *, int /*<<< orphan*/);
int /*<<< orphan*/ boundary_zerograd_ztop(struct domain *, int /*<<< orphan*/);
void boundary_trans(struct domain *theDomain, int dim) {
  if (dim == 1) {
    boundary_zerograd_rinn(theDomain, 0);
    boundary_zerograd_rout(theDomain, 0);
  } else if (dim == 2) {
    boundary_zerograd_zbot(theDomain, 0);
    boundary_zerograd_ztop(theDomain, 0);
  }
}


x86 assembly (clang, -O0):
<boundary_trans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1174 <boundary_trans+0x34>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1050 <boundary_zerograd_rinn@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <boundary_zerograd_rout@plt>
jmp    1199 <boundary_trans+0x59>
cmpl   $0x2,-0xc(%rbp)
jne    1194 <boundary_trans+0x54>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <boundary_zerograd_zbot@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1060 <boundary_zerograd_ztop@plt>
jmp    1199 <boundary_trans+0x59>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<boundary_trans>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x2,%esi
je     1163 <boundary_trans+0x23>
cmp    $0x1,%esi
jne    1178 <boundary_trans+0x38>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <boundary_zerograd_rinn@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <boundary_zerograd_rout@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <boundary_zerograd_zbot@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1060 <boundary_zerograd_ztop@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.domain = type { i32 }
define void @boundary_trans(%struct.domain* %0, i32 %1) {
%3 = alloca %struct.domain*
%4 = alloca i32
store %struct.domain* %0, %struct.domain** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load %struct.domain*, %struct.domain** %3
%9 = call i32 @boundary_zerograd_rinn(%struct.domain* %8, i32 0)
%10 = load %struct.domain*, %struct.domain** %3
%11 = call i32 @boundary_zerograd_rout(%struct.domain* %10, i32 0)
br label %21
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load %struct.domain*, %struct.domain** %3
%17 = call i32 @boundary_zerograd_zbot(%struct.domain* %16, i32 0)
%18 = load %struct.domain*, %struct.domain** %3
%19 = call i32 @boundary_zerograd_ztop(%struct.domain* %18, i32 0)
br label %20
20: ; preds = %15, %12
br label %21
21: ; preds = %20, %7
ret void
}

LLVM IR (-O2):
%struct.domain = type { i32 }
define void @boundary_trans(%struct.domain* %0, i32 %1) {
switch i32 %1, label %9 [
i32 1, label %3
i32 2, label %6
]
3: ; preds = %2
%4 = tail call i32 @boundary_zerograd_rinn(%struct.domain* %0, i32 0)
%5 = tail call i32 @boundary_zerograd_rout(%struct.domain* %0, i32 0)
br label %9
6: ; preds = %2
%7 = tail call i32 @boundary_zerograd_zbot(%struct.domain* %0, i32 0)
%8 = tail call i32 @boundary_zerograd_ztop(%struct.domain* %0, i32 0)
br label %9
9: ; preds = %2, %6, %3
ret void
}