#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, unsigned char);
int /*<<< orphan*/ strcpy(char *, char *);
unsigned char strlen(char *);
int main(int argc, char **argv) {
  int ret = EXIT_FAILURE;
  if (argc == 2) {
    char buf[255];
    unsigned char size = strlen(argv[1]);
    if (size < 254) {
      printf("size = %d\n", size);
      strcpy(buf, argv[1]);
      ret = EXIT_SUCCESS;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11bc <main+0x8c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    %al,-0x121(%rbp)
movzbl -0x121(%rbp),%eax
cmp    $0xfe,%eax
jge    11b7 <main+0x87>
lea    0xe75(%rip),%rdi
movzbl -0x121(%rbp),%esi
call   1050 <printf@plt>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
mov    0x2e26(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    11bc <main+0x8c>
mov    -0x14(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x108,%rsp
mov    0x2ea0(%rip),%rax
mov    (%rax),%ebp
cmp    $0x2,%edi
jne    117b <main+0x4b>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <strlen@plt>
cmp    $0xfd,%al
ja     117b <main+0x4b>
movzbl %al,%esi
lea    0xe9f(%rip),%rdi
call   1050 <printf@plt>
mov    0x8(%rbx),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%eax
add    $0x108,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [11 x i8] c"size = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [255 x i8]
%8 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* @EXIT_FAILURE
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %30
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call zeroext i8 @strlen(i8* %15)
store i8 %16, i8* %8
%17 = load i8, i8* %8
%18 = zext i8 %17 to i32
%19 = icmp slt i32 %18, 254
br i1 %19, label %20, label %29
20: ; preds = %12
%21 = load i8, i8* %8
%22 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 zeroext %21)
%23 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @strcpy(i8* %23, i8* %26)
%28 = load i32, i32* @EXIT_SUCCESS
store i32 %28, i32* %6
br label %29
29: ; preds = %20, %12
br label %30
30: ; preds = %29, %2
%31 = load i32, i32* %6
ret i32 %31
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [11 x i8] c"size = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [255 x i8]
%4 = load i32, i32* @EXIT_FAILURE
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %19
6: ; preds = %2
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call zeroext i8 @strlen(i8* %9)
%11 = icmp ult i8 %10, -2
br i1 %11, label %12, label %17
12: ; preds = %6
%13 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
%14 = load i8*, i8** %8
%15 = call i32 @strcpy(i8* %7, i8* %14)
%16 = load i32, i32* @EXIT_SUCCESS
br label %17
17: ; preds = %12, %6
%18 = phi i32 [ %16, %12 ], [ %4, %6 ]
br label %19
19: ; preds = %17, %2
%20 = phi i32 [ %18, %17 ], [ %4, %2 ]
ret i32 %20
}