#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 procure(int x) {
  int opo = 200;
  for (int i = 0; i < 10; i++) {
    printf("--%d\n", i);
    if (x == i) {
      opo = 1;
      return opo;
    }
  }
  return opo;
}


x86 assembly (clang, -O0):
<procure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0xc8,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1173 <procure+0x63>
mov    -0x10(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1160 <procure+0x50>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1179 <procure+0x69>
jmp    1165 <procure+0x55>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1129 <procure+0x19>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procure>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xee4(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
test   %ebp,%ebp
je     1213 <procure+0x103>
lea    0xece(%rip),%rdi
mov    $0x1,%ebx
mov    $0x1,%esi
call   1030 <printf@plt>
cmp    $0x1,%ebp
je     1218 <procure+0x108>
lea    0xeaf(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
cmp    $0x2,%ebp
je     1218 <procure+0x108>
lea    0xe95(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
cmp    $0x3,%ebp
je     1218 <procure+0x108>
lea    0xe7b(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
cmp    $0x4,%ebp
je     1218 <procure+0x108>
lea    0xe61(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
cmp    $0x5,%ebp
je     1218 <procure+0x108>
lea    0xe4b(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
cmp    $0x6,%ebp
je     1218 <procure+0x108>
lea    0xe35(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
cmp    $0x7,%ebp
je     1218 <procure+0x108>
lea    0xe1f(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
cmp    $0x8,%ebp
je     1218 <procure+0x108>
lea    0xe09(%rip),%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
cmp    $0x9,%ebp
mov    $0x1,%eax
mov    $0xc8,%ebx
cmove  %eax,%ebx
jmp    1218 <procure+0x108>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"--%d\0A\00"
define i32 @procure(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = icmp eq i32 %0, 0
br i1 %3, label %32, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = icmp eq i32 %0, 1
br i1 %6, label %32, label %7
7: ; preds = %4
%8 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 2)
%9 = icmp eq i32 %0, 2
br i1 %9, label %32, label %10
10: ; preds = %7
%11 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 3)
%12 = icmp eq i32 %0, 3
br i1 %12, label %32, label %13
13: ; preds = %10
%14 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 4)
%15 = icmp eq i32 %0, 4
br i1 %15, label %32, label %16
16: ; preds = %13
%17 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%18 = icmp eq i32 %0, 5
br i1 %18, label %32, label %19
19: ; preds = %16
%20 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 6)
%21 = icmp eq i32 %0, 6
br i1 %21, label %32, label %22
22: ; preds = %19
%23 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 7)
%24 = icmp eq i32 %0, 7
br i1 %24, label %32, label %25
25: ; preds = %22
%26 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 8)
%27 = icmp eq i32 %0, 8
br i1 %27, label %32, label %28
28: ; preds = %25
%29 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 9)
%30 = icmp eq i32 %0, 9
%31 = select i1 %30, i32 1, i32 200
br label %32
32: ; preds = %28, %25, %22, %19, %16, %13, %10, %7, %4, %1
%33 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 1, %7 ], [ 1, %10 ], [ 1, %13 ], [ 1, %16 ], [ 1, %19 ], [ 1, %22 ], [ 1, %25 ], [ %31, %28 ]
ret i32 %33
}