#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) {
  int control;
  char buffer[64];
  if (argc == 1) {
    errx(1, "please specify an argument\n");
  }
  printf("You win this game if you can change variable control to the value "
         "0x61626364'\n");
  control = 0;
  strcpy(buffer, argv[1]);
  if (control == 0x61626364) {
    printf("Congratulations, you win!!! You correctly got the variable to the "
           "right value\n");
  } else {
    printf("Try again, you got 0x%08x\n, instead of 0x61626364", control);
  }
}


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>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
cmpl   $0x61626364,-0x14(%rbp)
jne    11a7 <main+0x77>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11b8 <main+0x88>
mov    -0x14(%rbp),%esi
lea    0xf09(%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    $0x40,%rsp
mov    %rsi,%rbx
cmp    $0x1,%edi
jne    115e <main+0x1e>
lea    0xeac(%rip),%rsi
mov    $0x1,%edi
call   1050 <errx@plt>
lea    0xee9(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rbx),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
lea    0xe9f(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"please specify an argument\0A\00"
@.str.1 = [79 x i8] c"You win this game if you can change variable control to the value 0x61626364'\0A\00"
@.str.2 = [79 x i8] c"Congratulations, you win!!! You correctly got the variable to the right value\0A\00"
@.str.3 = [50 x i8] c"Try again, you got 0x%08x\0A, instead of 0x61626364\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
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %6
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @strcpy(i8* %14, i8* %17)
%19 = load i32, i32* %6
%20 = icmp eq i32 %19, 1633837924
br i1 %20, label %21, label %23
21: ; preds = %12
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.2, i64 0, i64 0))
br label %26
23: ; preds = %12
%24 = load i32, i32* %6
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %23, %21
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [28 x i8] c"please specify an argument\0A\00"
@.str.3 = [50 x i8] c"Try again, you got 0x%08x\0A, instead of 0x61626364\00"
@str = [78 x i8] c"You win this game if you can change variable control to the value 0x61626364'\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcpy(i8* %4, i8* %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret i32 0
}