#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 /*<<< orphan*/ slabcon(int, int);
int main(void) {
  int target, current, i;
  printf("\n ******************* test pid code ******************\n");
  target = 100;
  printf("\n target  current  returned \n");
  for (current = 88; current < 125; current++)
    printf("%6i%8i%9i\n", target, current, slabcon(target, current));
  printf("\n target  current returned \n");
  for (current = 125; current > 88; current--)
    printf("%6i%8i%9i\n", target, current, slabcon(target, current));
  printf("\n target  current returned \n");
  for (current = 88; current < 125; current++) {
    printf("%6i%8i%9i\n", target, current, slabcon(target, current));
    printf("%6i%8i%9i\n", target, current, slabcon(target, current));
    printf("%6i%8i%9i\n", target, current, slabcon(target, current));
    printf("%6i%8i%9i\n", target, current, slabcon(target, current));
  }
  printf("\n target  current returned \n");
  for (current = 125; current > 88; current--) {
    printf("%6i%8i%9i\n", target, current, slabcon(target, current));
    printf("%6i%8i%9i\n", target, current, slabcon(target, current));
    printf("%6i%8i%9i\n", target, current, slabcon(target, current));
    printf("%6i%8i%9i\n", target, current, slabcon(target, current));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x64,-0x8(%rbp)
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x58,-0xc(%rbp)
cmpl   $0x7d,-0xc(%rbp)
jge    119e <main+0x7e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <slabcon@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <main+0x39>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x7d,-0xc(%rbp)
cmpl   $0x58,-0xc(%rbp)
jle    11f8 <main+0xd8>
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <slabcon@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11b3 <main+0x93>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x58,-0xc(%rbp)
cmpl   $0x7d,-0xc(%rbp)
jge    12d9 <main+0x1b9>
mov    -0x8(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <slabcon@plt>
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    %eax,%ecx
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <slabcon@plt>
mov    -0x38(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    %eax,%ecx
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <slabcon@plt>
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    %eax,%ecx
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <slabcon@plt>
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    %eax,%ecx
lea    0xd92(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    120d <main+0xed>
lea    0xd81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x7d,-0xc(%rbp)
cmpl   $0x58,-0xc(%rbp)
jle    13ba <main+0x29a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <slabcon@plt>
mov    -0x60(%rbp),%esi
mov    -0x5c(%rbp),%edx
mov    %eax,%ecx
lea    0xd38(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <slabcon@plt>
mov    -0x58(%rbp),%esi
mov    -0x54(%rbp),%edx
mov    %eax,%ecx
lea    0xd0b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <slabcon@plt>
mov    -0x50(%rbp),%esi
mov    -0x4c(%rbp),%edx
mov    %eax,%ecx
lea    0xcde(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <slabcon@plt>
mov    -0x48(%rbp),%esi
mov    -0x44(%rbp),%edx
mov    %eax,%ecx
lea    0xcb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    12ee <main+0x1ce>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed0(%rip),%rdi
call   1040 <puts@plt>
lea    0xefb(%rip),%rdi
call   1040 <puts@plt>
mov    $0x58,%ebx
lea    0xea8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
mov    %ebx,%esi
call   1030 <slabcon@plt>
mov    %r14,%rdi
mov    $0x64,%esi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    $0x7d,%ebx
jne    1160 <main+0x30>
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
mov    $0x7e,%ebx
lea    0xe61(%rip),%r14
nop
add    $0xffffffff,%ebx
mov    $0x64,%edi
mov    %ebx,%esi
call   1030 <slabcon@plt>
mov    %r14,%rdi
mov    $0x64,%esi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x59,%ebx
ja     11a0 <main+0x70>
lea    0xe91(%rip),%rdi
call   1040 <puts@plt>
mov    $0x58,%ebx
lea    0xe21(%rip),%r14
nop
mov    $0x64,%edi
mov    %ebx,%esi
call   1030 <slabcon@plt>
mov    %r14,%rdi
mov    $0x64,%esi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x64,%edi
mov    %ebx,%esi
call   1030 <slabcon@plt>
mov    %r14,%rdi
mov    $0x64,%esi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x64,%edi
mov    %ebx,%esi
call   1030 <slabcon@plt>
mov    %r14,%rdi
mov    $0x64,%esi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x64,%edi
mov    %ebx,%esi
call   1030 <slabcon@plt>
mov    %r14,%rdi
mov    $0x64,%esi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    $0x7d,%ebx
jne    11e0 <main+0xb0>
lea    0xdf0(%rip),%rdi
call   1040 <puts@plt>
mov    $0x7e,%ebx
lea    0xd80(%rip),%r14
add    $0xffffffff,%ebx
mov    $0x64,%edi
mov    %ebx,%esi
call   1030 <slabcon@plt>
mov    %r14,%rdi
mov    $0x64,%esi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x64,%edi
mov    %ebx,%esi
call   1030 <slabcon@plt>
mov    %r14,%rdi
mov    $0x64,%esi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x64,%edi
mov    %ebx,%esi
call   1030 <slabcon@plt>
mov    %r14,%rdi
mov    $0x64,%esi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x64,%edi
mov    %ebx,%esi
call   1030 <slabcon@plt>
mov    %r14,%rdi
mov    $0x64,%esi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x59,%ebx
ja     1280 <main+0x150>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [56 x i8] c"\0A ******************* test pid code ******************\0A\00"
@.str.1 = [30 x i8] c"\0A target current returned \0A\00"
@.str.2 = [11 x i8] c"%6i%8i%9i\0A\00"
@.str.3 = [29 x i8] c"\0A target current returned \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
store i32 100, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
store i32 88, i32* %3
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 125
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @slabcon(i32 %13, i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 %12, i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %7
20: ; preds = %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
store i32 125, i32* %3
br label %22
22: ; preds = %32, %20
%23 = load i32, i32* %3
%24 = icmp sgt i32 %23, 88
br i1 %24, label %25, label %35
25: ; preds = %22
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = load i32, i32* %2
%29 = load i32, i32* %3
%30 = call i32 @slabcon(i32 %28, i32 %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %26, i32 %27, i32 %30)
br label %32
32: ; preds = %25
%33 = load i32, i32* %3
%34 = add nsw i32 %33, -1
store i32 %34, i32* %3
br label %22
35: ; preds = %22
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
store i32 88, i32* %3
br label %37
37: ; preds = %65, %35
%38 = load i32, i32* %3
%39 = icmp slt i32 %38, 125
br i1 %39, label %40, label %68
40: ; preds = %37
%41 = load i32, i32* %2
%42 = load i32, i32* %3
%43 = load i32, i32* %2
%44 = load i32, i32* %3
%45 = call i32 @slabcon(i32 %43, i32 %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %41, i32 %42, i32 %45)
%47 = load i32, i32* %2
%48 = load i32, i32* %3
%49 = load i32, i32* %2
%50 = load i32, i32* %3
%51 = call i32 @slabcon(i32 %49, i32 %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %47, i32 %48, i32 %51)
%53 = load i32, i32* %2
%54 = load i32, i32* %3
%55 = load i32, i32* %2
%56 = load i32, i32* %3
%57 = call i32 @slabcon(i32 %55, i32 %56)
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %53, i32 %54, i32 %57)
%59 = load i32, i32* %2
%60 = load i32, i32* %3
%61 = load i32, i32* %2
%62 = load i32, i32* %3
%63 = call i32 @slabcon(i32 %61, i32 %62)
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %59, i32 %60, i32 %63)
br label %65
65: ; preds = %40
%66 = load i32, i32* %3
%67 = add nsw i32 %66, 1
store i32 %67, i32* %3
br label %37
68: ; preds = %37
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
store i32 125, i32* %3
br label %70
70: ; preds = %98, %68
%71 = load i32, i32* %3
%72 = icmp sgt i32 %71, 88
br i1 %72, label %73, label %101
73: ; preds = %70
%74 = load i32, i32* %2
%75 = load i32, i32* %3
%76 = load i32, i32* %2
%77 = load i32, i32* %3
%78 = call i32 @slabcon(i32 %76, i32 %77)
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %74, i32 %75, i32 %78)
%80 = load i32, i32* %2
%81 = load i32, i32* %3
%82 = load i32, i32* %2
%83 = load i32, i32* %3
%84 = call i32 @slabcon(i32 %82, i32 %83)
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %80, i32 %81, i32 %84)
%86 = load i32, i32* %2
%87 = load i32, i32* %3
%88 = load i32, i32* %2
%89 = load i32, i32* %3
%90 = call i32 @slabcon(i32 %88, i32 %89)
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %86, i32 %87, i32 %90)
%92 = load i32, i32* %2
%93 = load i32, i32* %3
%94 = load i32, i32* %2
%95 = load i32, i32* %3
%96 = call i32 @slabcon(i32 %94, i32 %95)
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %92, i32 %93, i32 %96)
br label %98
98: ; preds = %73
%99 = load i32, i32* %3
%100 = add nsw i32 %99, -1
store i32 %100, i32* %3
br label %70
101: ; preds = %70
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [11 x i8] c"%6i%8i%9i\0A\00"
@str = [55 x i8] c"\0A ******************* test pid code ******************\00"
@str.4 = [29 x i8] c"\0A target current returned \00"
@str.7 = [28 x i8] c"\0A target current returned \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.4, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 88, %0 ], [ %7, %3 ]
%5 = tail call i32 @slabcon(i32 100, i32 %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 100, i32 %4, i32 %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 125
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.7, i64 0, i64 0))
br label %11
11: ; preds = %9, %11
%12 = phi i32 [ 125, %9 ], [ %15, %11 ]
%13 = tail call i32 @slabcon(i32 100, i32 %12)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 100, i32 %12, i32 %13)
%15 = add nsw i32 %12, -1
%16 = icmp ugt i32 %12, 89
br i1 %16, label %11, label %17
17: ; preds = %11
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.7, i64 0, i64 0))
br label %19
19: ; preds = %17, %19
%20 = phi i32 [ 88, %17 ], [ %29, %19 ]
%21 = tail call i32 @slabcon(i32 100, i32 %20)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 100, i32 %20, i32 %21)
%23 = tail call i32 @slabcon(i32 100, i32 %20)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 100, i32 %20, i32 %23)
%25 = tail call i32 @slabcon(i32 100, i32 %20)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 100, i32 %20, i32 %25)
%27 = tail call i32 @slabcon(i32 100, i32 %20)
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 100, i32 %20, i32 %27)
%29 = add nuw nsw i32 %20, 1
%30 = icmp eq i32 %29, 125
br i1 %30, label %31, label %19
31: ; preds = %19
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.7, i64 0, i64 0))
br label %33
33: ; preds = %31, %33
%34 = phi i32 [ 125, %31 ], [ %43, %33 ]
%35 = tail call i32 @slabcon(i32 100, i32 %34)
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 100, i32 %34, i32 %35)
%37 = tail call i32 @slabcon(i32 100, i32 %34)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 100, i32 %34, i32 %37)
%39 = tail call i32 @slabcon(i32 100, i32 %34)
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 100, i32 %34, i32 %39)
%41 = tail call i32 @slabcon(i32 100, i32 %34)
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 100, i32 %34, i32 %41)
%43 = add nsw i32 %34, -1
%44 = icmp ugt i32 %34, 89
br i1 %44, label %33, label %45
45: ; preds = %33
ret i32 0
}