#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 */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int syscall(int, int, int);
int main(int argc, char **argv) {
  int32_t ret;
  ret = syscall(332, 0x1be5, 0x456d23a8);
  if (ret) {
    printf("Got error: %d :(\n", ret);
    return ret;
  }
  printf("You chose wisely.\n");
  ret = syscall(332, 0x1be4, 0x456d23a8);
  if (!ret)
    printf("The fucking thing is broken.\n");
  else
    printf("None shall pass without a shubbery.\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    $0x14c,%edi
mov    $0x1be5,%esi
mov    $0x456d23a8,%edx
call   1040 <syscall@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1173 <main+0x53>
mov    -0x14(%rbp),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11ca <main+0xaa>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x14c,%edi
mov    $0x1be4,%esi
mov    $0x456d23a8,%edx
call   1040 <syscall@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11b5 <main+0x95>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c3 <main+0xa3>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x14c,%edi
mov    $0x1be5,%esi
mov    $0x456d23a8,%edx
call   1050 <syscall@plt>
mov    %eax,%ebx
test   %eax,%eax
je     115d <main+0x2d>
lea    0xeae(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1196 <main+0x66>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
mov    $0x14c,%edi
mov    $0x1be4,%esi
mov    $0x456d23a8,%edx
call   1050 <syscall@plt>
test   %eax,%eax
je     118a <main+0x5a>
lea    0xeb9(%rip),%rdi
jmp    1191 <main+0x61>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Got error: %d :(\0A\00"
@.str.1 = [19 x i8] c"You chose wisely.\0A\00"
@.str.2 = [30 x i8] c"The fucking thing is broken.\0A\00"
@.str.3 = [37 x i8] c"None shall pass without a shubbery.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @syscall(i32 332, i32 7141, i32 1164780456)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %6
store i32 %13, i32* %3
br label %24
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @syscall(i32 332, i32 7140, i32 1164780456)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = icmp ne i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %14
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %23
21: ; preds = %14
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
store i32 0, i32* %3
br label %24
24: ; preds = %23, %10
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@.str = [18 x i8] c"Got error: %d :(\0A\00"
@str = [18 x i8] c"You chose wisely.\00"
@str.4 = [29 x i8] c"The fucking thing is broken.\00"
@str.5 = [36 x i8] c"None shall pass without a shubbery.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @syscall(i32 332, i32 7141, i32 1164780456)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %15
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @syscall(i32 332, i32 7140, i32 1164780456)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.4, i64 0, i64 0))
br label %15
13: ; preds = %7
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.5, i64 0, i64 0))
br label %15
15: ; preds = %11, %13, %5
ret i32 %3
}