#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 /*<<< orphan*/ printf(char *, int, int);
void wypisz_odbiegajace(int tab[], int dl) {
  int i;
  for (i = 0; i < dl; i++) {
    if ((tab[i] < 3) || (tab[i] > 15)) {
      printf("Waga %i towaru (%i kg) odbiega od normy!\n", i + 1, tab[i]);
    }
  }
}


x86 assembly (clang, -O0):
<wypisz_odbiegajace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1186 <wypisz_odbiegajace+0x76>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x3,(%rax,%rcx,4)
jl     1156 <wypisz_odbiegajace+0x46>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0xf,(%rax,%rcx,4)
jle    1173 <wypisz_odbiegajace+0x63>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    1178 <wypisz_odbiegajace+0x68>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <wypisz_odbiegajace+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wypisz_odbiegajace>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1155 <wypisz_odbiegajace+0x45>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %esi,%esi
lea    0xed5(%rip),%r14
jmp    1138 <wypisz_odbiegajace+0x28>
nopl   (%rax)
mov    %rbx,%rsi
cmp    %rbx,%r12
je     1155 <wypisz_odbiegajace+0x45>
mov    (%r15,%rsi,4),%edx
lea    -0x10(%rdx),%eax
lea    0x1(%rsi),%rbx
cmp    $0xfffffff2,%eax
ja     1130 <wypisz_odbiegajace+0x20>
add    $0x1,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1130 <wypisz_odbiegajace+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Waga %i towaru (%i kg) odbiega od normy!\0A\00"
define void @wypisz_odbiegajace(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %34, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %37
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = icmp slt i32 %15, 3
br i1 %16, label %24, label %17
17: ; preds = %10
%18 = load i32*, i32** %3
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = icmp sgt i32 %22, 15
br i1 %23, label %24, label %33
24: ; preds = %17, %10
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
%27 = load i32*, i32** %3
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
%31 = load i32, i32* %30
%32 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %26, i32 %31)
br label %33
33: ; preds = %24, %17
br label %34
34: ; preds = %33
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %6
37: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Waga %i towaru (%i kg) odbiega od normy!\0A\00"
define void @wypisz_odbiegajace(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %16
%7 = phi i64 [ 0, %4 ], [ %12, %16 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = add i32 %9, -16
%11 = icmp ult i32 %10, -13
%12 = add nuw nsw i64 %7, 1
br i1 %11, label %13, label %16
13: ; preds = %6
%14 = trunc i64 %12 to i32
%15 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %9)
br label %16
16: ; preds = %6, %13
%17 = icmp eq i64 %12, %5
br i1 %17, label %18, label %6
18: ; preds = %16, %2
ret void
}