#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 EINVAL;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int remote_tst3(char *);
int remote_tst4(char *);
int /*<<< orphan*/ stderr;
int remote_tst(int tc, char *mnt) {
  int rc = 0;
  switch (tc) {
  case 3:
    rc = remote_tst3(mnt);
    break;
  case 4:
    rc = remote_tst4(mnt);
    break;
  default:
    fprintf(stderr, "wrong test case number %d\n", tc);
    rc = -EINVAL;
    break;
  }
  return rc;
}


x86 assembly (clang, -O0):
<remote_tst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x3,%eax
je     116b <remote_tst+0x3b>
jmp    115a <remote_tst+0x2a>
mov    -0x18(%rbp),%eax
sub    $0x4,%eax
je     117c <remote_tst+0x4c>
jmp    118d <remote_tst+0x5d>
mov    -0x10(%rbp),%rdi
call   1050 <remote_tst3@plt>
mov    %eax,-0x14(%rbp)
jmp    11b3 <remote_tst+0x83>
mov    -0x10(%rbp),%rdi
call   1040 <remote_tst4@plt>
mov    %eax,-0x14(%rbp)
jmp    11b3 <remote_tst+0x83>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe60(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
mov    0x2e2a(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remote_tst>:
cmp    $0x4,%edi
je     1144 <remote_tst+0x14>
mov    %edi,%edx
cmp    $0x3,%edi
jne    114c <remote_tst+0x1c>
mov    %rsi,%rdi
jmp    1050 <remote_tst3@plt>
mov    %rsi,%rdi
jmp    1040 <remote_tst4@plt>
push   %rax
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6f(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"wrong test case number %d\0A\00"
@EINVAL = global i32 0
define i32 @remote_tst(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = load i32, i32* %3
switch i32 %6, label %13 [
i32 3, label %7
i32 4, label %10
]
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @remote_tst3(i8* %8)
store i32 %9, i32* %5
br label %19
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @remote_tst4(i8* %11)
store i32 %12, i32* %5
br label %19
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i32, i32* %3
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @EINVAL
%18 = sub nsw i32 0, %17
store i32 %18, i32* %5
br label %19
19: ; preds = %13, %10, %7
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"wrong test case number %d\0A\00"
@EINVAL = global i32 0
define i32 @remote_tst(i32 %0, i8* %1) {
switch i32 %0, label %7 [
i32 3, label %3
i32 4, label %5
]
3: ; preds = %2
%4 = tail call i32 @remote_tst3(i8* %1)
br label %12
5: ; preds = %2
%6 = tail call i32 @remote_tst4(i8* %1)
br label %12
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
%10 = load i32, i32* @EINVAL
%11 = sub nsw i32 0, %10
br label %12
12: ; preds = %7, %5, %3
%13 = phi i32 [ %11, %7 ], [ %6, %5 ], [ %4, %3 ]
ret i32 %13
}