#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*/ incr(char *);
int /*<<< orphan*/ is_ok(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
int main(int argc, char const *argv[]) {
  char input[80];
  if (argc == 2)
    strcpy(input, argv[1]);
  else
    strcpy(input, "vzbxkghb");
  printf("Initial input : %s\n", input);
  do {
    incr(input);
  } while (!is_ok(input));
  printf("Final input : %s\n", input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1176 <main+0x36>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
jmp    1186 <main+0x46>
lea    -0x60(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x60(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1050 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1060 <incr@plt>
lea    -0x60(%rbp),%rdi
call   1040 <is_ok@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1196 <main+0x56>
lea    -0x60(%rbp),%rsi
lea    0xe5a(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
cmp    $0x2,%edi
jne    1150 <main+0x10>
mov    0x8(%rsi),%rsi
jmp    1157 <main+0x17>
lea    0xea9(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xea0(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <incr@plt>
mov    %rbx,%rdi
call   1040 <is_ok@plt>
test   %eax,%eax
je     1180 <main+0x40>
lea    0xe82(%rip),%rdi
mov    %rsp,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"vzbxkghb\00"
@.str.1 = [20 x i8] c"Initial input : %s\0A\00"
@.str.2 = [18 x i8] c"Final input : %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strcpy(i8* %10, i8* %13)
br label %18
15: ; preds = %2
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %15, %9
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %24, %18
%22 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%23 = call i32 @incr(i8* %22)
br label %24
24: ; preds = %21
%25 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%26 = call i32 @is_ok(i8* %25)
%27 = icmp ne i32 %26, 0
%28 = xor i1 %27, true
br i1 %28, label %21, label %29
29: ; preds = %24
%30 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%31 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"vzbxkghb\00"
@.str.1 = [20 x i8] c"Initial input : %s\0A\00"
@.str.2 = [18 x i8] c"Final input : %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
br label %9
9: ; preds = %2, %6
%10 = phi i8* [ %8, %6 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %2 ]
%11 = call i32 @strcpy(i8* %4, i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %13
13: ; preds = %13, %9
%14 = call i32 @incr(i8* %4)
%15 = call i32 @is_ok(i8* %4)
%16 = icmp eq i32 %15, 0
br i1 %16, label %13, label %17
17: ; preds = %13
%18 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret i32 0
}