#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*/ change_case(int);
void cmd_case(const char *pf, char **args) {
  int mode = 't';
  while (*pf) {
    switch (*pf) {
    case 'l':
    case 'u':
      mode = *pf;
      break;
    }
    pf++;
  }
  change_case(mode);
}


x86 assembly (clang, -O0):
<cmd_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x74,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1178 <cmd_case+0x68>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
sub    $0x6c,%eax
je     115d <cmd_case+0x4d>
jmp    114c <cmd_case+0x3c>
mov    -0x18(%rbp),%eax
sub    $0x75,%eax
jne    1167 <cmd_case+0x57>
jmp    115d <cmd_case+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1127 <cmd_case+0x17>
mov    -0x14(%rbp),%edi
call   1030 <change_case@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_case>:
mov    (%rdi),%cl
test   %cl,%cl
je     1153 <cmd_case+0x43>
add    $0x1,%rdi
mov    $0x74,%eax
jmp    113d <cmd_case+0x2d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     114c <cmd_case+0x3c>
movsbl %cl,%ecx
cmp    $0x75,%ecx
je     1130 <cmd_case+0x20>
cmp    $0x6c,%ecx
je     1130 <cmd_case+0x20>
jmp    1132 <cmd_case+0x22>
mov    %eax,%edi
jmp    1030 <change_case@plt>
mov    $0x74,%edi
jmp    1030 <change_case@plt>

LLVM IR (-O0):
define void @cmd_case(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
store i8* %0, i8** %3
store i8** %1, i8*** %4
store i32 116, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
switch i32 %13, label %18 [
i32 108, label %14
i32 117, label %14
]
14: ; preds = %10, %10
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
store i32 %17, i32* %5
br label %18
18: ; preds = %10, %14
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %6
21: ; preds = %6
%22 = load i32, i32* %5
%23 = call i32 @change_case(i32 %22)
ret void
}

LLVM IR (-O2):
define void @cmd_case(i8* nocapture %0, i8** nocapture readnone %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i32 [ %12, %11 ], [ 116, %2 ]
%8 = phi i8* [ %13, %11 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
switch i32 %9, label %11 [
i32 108, label %10
i32 117, label %10
]
10: ; preds = %5, %5
br label %11
11: ; preds = %5, %10
%12 = phi i32 [ %7, %5 ], [ %9, %10 ]
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %11, %2
%17 = phi i32 [ 116, %2 ], [ %12, %11 ]
%18 = tail call i32 @change_case(i32 %17)
ret void
}