#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 printTwo(long long res, int mult, int control) {
  printf("---now printing 2---\n");
  while (control < 64) {
    res = res * mult;
    printf("%ld\n", res);
    control++;
  }
}


x86 assembly (clang, -O0):
<printTwo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x40,-0x18(%rbp)
jge    116a <printTwo+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1130 <printTwo+0x20>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTwo>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x3f,%ebp
jg     1165 <printTwo+0x45>
movslq %r14d,%r15
add    $0xffffffc0,%ebp
lea    0xeb3(%rip),%r14
nopl   (%rax)
imul   %r15,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
inc    %ebp
jne    1150 <printTwo+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%ld\0A\00"
@str = [21 x i8] c"---now printing 2---\00"
define i32 @printTwo(i64 %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%5 = icmp slt i32 %2, 64
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ %2, %6 ], [ %13, %8 ]
%10 = phi i64 [ %0, %6 ], [ %11, %8 ]
%11 = mul nsw i64 %10, %7
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %11)
%13 = add i32 %9, 1
%14 = icmp eq i32 %13, 64
br i1 %14, label %15, label %8
15: ; preds = %8, %3
ret i32 undef
}