#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 strlen(char *);
int main(int argc, char *argv[]) {
  int i = 1;
  char c = 'c';
  char *arr = "fox";
  if (i == 0) {
    printf("i is 0.\n");
  } else {
    printf("i is not 0. its %d\n", i);
  }
  if (strlen(&c) == 1) {
    printf("the string-lenth of c is 1.\n");
  } else if (strlen(&c) == 2) {
    printf("the string-lenth of c is 2.\n");
  } else if (strlen(&c) > 2) {
    printf("the string-lenth of c is greater than 2.\n");
  } else {
    printf("anything else.\n");
  }
  if (strcmp(arr, "fox") == 0) {
    printf("arr is a fox.\n");
  } else {
    printf("arr isnt a fox.");
  }
  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)
movl   $0x1,-0x14(%rbp)
movb   $0x63,-0x15(%rbp)
lea    0xea8(%rip),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1179 <main+0x49>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    118a <main+0x5a>
mov    -0x14(%rbp),%esi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x15(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jne    11af <main+0x7f>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1211 <main+0xe1>
lea    -0x15(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    11d4 <main+0xa4>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    120c <main+0xdc>
lea    -0x15(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jle    11f9 <main+0xc9>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1207 <main+0xd7>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    120c <main+0xdc>
jmp    1211 <main+0xe1>
mov    -0x20(%rbp),%rdi
lea    0xde4(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    123e <main+0x10e>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    124c <main+0x11c>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x63,0x7(%rsp)
lea    0xeb7(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x7(%rsp),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    1171 <main+0x31>
lea    0xf1b(%rip),%rdi
jmp    11a8 <main+0x68>
lea    0x7(%rsp),%rdi
call   1040 <strlen@plt>
cmp    $0x2,%eax
jne    1189 <main+0x49>
lea    0xee7(%rip),%rdi
jmp    11a8 <main+0x68>
lea    0x7(%rsp),%rdi
call   1040 <strlen@plt>
cmp    $0x3,%eax
lea    0xea8(%rip),%rax
lea    0xe84(%rip),%rdi
cmovge %rax,%rdi
call   1030 <puts@plt>
lea    0xe4c(%rip),%rdi
mov    %rdi,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11d1 <main+0x91>
lea    0xe50(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11dd <main+0x9d>
lea    0xe5f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"fox\00"
@.str.1 = [9 x i8] c"i is 0.\0A\00"
@.str.2 = [20 x i8] c"i is not 0. its %d\0A\00"
@.str.3 = [29 x i8] c"the string-lenth of c is 1.\0A\00"
@.str.4 = [29 x i8] c"the string-lenth of c is 2.\0A\00"
@.str.5 = [42 x i8] c"the string-lenth of c is greater than 2.\0A\00"
@.str.6 = [16 x i8] c"anything else.\0A\00"
@.str.7 = [15 x i8] c"arr is a fox.\0A\00"
@.str.8 = [16 x i8] c"arr isnt a fox.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i8 99, i8* %7
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %8
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %16
13: ; preds = %2
%14 = load i32, i32* %6
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %11
%17 = call i32 @strlen(i8* %7)
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
br label %35
21: ; preds = %16
%22 = call i32 @strlen(i8* %7)
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %34
26: ; preds = %21
%27 = call i32 @strlen(i8* %7)
%28 = icmp sgt i32 %27, 2
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
br label %33
31: ; preds = %26
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
br label %34
34: ; preds = %33, %24
br label %35
35: ; preds = %34, %19
%36 = load i8*, i8** %8
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
br label %43
41: ; preds = %35
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
br label %43
43: ; preds = %41, %39
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"fox\00"
@.str.2 = [20 x i8] c"i is not 0. its %d\0A\00"
@.str.8 = [16 x i8] c"arr isnt a fox.\00"
@str = [15 x i8] c"anything else.\00"
@str.9 = [14 x i8] c"arr is a fox.\00"
@str.10 = [41 x i8] c"the string-lenth of c is greater than 2.\00"
@str.11 = [28 x i8] c"the string-lenth of c is 2.\00"
@str.12 = [28 x i8] c"the string-lenth of c is 1.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
store i8 99, i8* %3
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 1)
%5 = call i32 @strlen(i8* %3)
%6 = icmp eq i32 %5, 1
br i1 %6, label %14, label %7
7: ; preds = %2
%8 = call i32 @strlen(i8* %3)
%9 = icmp eq i32 %8, 2
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = call i32 @strlen(i8* %3)
%12 = icmp sgt i32 %11, 2
%13 = select i1 %12, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0)
br label %14
14: ; preds = %10, %7, %2
%15 = phi i8* [ getelementptr inbounds ([28 x i8], [28 x i8]* @str.12, i64 0, i64 0), %2 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @str.11, i64 0, i64 0), %7 ], [ %13, %10 ]
%16 = call i32 @puts(i8* dereferenceable(1) %15)
%17 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.9, i64 0, i64 0))
br label %23
21: ; preds = %14
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
ret i32 0
}