#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);
int /*<<< orphan*/ boundary_zerograd_rout(struct domain *, int);
int /*<<< orphan*/ boundary_zerograd_zbot(struct domain *, int);
int /*<<< orphan*/ boundary_zerograd_ztop(struct domain *, int);
void boundary_trans(struct domain *theDomain, int dim) {
  if (dim == 1) {
    boundary_zerograd_rinn(theDomain, 1);
    boundary_zerograd_rout(theDomain, 1);
  } else if (dim == 2) {
    boundary_zerograd_zbot(theDomain, 1);
    boundary_zerograd_ztop(theDomain, 1);
  }
}


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    117a <boundary_trans+0x3a>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1050 <boundary_zerograd_rinn@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <boundary_zerograd_rout@plt>
jmp    11a5 <boundary_trans+0x65>
cmpl   $0x2,-0xc(%rbp)
jne    11a0 <boundary_trans+0x60>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <boundary_zerograd_zbot@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1060 <boundary_zerograd_ztop@plt>
jmp    11a5 <boundary_trans+0x65>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<boundary_trans>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x2,%esi
je     1169 <boundary_trans+0x29>
cmp    $0x1,%esi
jne    1184 <boundary_trans+0x44>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <boundary_zerograd_rinn@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <boundary_zerograd_rout@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <boundary_zerograd_zbot@plt>
mov    %rbx,%rdi
mov    $0x1,%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 1)
%10 = load %struct.domain*, %struct.domain** %3
%11 = call i32 @boundary_zerograd_rout(%struct.domain* %10, i32 1)
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 1)
%18 = load %struct.domain*, %struct.domain** %3
%19 = call i32 @boundary_zerograd_ztop(%struct.domain* %18, i32 1)
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 1)
%5 = tail call i32 @boundary_zerograd_rout(%struct.domain* %0, i32 1)
br label %9
6: ; preds = %2
%7 = tail call i32 @boundary_zerograd_zbot(%struct.domain* %0, i32 1)
%8 = tail call i32 @boundary_zerograd_ztop(%struct.domain* %0, i32 1)
br label %9
9: ; preds = %2, %6, %3
ret void
}