#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 */
float average(int *, int);
int /*<<< orphan*/ for_loop_func();
int /*<<< orphan*/ hegeszto();
int /*<<< orphan*/ kalapalo();
int /*<<< orphan*/ kazyfunc();
int /*<<< orphan*/ kazymasikfunc();
int /*<<< orphan*/ my_1st_print_func();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ reszelo();
int this_is_the_coolest_func();
int main() {
  my_1st_print_func();
  printf("%d\n", this_is_the_coolest_func());
  printf("Hello world!\n");
  for_loop_func();
  hegeszto();
  kazyfunc();
  kazymasikfunc();
  int tomb[5] = {1, 2, 3, 4, 5};
  float avg = average(tomb, 5);
  printf("Az atlag: %f\n", avg);
  reszelo();
  kalapalo();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <my_1st_print_func@plt>
mov    $0x0,%al
call   1060 <this_is_the_coolest_func@plt>
mov    %eax,%esi
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   10a0 <for_loop_func@plt>
mov    $0x0,%al
call   1090 <hegeszto@plt>
mov    $0x0,%al
call   10b0 <kazyfunc@plt>
mov    $0x0,%al
call   1050 <kazymasikfunc@plt>
mov    0xe22(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe1f(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe1d(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1080 <average@plt>
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   10c0 <reszelo@plt>
mov    $0x0,%al
call   1030 <kalapalo@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1080 <my_1st_print_func@plt>
xor    %eax,%eax
call   1070 <this_is_the_coolest_func@plt>
lea    0xe37(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe39(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10b0 <for_loop_func@plt>
xor    %eax,%eax
call   10a0 <hegeszto@plt>
xor    %eax,%eax
call   10c0 <kazyfunc@plt>
xor    %eax,%eax
call   1060 <kazymasikfunc@plt>
mov    0xe30(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xe15(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1090 <average@plt>
cvtss2sd %xmm0,%xmm0
lea    0xddd(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
call   10d0 <reszelo@plt>
xor    %eax,%eax
call   1040 <kalapalo@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [14 x i8] c"Hello world!\0A\00"
@__const.main.tomb = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str.2 = [14 x i8] c"Az atlag: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (...) @my_1st_print_func()
%5 = call i32 (...) @this_is_the_coolest_func()
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @for_loop_func()
%9 = call i32 (...) @hegeszto()
%10 = call i32 (...) @kazyfunc()
%11 = call i32 (...) @kazymasikfunc()
%12 = bitcast [5 x i32]* %2 to i8*
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%14 = call float @average(i32* %13, i32 5)
store float %14, float* %3
%15 = load float, float* %3
%16 = fpext float %15 to double
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %16)
%18 = call i32 (...) @reszelo()
%19 = call i32 (...) @kalapalo()
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@__const.main.tomb = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str.2 = [14 x i8] c"Az atlag: %f\0A\00"
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = tail call i32 (...) @my_1st_print_func()
%3 = tail call i32 (...) @this_is_the_coolest_func()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (...) @for_loop_func()
%7 = tail call i32 (...) @hegeszto()
%8 = tail call i32 (...) @kazyfunc()
%9 = tail call i32 (...) @kazymasikfunc()
%10 = bitcast [5 x i32]* %1 to i8*
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%12 = call float @average(i32* %11, i32 5)
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %13)
%15 = call i32 (...) @reszelo()
%16 = call i32 (...) @kalapalo()
ret i32 0
}