#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*/ printf(char *);
int main(int argc, char *argv[]) {
  unsigned char c = argv[1][0];
  if (argc > 1) {
    if (c == 127)
      printf("win\n");
    else
      printf("lose\n");
  } else {
    printf("Usage: program-name character\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    116c <main+0x5c>
movzbl -0x11(%rbp),%eax
cmp    $0x7f,%eax
jne    115b <main+0x4b>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    1167 <main+0x57>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    1178 <main+0x68>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     1131 <main+0x21>
mov    0x8(%rsi),%rax
cmpb   $0x7f,(%rax)
lea    0xeff(%rip),%rax
lea    0xef3(%rip),%rdi
cmove  %rax,%rdi
jmp    1138 <main+0x28>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"win\0A\00"
@.str.1 = [6 x i8] c"lose\0A\00"
@.str.2 = [31 x i8] c"Usage: program-name character\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
store i8 %11, i8* %6
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 1
br i1 %13, label %14, label %23
14: ; preds = %2
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 127
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %22
20: ; preds = %14
%21 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
br label %25
23: ; preds = %2
%24 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %22
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"Usage: program-name character\00"
@str.3 = [5 x i8] c"lose\00"
@str.4 = [4 x i8] c"win\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 127
%9 = select i1 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.3, i64 0, i64 0)
br label %10
10: ; preds = %2, %4
%11 = phi i8* [ %9, %4 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0), %2 ]
%12 = tail call i32 @puts(i8* dereferenceable(1) %11)
ret i32 0
}