#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 the_function(int x, int y) {
  int i;
  printf("Start of the_function\n");
  for (i = 0; i < x; i++) {
    y *= 5;
    y--;
  }
  printf("End of the_function\n");
  return y;
}


x86 assembly (clang, -O0):
<the_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <the_function+0x4b>
imul   $0x5,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <the_function+0x21>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<the_function>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
test   %r14d,%r14d
jle    116b <the_function+0x5b>
lea    -0x1(%r14),%ecx
mov    %r14d,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jb     1152 <the_function+0x42>
and    $0xfffffff8,%r14d
nopl   (%rax)
imul   $0x5f5e1,%ebx,%ebx
add    $0xfffe8288,%ebx
add    $0xfffffff8,%r14d
jne    1140 <the_function+0x30>
test   %eax,%eax
je     116b <the_function+0x5b>
cs nopw 0x0(%rax,%rax,1)
lea    (%rbx,%rbx,4),%ebx
add    $0xffffffff,%ebx
add    $0xffffffff,%eax
jne    1160 <the_function+0x50>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Start of the_function\0A\00"
@.str.1 = [21 x i8] c"End of the_function\0A\00"
define i32 @the_function(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 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %16, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load i32, i32* %4
%13 = mul nsw i32 %12, 5
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = add nsw i32 %14, -1
store i32 %15, i32* %4
br label %16
16: ; preds = %11
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %7
19: ; preds = %7
%20 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
@str = [22 x i8] c"Start of the_function\00"
@str.2 = [20 x i8] c"End of the_function\00"
define i32 @the_function(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %29
5: ; preds = %2
%6 = add i32 %0, -1
%7 = and i32 %0, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %18, label %9
9: ; preds = %5
%10 = and i32 %0, -8
br label %11
11: ; preds = %11, %9
%12 = phi i32 [ %1, %9 ], [ %15, %11 ]
%13 = phi i32 [ 0, %9 ], [ %16, %11 ]
%14 = mul i32 %12, 390625
%15 = add i32 %14, -97656
%16 = add i32 %13, 8
%17 = icmp eq i32 %16, %10
br i1 %17, label %18, label %11
18: ; preds = %11, %5
%19 = phi i32 [ undef, %5 ], [ %15, %11 ]
%20 = phi i32 [ %1, %5 ], [ %15, %11 ]
%21 = icmp eq i32 %7, 0
br i1 %21, label %29, label %22
22: ; preds = %18, %22
%23 = phi i32 [ %26, %22 ], [ %20, %18 ]
%24 = phi i32 [ %27, %22 ], [ 0, %18 ]
%25 = mul nsw i32 %23, 5
%26 = add nsw i32 %25, -1
%27 = add i32 %24, 1
%28 = icmp eq i32 %27, %7
br i1 %28, label %29, label %22
29: ; preds = %18, %22, %2
%30 = phi i32 [ %1, %2 ], [ %19, %18 ], [ %26, %22 ]
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
ret i32 %30
}