#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*/ _response(char const *);
scalar_t__ strcasecmp(char *, char *);
scalar_t__ strcmp(char *, char *);
int do_stru(char *arg) {
  const char fail[] = "501 'STRU' not understood.\r\n";
  const char succ[] = "200 Structure set to F.\r\n";
  const char unsupported[] = "504 Unsupported structure type.\r\n";
  const char unknown[] = "501 Unrecognized structure type.\r\n";
  if (strcmp(arg, "") == 0) {
    _response(fail);
    return -1;
  } else if (strcasecmp(arg, "F") == 0) {
    _response(succ);
  } else if (strcasecmp(arg, "P") == 0 || strcasecmp(arg, "R") == 0) {
    _response(unsupported);
  } else {
    _response(unknown);
  }
  return 0;
}


x86 assembly (clang, -O0):
<do_stru>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x10(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xe9d(%rip),%al
mov    %al,-0x14(%rbp)
mov    0xe97(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe94(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe91(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe8e(%rip),%ax
mov    %ax,-0x38(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xe87(%rip),%rsi
mov    $0x22,%edx
call   1060 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x23,%edx
call   1060 <memcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    120a <do_stru+0xca>
lea    -0x30(%rbp),%rdi
call   1040 <_response@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1291 <do_stru+0x151>
mov    -0x10(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1232 <do_stru+0xf2>
lea    -0x50(%rbp),%rdi
call   1040 <_response@plt>
jmp    1285 <do_stru+0x145>
mov    -0x10(%rbp),%rdi
lea    0xe58(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     1266 <do_stru+0x126>
mov    -0x10(%rbp),%rdi
lea    0xe40(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1274 <do_stru+0x134>
lea    -0x80(%rbp),%rdi
call   1040 <_response@plt>
jmp    1280 <do_stru+0x140>
lea    -0xb0(%rbp),%rdi
call   1040 <_response@plt>
jmp    1285 <do_stru+0x145>
jmp    128a <do_stru+0x14a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_stru>:
push   %rbp
push   %rbx
sub    $0xa8,%rsp
mov    %rdi,%rbx
movups 0xeca(%rip),%xmm0
movups %xmm0,0x8d(%rsp)
movaps 0xeae(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movups 0xec9(%rip),%xmm0
movups %xmm0,0x3a(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0xa,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movl   $0xa0d2e,0x6f(%rsp)
lea    0xedd(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     120b <do_stru+0xdb>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     121a <do_stru+0xea>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1221 <do_stru+0xf1>
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
mov    %rsp,%rax
lea    0x50(%rsp),%rdi
cmove  %rax,%rdi
jmp    1224 <do_stru+0xf4>
lea    0x80(%rsp),%rdi
mov    $0xffffffff,%ebp
jmp    1224 <do_stru+0xf4>
lea    0x30(%rsp),%rdi
jmp    1224 <do_stru+0xf4>
mov    %rsp,%rdi
call   1040 <_response@plt>
mov    %ebp,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.do_stru.fail = [29 x i8] c"501 'STRU' not understood.\0D\0A\00"
@__const.do_stru.succ = [26 x i8] c"200 Structure set to F.\0D\0A\00"
@__const.do_stru.unsupported = [34 x i8] c"504 Unsupported structure type.\0D\0A\00"
@__const.do_stru.unknown = [35 x i8] c"501 Unrecognized structure type.\0D\0A\00"
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"F\00"
@.str.2 = [2 x i8] c"P\00"
@.str.3 = [2 x i8] c"R\00"
define i32 @do_stru(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [29 x i8]
%5 = alloca [26 x i8]
%6 = alloca [34 x i8]
%7 = alloca [35 x i8]
store i8* %0, i8** %3
%8 = bitcast [29 x i8]* %4 to i8*
%9 = bitcast [26 x i8]* %5 to i8*
%10 = bitcast [34 x i8]* %6 to i8*
%11 = bitcast [35 x i8]* %7 to i8*
%12 = load i8*, i8** %3
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = getelementptr inbounds [29 x i8], [29 x i8]* %4, i64 0, i64 0
%17 = call i32 @_response(i8* %16)
store i32 -1, i32* %2
br label %42
18: ; preds = %1
%19 = load i8*, i8** %3
%20 = call i64 @strcasecmp(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = getelementptr inbounds [26 x i8], [26 x i8]* %5, i64 0, i64 0
%24 = call i32 @_response(i8* %23)
br label %40
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = call i64 @strcasecmp(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %25
%30 = load i8*, i8** %3
%31 = call i64 @strcasecmp(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %29, %25
%34 = getelementptr inbounds [34 x i8], [34 x i8]* %6, i64 0, i64 0
%35 = call i32 @_response(i8* %34)
br label %39
36: ; preds = %29
%37 = getelementptr inbounds [35 x i8], [35 x i8]* %7, i64 0, i64 0
%38 = call i32 @_response(i8* %37)
br label %39
39: ; preds = %36, %33
br label %40
40: ; preds = %39, %22
br label %41
41: ; preds = %40
store i32 0, i32* %2
br label %42
42: ; preds = %41, %15
%43 = load i32, i32* %2
ret i32 %43
}

LLVM IR (-O2):
@__const.do_stru.fail = [29 x i8] c"501 'STRU' not understood.\0D\0A\00"
@__const.do_stru.succ = [26 x i8] c"200 Structure set to F.\0D\0A\00"
@__const.do_stru.unsupported = [34 x i8] c"504 Unsupported structure type.\0D\0A\00"
@__const.do_stru.unknown = [35 x i8] c"501 Unrecognized structure type.\0D\0A\00"
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"F\00"
@.str.2 = [2 x i8] c"P\00"
@.str.3 = [2 x i8] c"R\00"
define i32 @do_stru(i8* %0) {
%2 = alloca [29 x i8]
%3 = alloca [26 x i8]
%4 = alloca [34 x i8]
%5 = alloca [35 x i8]
%6 = getelementptr inbounds [29 x i8], [29 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [34 x i8], [34 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [35 x i8], [35 x i8]* %5, i64 0, i64 0
%10 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %22, label %12
12: ; preds = %1
%13 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %22, label %15
15: ; preds = %12
%16 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %15
%19 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
%21 = select i1 %20, i8* %8, i8* %9
br label %22
22: ; preds = %18, %15, %12, %1
%23 = phi i8* [ %6, %1 ], [ %7, %12 ], [ %8, %15 ], [ %21, %18 ]
%24 = phi i32 [ -1, %1 ], [ 0, %12 ], [ 0, %15 ], [ 0, %18 ]
%25 = call i32 @_response(i8* %23)
ret i32 %24
}