#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 pcmconvert(int, int);
int /*<<< orphan*/ printf(char *, ...);
void print_pos_neg(int min, int max) {
  int attn;
  printf("PCM pos and neg\r\n");
  for (attn = min; attn <= max; attn++) {
    printf("%i: %i %i\r\n", attn, pcmconvert(attn, 0), pcmconvert(attn, 1));
  }
  printf("\r\n");
}


x86 assembly (clang, -O0):
<print_pos_neg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1192 <print_pos_neg+0x72>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1030 <pcmconvert@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1030 <pcmconvert@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <print_pos_neg+0x22>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_pos_neg>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %edi,%ebp
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
cmp    %r15d,%ebp
jg     118f <print_pos_neg+0x5f>
add    $0x1,%r15d
lea    0xea8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
xor    %esi,%esi
call   1040 <pcmconvert@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    $0x1,%esi
call   1040 <pcmconvert@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%r15d
jne    1160 <print_pos_neg+0x30>
lea    0xe85(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"PCM pos and neg\0D\0A\00"
@.str.1 = [12 x i8] c"%i: %i %i\0D\0A\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
define void @print_pos_neg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
store i32 %7, i32* %5
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32, i32* %5
%15 = call i32 @pcmconvert(i32 %14, i32 0)
%16 = load i32, i32* %5
%17 = call i32 @pcmconvert(i32 %16, i32 1)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %15, i32 %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %8
22: ; preds = %8
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"%i: %i %i\0D\0A\00"
@str = [17 x i8] c"PCM pos and neg\0D\00"
@str.3 = [2 x i8] c"\0D\00"
define void @print_pos_neg(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %0, %1
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ %0, %2 ]
%7 = tail call i32 @pcmconvert(i32 %6, i32 0)
%8 = tail call i32 @pcmconvert(i32 %6, i32 1)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
%10 = add i32 %6, 1
%11 = icmp eq i32 %6, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
ret void
}