#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 *);
int main(int argc, char *argv[]) {
  if (argc > 2) {
    printf("This is a triangle");
  } else {
    printf("This is a diamond");
  }
  if (argc > 4) {
    printf("This is a triangle x2");
  } else {
    printf("This is a diamond x2");
  }
  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   $0x2,-0x8(%rbp)
jle    1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    114d <main+0x3d>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x4,-0x8(%rbp)
jle    1168 <main+0x58>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    1174 <main+0x64>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jle    1132 <main+0x22>
mov    %edi,%ebx
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x4,%ebx
jbe    113e <main+0x2e>
lea    0xef5(%rip),%rdi
jmp    1145 <main+0x35>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"This is a triangle\00"
@.str.1 = [18 x i8] c"This is a diamond\00"
@.str.2 = [22 x i8] c"This is a triangle x2\00"
@.str.3 = [21 x i8] c"This is a diamond x2\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, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 4
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %19
17: ; preds = %12
%18 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"This is a triangle\00"
@.str.1 = [18 x i8] c"This is a diamond\00"
@.str.2 = [22 x i8] c"This is a triangle x2\00"
@.str.3 = [21 x i8] c"This is a diamond x2\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %9
6: ; preds = %2
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = icmp ugt i32 %0, 4
br i1 %8, label %10, label %9
9: ; preds = %4, %6
br label %10
10: ; preds = %6, %9
%11 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), %9 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), %6 ]
%12 = tail call i32 @printf(i8* dereferenceable(1) %11)
ret i32 0
}