#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*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc > 1 && strcmp(argv[1], "-advice") == 0) {
    printf("Don’t Panic!\n");
    return 42;
  }
  printf("Need an advice?\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1176 <main+0x56>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1176 <main+0x56>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2a,-0x4(%rbp)
jmp    1189 <main+0x69>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jl     113b <main+0x1b>
mov    0x8(%rsi),%rdi
lea    0xecf(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1146 <main+0x26>
xor    %ebx,%ebx
lea    0xec4(%rip),%rdi
jmp    1152 <main+0x32>
mov    $0x2a,%ebx
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"-advice\00"
@.str.1 = [16 x i8] c"Don\E2\80\99t Panic!\0A\00"
@.str.2 = [17 x i8] c"Need an advice?\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
store i32 42, i32* %3
br label %18
16: ; preds = %8, %2
%17 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [8 x i8] c"-advice\00"
@str = [16 x i8] c"Need an advice?\00"
@str.3 = [15 x i8] c"Don\E2\80\99t Panic!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %4, %2
br label %10
10: ; preds = %4, %9
%11 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0), %9 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @str.3, i64 0, i64 0), %4 ]
%12 = phi i32 [ 0, %9 ], [ 42, %4 ]
%13 = tail call i32 @puts(i8* dereferenceable(1) %11)
ret i32 %12
}