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


x86 assembly (clang, -O0):
<printSeven>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x3,-0xc(%rbp)
movq   $0x1,-0x8(%rbp)
cmpl   $0x46,-0x10(%rbp)
jge    1180 <printSeven+0x70>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <printSeven+0x36>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSeven>:
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 <printSeven+0x30>
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%ld\0A\00"
@str = [20 x i8] c"---now printing 7--\00"
@str.3 = [3 x i8] c"\0A\0A\00"
define i32 @printSeven(i64 %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}