#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 f1(int, int, int, int, int, int);
int f1t(int, int, int, int, int, int);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int main() {
  int x1, x2, x3, x4, x5, x6;
  int result;
  int i;
  for (i = 0; i < 10; i++) {
    x1 = rand() % 1000;
    x2 = rand() % 1000;
    x3 = rand() % 1000;
    x4 = rand() % 1000;
    x5 = rand() % 1000;
    x6 = rand() % 1000;
    int stud = f1(x1, x2, x3, x4, x5, x6);
    int teac = f1t(x1, x2, x3, x4, x5, x6);
    if (stud != teac) {
      printf("Hiba: x1=%3d, x2=%3d, x3=%3d, x4=%3d, x5=%3d, x6=%3d, "
             "stud=%d, teac=%d\n",
             x1, x2, x3, x4, x5, x6, stud, teac);
    } else {
      printf("OK\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    126d <main+0x12d>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1040 <f1@plt>
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1050 <f1t@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
je     124c <main+0x10c>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%r11d
mov    -0x28(%rbp),%r10d
mov    -0x2c(%rbp),%eax
lea    0xdcd(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125a <main+0x11a>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125f <main+0x11f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1156 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0xa,%eax
jmp    1189 <main+0x39>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
je     12ec <main+0x19c>
mov    %eax,0x4(%rsp)
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rbx
imul   $0x10624dd3,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%ebx
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r13
imul   $0x10624dd3,%r13,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%r13d
mov    %r13,0x8(%rsp)
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r12
imul   $0x10624dd3,%r12,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%r12d
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rbp
imul   $0x10624dd3,%rbp,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%ebp
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r14
imul   $0x10624dd3,%r14,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%r14d
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r15
imul   $0x10624dd3,%r15,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%r15d
mov    %ebx,%edi
mov    %r13d,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
mov    %r15d,%r9d
call   1050 <f1@plt>
mov    %eax,%r13d
mov    %rbx,0x10(%rsp)
mov    %ebx,%edi
mov    0x8(%rsp),%rsi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
mov    %r15d,%r9d
call   1060 <f1t@plt>
cmp    %eax,%r13d
je     1170 <main+0x20>
mov    %eax,%ebx
sub    $0x8,%rsp
lea    0xd3c(%rip),%rdi
mov    0x18(%rsp),%rsi
mov    0x10(%rsp),%rdx
mov    %r12d,%ecx
mov    %ebp,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
push   %rbx
push   %r13
push   %r15
call   1040 <printf@plt>
add    $0x20,%rsp
jmp    117c <main+0x2c>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [72 x i8] c"Hiba: x1=%3d, x2=%3d, x3=%3d, x4=%3d, x5=%3d, x6=%3d, stud=%d, teac=%d\0A\00"
@.str.1 = [4 x i8] c"OK\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %9
br label %12
12: ; preds = %58, %0
%13 = load i32, i32* %9
%14 = icmp slt i32 %13, 10
br i1 %14, label %15, label %61
15: ; preds = %12
%16 = call i32 (...) @rand()
%17 = srem i32 %16, 1000
store i32 %17, i32* %2
%18 = call i32 (...) @rand()
%19 = srem i32 %18, 1000
store i32 %19, i32* %3
%20 = call i32 (...) @rand()
%21 = srem i32 %20, 1000
store i32 %21, i32* %4
%22 = call i32 (...) @rand()
%23 = srem i32 %22, 1000
store i32 %23, i32* %5
%24 = call i32 (...) @rand()
%25 = srem i32 %24, 1000
store i32 %25, i32* %6
%26 = call i32 (...) @rand()
%27 = srem i32 %26, 1000
store i32 %27, i32* %7
%28 = load i32, i32* %2
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = load i32, i32* %7
%34 = call i32 @f1(i32 %28, i32 %29, i32 %30, i32 %31, i32 %32, i32 %33)
store i32 %34, i32* %10
%35 = load i32, i32* %2
%36 = load i32, i32* %3
%37 = load i32, i32* %4
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = load i32, i32* %7
%41 = call i32 @f1t(i32 %35, i32 %36, i32 %37, i32 %38, i32 %39, i32 %40)
store i32 %41, i32* %11
%42 = load i32, i32* %10
%43 = load i32, i32* %11
%44 = icmp ne i32 %42, %43
br i1 %44, label %45, label %55
45: ; preds = %15
%46 = load i32, i32* %2
%47 = load i32, i32* %3
%48 = load i32, i32* %4
%49 = load i32, i32* %5
%50 = load i32, i32* %6
%51 = load i32, i32* %7
%52 = load i32, i32* %10
%53 = load i32, i32* %11
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i32 %46, i32 %47, i32 %48, i32 %49, i32 %50, i32 %51, i32 %52, i32 %53)
br label %57
55: ; preds = %15
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %57
57: ; preds = %55, %45
br label %58
58: ; preds = %57
%59 = load i32, i32* %9
%60 = add nsw i32 %59, 1
store i32 %60, i32* %9
br label %12
61: ; preds = %12
%62 = load i32, i32* %1
ret i32 %62
}

LLVM IR (-O2):
@.str = [72 x i8] c"Hiba: x1=%3d, x2=%3d, x3=%3d, x4=%3d, x5=%3d, x6=%3d, stud=%d, teac=%d\0A\00"
@str = [3 x i8] c"OK\00"
define i32 @main() {
br label %1
1: ; preds = %0, %22
%2 = phi i32 [ 0, %0 ], [ %23, %22 ]
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 1000
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 1000
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 1000
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 1000
%11 = tail call i32 (...) @rand()
%12 = srem i32 %11, 1000
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 1000
%15 = tail call i32 @f1(i32 %4, i32 %6, i32 %8, i32 %10, i32 %12, i32 %14)
%16 = tail call i32 @f1t(i32 %4, i32 %6, i32 %8, i32 %10, i32 %12, i32 %14)
%17 = icmp eq i32 %15, %16
br i1 %17, label %20, label %18
18: ; preds = %1
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %8, i32 %10, i32 %12, i32 %14, i32 %15, i32 %16)
br label %22
20: ; preds = %1
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
%23 = add nuw nsw i32 %2, 1
%24 = icmp eq i32 %23, 10
br i1 %24, label %25, label %1
25: ; preds = %22
ret i32 0
}