#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*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ system(char *);
void wash(char *inmon, char *can) {
  char cmd[256];
  if (can == NULL)
    sprintf(cmd, "xterm 2> /dev/null -T Wash -e \"wash -i %s -C ; exit\" &",
            inmon);
  else
    sprintf(cmd,
            "xterm 2> /dev/null -T Wash -e \"wash -i %s -c %s -C ; exit\" &",
            inmon, can);
  system(cmd);
}


x86 assembly (clang, -O0):
<wash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <wash+0x3c>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    1179 <wash+0x59>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wash>:
sub    $0x108,%rsp
mov    %rdi,%rdx
test   %rsi,%rsi
je     1145 <wash+0x25>
mov    %rsi,%rcx
lea    0xefe(%rip),%rsi
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
jmp    1156 <wash+0x36>
lea    0xeb4(%rip),%rsi
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rsp,%rdi
call   1030 <system@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [55 x i8] c"xterm 2> /dev/null -T Wash -e \22wash -i %s -C ; exit\22 &\00"
@.str.1 = [61 x i8] c"xterm 2> /dev/null -T Wash -e \22wash -i %s -c %s -C ; exit\22 &\00"
define void @wash(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [256 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %3
%11 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %9, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %17
12: ; preds = %2
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %13, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i8* %14, i8* %15)
br label %17
17: ; preds = %12, %8
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%19 = call i32 @system(i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"xterm 2> /dev/null -T Wash -e \22wash -i %s -C ; exit\22 &\00"
@.str.1 = [61 x i8] c"xterm 2> /dev/null -T Wash -e \22wash -i %s -c %s -C ; exit\22 &\00"
define void @wash(i8* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = icmp eq i8* %1, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %10
8: ; preds = %2
%9 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
br label %10
10: ; preds = %8, %6
%11 = call i32 @system(i8* %4)
ret void
}