#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 nok(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  srand((unsigned)time(NULL));
  int i, j, res = 1;
  int mas[5] = {24, 36, 144, 48, 72};
  for (i = 0; i < 5; ++i)
    printf("%d ", mas[i]);
  for (i = 0; i < 5; ++i)
    res = nok(res, mas[i]);
  printf("res: %d\n", res);
  return 0;
}


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)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x1,-0x1c(%rbp)
mov    0xe8c(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe89(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe87(%rip),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    11bf <main+0x7f>
movslq -0x14(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1193 <main+0x53>
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    11f1 <main+0xb1>
mov    -0x1c(%rbp),%edi
movslq -0x14(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
call   1060 <nok@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c6 <main+0x86>
mov    -0x1c(%rbp),%esi
lea    0xe1d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
lea    0xeaa(%rip),%rbx
mov    %rbx,%rdi
mov    $0x18,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x24,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x90,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x30,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x48,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x18,%esi
call   1060 <nok@plt>
mov    %eax,%edi
mov    $0x24,%esi
call   1060 <nok@plt>
mov    %eax,%edi
mov    $0x90,%esi
call   1060 <nok@plt>
mov    %eax,%edi
mov    $0x30,%esi
call   1060 <nok@plt>
mov    %eax,%edi
mov    $0x48,%esi
call   1060 <nok@plt>
lea    0xe27(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.mas = [5 x i32] [i32 24, i32 36, i32 144, i32 48, i32 72]
@.str = [4 x i8] c"%d \00"
@.str.1 = [9 x i8] c"res: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [5 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i64 @time(i32* null)
%11 = trunc i64 %10 to i32
%12 = call i32 @srand(i32 %11)
store i32 1, i32* %8
%13 = bitcast [5 x i32]* %9 to i8*
store i32 0, i32* %6
br label %14
14: ; preds = %23, %2
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 5
br i1 %16, label %17, label %26
17: ; preds = %14
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %17
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %14
26: ; preds = %14
store i32 0, i32* %6
br label %27
27: ; preds = %37, %26
%28 = load i32, i32* %6
%29 = icmp slt i32 %28, 5
br i1 %29, label %30, label %40
30: ; preds = %27
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = call i32 @nok(i32 %31, i32 %35)
store i32 %36, i32* %8
br label %37
37: ; preds = %30
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %27
40: ; preds = %27
%41 = load i32, i32* %8
%42 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %41)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@.str.1 = [9 x i8] c"res: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 24)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 36)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 144)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 48)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 72)
%11 = tail call i32 @nok(i32 1, i32 24)
%12 = tail call i32 @nok(i32 %11, i32 36)
%13 = tail call i32 @nok(i32 %12, i32 144)
%14 = tail call i32 @nok(i32 %13, i32 48)
%15 = tail call i32 @nok(i32 %14, i32 72)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}