#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 *, ...);
void wyswietl_wspolczynnik(int a, int first) {
  if (a != 0) {
    if (a == -1) {
      printf("-");
    } else if (a != 1) {
      if ((first == 0) && (a > 0))
        printf("+ ");
      printf("%d", a);
    } else if ((first == 0) && (a == 1)) {
      printf("+ ");
    }
  }
}


x86 assembly (clang, -O0):
<wyswietl_wspolczynnik>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11b8 <wyswietl_wspolczynnik+0xa8>
cmpl   $0xffffffff,-0x4(%rbp)
jne    1145 <wyswietl_wspolczynnik+0x35>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b3 <wyswietl_wspolczynnik+0xa3>
cmpl   $0x1,-0x4(%rbp)
je     1187 <wyswietl_wspolczynnik+0x77>
cmpl   $0x0,-0x8(%rbp)
jne    1171 <wyswietl_wspolczynnik+0x61>
cmpl   $0x0,-0x4(%rbp)
jle    1171 <wyswietl_wspolczynnik+0x61>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ae <wyswietl_wspolczynnik+0x9e>
cmpl   $0x0,-0x8(%rbp)
jne    11a9 <wyswietl_wspolczynnik+0x99>
cmpl   $0x1,-0x4(%rbp)
jne    11a9 <wyswietl_wspolczynnik+0x99>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ae <wyswietl_wspolczynnik+0x9e>
jmp    11b3 <wyswietl_wspolczynnik+0xa3>
jmp    11b8 <wyswietl_wspolczynnik+0xa8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wyswietl_wspolczynnik>:
push   %rbx
cmp    $0x1,%edi
je     113c <wyswietl_wspolczynnik+0x1c>
mov    %edi,%ebx
test   %edi,%edi
je     1140 <wyswietl_wspolczynnik+0x20>
cmp    $0xffffffff,%ebx
jne    1142 <wyswietl_wspolczynnik+0x22>
mov    $0x2d,%edi
pop    %rbx
jmp    1030 <putchar@plt>
test   %esi,%esi
je     1169 <wyswietl_wspolczynnik+0x49>
pop    %rbx
ret
test   %ebx,%ebx
jle    1158 <wyswietl_wspolczynnik+0x38>
test   %esi,%esi
jne    1158 <wyswietl_wspolczynnik+0x38>
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
lea    0xe90(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [3 x i8] c"+ \00"
@.str.2 = [3 x i8] c"%d\00"
define void @wyswietl_wspolczynnik(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %37
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %36
12: ; preds = %7
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 1
br i1 %14, label %15, label %26
15: ; preds = %12
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %18, %15
%24 = load i32, i32* %3
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %24)
br label %35
26: ; preds = %12
%27 = load i32, i32* %4
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = load i32, i32* %3
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %32, %29, %26
br label %35
35: ; preds = %34, %23
br label %36
36: ; preds = %35, %10
br label %37
37: ; preds = %36, %2
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"+ \00"
@.str.2 = [3 x i8] c"%d\00"
define void @wyswietl_wspolczynnik(i32 %0, i32 %1) {
switch i32 %0, label %5 [
i32 0, label %17
i32 -1, label %3
i32 1, label %13
]
3: ; preds = %2
%4 = tail call i32 @putchar(i32 45)
br label %17
5: ; preds = %2
%6 = icmp eq i32 %1, 0
%7 = icmp sgt i32 %0, 0
%8 = and i1 %7, %6
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %5
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %17
13: ; preds = %2
%14 = icmp eq i32 %1, 0
br i1 %14, label %15, label %17
15: ; preds = %13
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %2, %3, %13, %15, %11
ret void
}