#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*/ errx(int, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  volatile int modified;
  char buffer[64];
  if (argc == 1) {
    errx(1, "please specify an argument\n");
  }
  modified = 0;
  strcpy(buffer, argv[1]);
  if (modified == 0x61626364) {
    printf("you have correctly got the variable to the right value\n");
    printf("You got 0x%08x\n", modified);
  } else {
    printf("Try again, you got 0x%08x\n", modified);
  }
}


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   $0x1,-0x8(%rbp)
jne    1161 <main+0x31>
mov    $0x1,%edi
lea    0xea4(%rip),%rsi
call   1040 <errx@plt>
movl   $0x0,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%eax
cmp    $0x61626364,%eax
jne    11ab <main+0x7b>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11bc <main+0x8c>
mov    -0x14(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%rbx
cmp    $0x1,%edi
jne    115e <main+0x1e>
lea    0xeac(%rip),%rsi
mov    $0x1,%edi
call   1050 <errx@plt>
movl   $0x0,0xc(%rsp)
mov    0x8(%rbx),%rsi
lea    0x10(%rsp),%rdi
call   1030 <strcpy@plt>
mov    0xc(%rsp),%eax
cmp    $0x61626364,%eax
jne    1198 <main+0x58>
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%esi
lea    0xe86(%rip),%rdi
jmp    11a3 <main+0x63>
mov    0xc(%rsp),%esi
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"please specify an argument\0A\00"
@.str.1 = [56 x i8] c"you have correctly got the variable to the right value\0A\00"
@.str.2 = [16 x i8] c"You got 0x%08x\0A\00"
@.str.3 = [27 x i8] c"Try again, you got 0x%08x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [64 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @errx(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
store volatile i32 0, i32* %6
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @strcpy(i8* %13, i8* %16)
%18 = load volatile i32, i32* %6
%19 = icmp eq i32 %18, 1633837924
br i1 %19, label %20, label %24
20: ; preds = %12
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%22 = load volatile i32, i32* %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %22)
br label %27
24: ; preds = %12
%25 = load volatile i32, i32* %6
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %24, %20
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@.str = [28 x i8] c"please specify an argument\0A\00"
@.str.2 = [16 x i8] c"You got 0x%08x\0A\00"
@.str.3 = [27 x i8] c"Try again, you got 0x%08x\0A\00"
@str = [55 x i8] c"you have correctly got the variable to the right value\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [64 x i8]
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
store volatile i32 0, i32* %3
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strcpy(i8* %6, i8* %12)
%14 = load volatile i32, i32* %3
%15 = icmp eq i32 %14, 1633837924
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%18 = load volatile i32, i32* %3
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %18)
br label %23
20: ; preds = %10
%21 = load volatile i32, i32* %3
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %20, %16
ret i32 0
}