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


x86 assembly (clang, -O0):
<printThree>:
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>
movl   $0x0,-0x18(%rbp)
movl   $0x3,-0x14(%rbp)
movq   $0x1,-0x10(%rbp)
cmpl   $0x46,-0x18(%rbp)
jge    1180 <printThree+0x70>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1146 <printThree+0x36>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printThree>:
push   %rbp
push   %r14
push   %rbx
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    $0x46,%ebp
lea    0xebf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%rbx,%rbx,2),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1150 <printThree+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"---now printing 3---\0A\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @printThree(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))
store i32 0, i32* %7
store i32 3, i32* %6
store i64 1, i64* %5
br label %9
9: ; preds = %12, %3
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 70
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 3---\00"
define i32 @printThree(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))
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ 0, %3 ], [ %10, %5 ]
%7 = phi i64 [ 1, %3 ], [ %8, %5 ]
%8 = mul nuw nsw i64 %7, 3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %8)
%10 = add nuw nsw i32 %6, 1
%11 = icmp eq i32 %10, 70
br i1 %11, label %12, label %5
12: ; preds = %5
ret i32 undef
}