#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 *, char *, char *);
int /*<<< orphan*/ free(char *);
char *make_word(int);
int /*<<< orphan*/ printf(char *);
int rand();
void makeDict(int size) {
  FILE *fData;
  int i;
  char *word, *mean;
  fData = fopen("dict.txt", "w");
  for (i = 0; i < size; ++i) {
    word = make_word(rand() % 10 + 4);
    mean = make_word(7);
    fprintf(fData, "%s\t%s\n", word, mean);
    free(word);
  }
  printf("Successfull\n");
  fclose(fData);
}


x86 assembly (clang, -O0):
<makeDict>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe7e(%rip),%rdi
lea    0xe80(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11ff <makeDict+0x8f>
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x4,%edi
call   1040 <make_word@plt>
mov    %rax,-0x20(%rbp)
mov    $0x7,%edi
call   1040 <make_word@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xe28(%rip),%rsi
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1199 <makeDict+0x29>
lea    0xe0c(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeDict>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xe80(%rip),%rdi
lea    0xe82(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r14
test   %ebp,%ebp
jle    11fa <makeDict+0x8a>
lea    0xe71(%rip),%r15
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1090 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x4,%edi
call   1050 <make_word@plt>
mov    %rax,%rbx
mov    $0x7,%edi
call   1050 <make_word@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1070 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0xffffffff,%ebp
jne    11a0 <makeDict+0x30>
lea    0xe11(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <fclose@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"dict.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [7 x i8] c"%s\09%s\0A\00"
@.str.3 = [13 x i8] c"Successfull\0A\00"
define void @makeDict(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %2
%7 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %3
store i32 0, i32* %4
br label %8
8: ; preds = %24, %1
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = call i32 (...) @rand()
%14 = srem i32 %13, 10
%15 = add nsw i32 %14, 4
%16 = call i8* @make_word(i32 %15)
store i8* %16, i8** %5
%17 = call i8* @make_word(i32 7)
store i8* %17, i8** %6
%18 = load i32*, i32** %3
%19 = load i8*, i8** %5
%20 = load i8*, i8** %6
%21 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %19, i8* %20)
%22 = load i8*, i8** %5
%23 = call i32 @free(i8* %22)
br label %24
24: ; preds = %12
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %8
27: ; preds = %8
%28 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%29 = load i32*, i32** %3
%30 = call i32 @fclose(i32* %29)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"dict.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [7 x i8] c"%s\09%s\0A\00"
@str = [12 x i8] c"Successfull\00"
define void @makeDict(i32 %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %15
4: ; preds = %1, %4
%5 = phi i32 [ %13, %4 ], [ 0, %1 ]
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 10
%8 = add nsw i32 %7, 4
%9 = tail call i8* @make_word(i32 %8)
%10 = tail call i8* @make_word(i32 7)
%11 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %9, i8* %10)
%12 = tail call i32 @free(i8* %9)
%13 = add nuw nsw i32 %5, 1
%14 = icmp eq i32 %13, %0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%17 = tail call i32 @fclose(i32* %2)
ret void
}