#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main(void) {
  int i = 0;
  int j = 0;
  FILE *lab4;
  lab4 = fopen("/home/daimon/Desktop/yusuf.txt", "w+");
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 5; j++) {
      fprintf(lab4, "*");
    }
    fprintf(lab4, "\n");
  }
  fprintf(lab4, "\n");
  for (i = 0; i <= 5; i++) {
    if (i % 2 == 1) {
      for (j = 0; j < i; j++) {
        fprintf(lab4, "*");
      }
      fprintf(lab4, "\n");
    }
  }
  fprintf(lab4, "\n");
  for (i = 1; i <= 3; i++) {
    if (i % 3 != 0) {
      fprintf(lab4, "*\n");
    } else {
      for (j = 0; j < 5; j++) {
        fprintf(lab4, "*");
      }
      fprintf(lab4, "\n");
    }
  }
  fprintf(lab4, "\n");
  fclose(lab4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeac(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11c2 <main+0x92>
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    11a4 <main+0x74>
mov    -0x18(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117c <main+0x4c>
mov    -0x18(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116b <main+0x3b>
mov    -0x18(%rbp),%rdi
lea    0xe58(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     124b <main+0x11b>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1238 <main+0x108>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1228 <main+0xf8>
mov    -0x18(%rbp),%rdi
lea    0xe0d(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11fe <main+0xce>
mov    -0x18(%rbp),%rdi
lea    0xdf2(%rip),%rsi
call   1040 <fprintf@plt>
jmp    123d <main+0x10d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d9 <main+0xa9>
mov    -0x18(%rbp),%rdi
lea    0xdcf(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jg     12e7 <main+0x1b7>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1295 <main+0x165>
mov    -0x18(%rbp),%rdi
lea    0xd99(%rip),%rsi
call   1040 <fprintf@plt>
jmp    12d4 <main+0x1a4>
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    12c4 <main+0x194>
mov    -0x18(%rbp),%rdi
lea    0xd71(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    129c <main+0x16c>
mov    -0x18(%rbp),%rdi
lea    0xd56(%rip),%rsi
call   1040 <fprintf@plt>
jmp    12d9 <main+0x1a9>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1262 <main+0x132>
mov    -0x18(%rbp),%rdi
lea    0xd33(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    $0x2a,%edi
mov    %rax,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
lea    0xd21(%rip),%r14
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0x2a,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"/home/daimon/Desktop/yusuf.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [3 x i8] c"*\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%5 = call i32* @fopen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %5, i32** %4
store i32 0, i32* %2
br label %6
6: ; preds = %22, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %25
9: ; preds = %6
store i32 0, i32* %3
br label %10
10: ; preds = %16, %9
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = load i32*, i32** %4
%15 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %13
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %10
19: ; preds = %10
%20 = load i32*, i32** %4
%21 = call i32 @fprintf(i32* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %19
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %6
25: ; preds = %6
%26 = load i32*, i32** %4
%27 = call i32 @fprintf(i32* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %28
28: ; preds = %50, %25
%29 = load i32, i32* %2
%30 = icmp sle i32 %29, 5
br i1 %30, label %31, label %53
31: ; preds = %28
%32 = load i32, i32* %2
%33 = srem i32 %32, 2
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %49
35: ; preds = %31
store i32 0, i32* %3
br label %36
36: ; preds = %43, %35
%37 = load i32, i32* %3
%38 = load i32, i32* %2
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %46
40: ; preds = %36
%41 = load i32*, i32** %4
%42 = call i32 @fprintf(i32* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %43
43: ; preds = %40
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 1
store i32 %45, i32* %3
br label %36
46: ; preds = %36
%47 = load i32*, i32** %4
%48 = call i32 @fprintf(i32* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %49
49: ; preds = %46, %31
br label %50
50: ; preds = %49
%51 = load i32, i32* %2
%52 = add nsw i32 %51, 1
store i32 %52, i32* %2
br label %28
53: ; preds = %28
%54 = load i32*, i32** %4
%55 = call i32 @fprintf(i32* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %2
br label %56
56: ; preds = %80, %53
%57 = load i32, i32* %2
%58 = icmp sle i32 %57, 3
br i1 %58, label %59, label %83
59: ; preds = %56
%60 = load i32, i32* %2
%61 = srem i32 %60, 3
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %59
%64 = load i32*, i32** %4
%65 = call i32 @fprintf(i32* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %79
66: ; preds = %59
store i32 0, i32* %3
br label %67
67: ; preds = %73, %66
%68 = load i32, i32* %3
%69 = icmp slt i32 %68, 5
br i1 %69, label %70, label %76
70: ; preds = %67
%71 = load i32*, i32** %4
%72 = call i32 @fprintf(i32* %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %73
73: ; preds = %70
%74 = load i32, i32* %3
%75 = add nsw i32 %74, 1
store i32 %75, i32* %3
br label %67
76: ; preds = %67
%77 = load i32*, i32** %4
%78 = call i32 @fprintf(i32* %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %79
79: ; preds = %76, %63
br label %80
80: ; preds = %79
%81 = load i32, i32* %2
%82 = add nsw i32 %81, 1
store i32 %82, i32* %2
br label %56
83: ; preds = %56
%84 = load i32*, i32** %4
%85 = call i32 @fprintf(i32* %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%86 = load i32*, i32** %4
%87 = call i32 @fclose(i32* %86)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"/home/daimon/Desktop/yusuf.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.4 = [3 x i8] c"*\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fputc(i32 42, i32* %1)
%3 = tail call i32 @fputc(i32 42, i32* %1)
%4 = tail call i32 @fputc(i32 42, i32* %1)
%5 = tail call i32 @fputc(i32 42, i32* %1)
%6 = tail call i32 @fputc(i32 42, i32* %1)
%7 = tail call i32 @fputc(i32 10, i32* %1)
%8 = tail call i32 @fputc(i32 42, i32* %1)
%9 = tail call i32 @fputc(i32 42, i32* %1)
%10 = tail call i32 @fputc(i32 42, i32* %1)
%11 = tail call i32 @fputc(i32 42, i32* %1)
%12 = tail call i32 @fputc(i32 42, i32* %1)
%13 = tail call i32 @fputc(i32 10, i32* %1)
%14 = tail call i32 @fputc(i32 42, i32* %1)
%15 = tail call i32 @fputc(i32 42, i32* %1)
%16 = tail call i32 @fputc(i32 42, i32* %1)
%17 = tail call i32 @fputc(i32 42, i32* %1)
%18 = tail call i32 @fputc(i32 42, i32* %1)
%19 = tail call i32 @fputc(i32 10, i32* %1)
%20 = tail call i32 @fputc(i32 10, i32* %1)
%21 = tail call i32 @fputc(i32 42, i32* %1)
%22 = tail call i32 @fputc(i32 10, i32* %1)
%23 = tail call i32 @fputc(i32 42, i32* %1)
%24 = tail call i32 @fputc(i32 42, i32* %1)
%25 = tail call i32 @fputc(i32 42, i32* %1)
%26 = tail call i32 @fputc(i32 10, i32* %1)
%27 = tail call i32 @fputc(i32 42, i32* %1)
%28 = tail call i32 @fputc(i32 42, i32* %1)
%29 = tail call i32 @fputc(i32 42, i32* %1)
%30 = tail call i32 @fputc(i32 42, i32* %1)
%31 = tail call i32 @fputc(i32 42, i32* %1)
%32 = tail call i32 @fputc(i32 10, i32* %1)
%33 = tail call i32 @fputc(i32 10, i32* %1)
%34 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 2, i64 1, i32* %1)
%35 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 2, i64 1, i32* %1)
%36 = tail call i32 @fputc(i32 42, i32* %1)
%37 = tail call i32 @fputc(i32 42, i32* %1)
%38 = tail call i32 @fputc(i32 42, i32* %1)
%39 = tail call i32 @fputc(i32 42, i32* %1)
%40 = tail call i32 @fputc(i32 42, i32* %1)
%41 = tail call i32 @fputc(i32 10, i32* %1)
%42 = tail call i32 @fputc(i32 10, i32* %1)
%43 = tail call i32 @fclose(i32* %1)
ret i32 0
}