#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 fact(int);
int isPrime(int);
int is_prime(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  char str[] = "hfjkkjsfd";
  int n = 0;
  printf("%s", str);
  do {
    switch (n % 3) {
    case 0:
      printf("%d\n", fact(n));
      break;
    case 1:
      printf("%d\n", is_prime(n));
    default:
      printf("%d, %d\n", fact(n), isPrime(n));
    }
  } while (n++ < 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xea3(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xea0(%rip),%ax
mov    %ax,-0x12(%rbp)
movl   $0x0,-0x20(%rbp)
lea    -0x1a(%rbp),%rsi
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x20(%rbp),%rcx
mov    %ecx,%eax
imul   $0x55555556,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
je     11c5 <main+0x85>
jmp    11b4 <main+0x74>
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
je     11e2 <main+0xa2>
jmp    11fa <main+0xba>
mov    -0x20(%rbp),%edi
call   1060 <fact@plt>
mov    %eax,%esi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1220 <main+0xe0>
mov    -0x20(%rbp),%edi
call   1050 <is_prime@plt>
mov    %eax,%esi
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%edi
call   1060 <fact@plt>
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%edi
call   1040 <isPrime@plt>
mov    -0x28(%rbp),%esi
mov    %eax,%edx
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1225 <main+0xe5>
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x20(%rbp)
cmp    $0xa,%eax
jl     1185 <main+0x45>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
movabs $0x66736a6b6b6a6668,%rax
6a 73 66
mov    %rax,(%rsp)
movw   $0x64,0x8(%rsp)
lea    0xea2(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xaaaaaaab,%r12d
lea    0xe92(%rip),%r14
lea    0xe87(%rip),%r15
xor    %ebp,%ebp
jmp    11c9 <main+0x89>
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1050 <is_prime@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%edi
call   1060 <fact@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1040 <isPrime@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0xb,%ebp
je     11f8 <main+0xb8>
mov    %ebp,%eax
imul   %r12,%rax
shr    $0x21,%rax
lea    (%rax,%rax,2),%ecx
mov    %ebp,%eax
sub    %ecx,%eax
cmp    $0x1,%eax
je     1190 <main+0x50>
test   %eax,%eax
jne    11a3 <main+0x63>
mov    %ebp,%edi
call   1060 <fact@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11c1 <main+0x81>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.str = [10 x i8] c"hfjkkjsfd\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [8 x i8] c"%d, %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [10 x i8]* %6 to i8*
store i32 0, i32* %7
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %29, %2
%12 = load i32, i32* %7
%13 = srem i32 %12, 3
switch i32 %13, label %22 [
i32 0, label %14
i32 1, label %18
]
14: ; preds = %11
%15 = load i32, i32* %7
%16 = call i32 @fact(i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %28
18: ; preds = %11
%19 = load i32, i32* %7
%20 = call i32 @is_prime(i32 %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %11, %18
%23 = load i32, i32* %7
%24 = call i32 @fact(i32 %23)
%25 = load i32, i32* %7
%26 = call i32 @isPrime(i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %24, i32 %26)
br label %28
28: ; preds = %22, %14
br label %29
29: ; preds = %28
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
store i32 %31, i32* %7
%32 = icmp slt i32 %30, 10
br i1 %32, label %11, label %33
33: ; preds = %29
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@__const.main.str = [10 x i8] c"hfjkkjsfd\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [8 x i8] c"%d, %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %6
6: ; preds = %21, %2
%7 = phi i32 [ 0, %2 ], [ %22, %21 ]
%8 = trunc i32 %7 to i8
%9 = urem i8 %8, 3
%10 = zext i8 %9 to i32
switch i32 %10, label %17 [
i32 0, label %11
i32 1, label %14
]
11: ; preds = %6
%12 = call i32 @fact(i32 %7)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %21
14: ; preds = %6
%15 = call i32 @is_prime(i32 %7)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %6, %14
%18 = call i32 @fact(i32 %7)
%19 = call i32 @isPrime(i32 %7)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %18, i32 %19)
br label %21
21: ; preds = %11, %17
%22 = add nuw nsw i32 %7, 1
%23 = icmp eq i32 %22, 11
br i1 %23, label %24, label %6
24: ; preds = %21
ret i32 0
}