#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 *, ...);
void sequence() {
  for (int i = 1, result = 0; i < 11; i++) {
    result += 5 * i;
    printf("%i", result);
    if (i != 10)
      printf(",");
  }
}


x86 assembly (clang, -O0):
<sequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xb,-0x4(%rbp)
jge    1176 <sequence+0x66>
imul   $0x5,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xa,-0x4(%rbp)
je     1163 <sequence+0x53>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1168 <sequence+0x58>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <sequence+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequence>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x32,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x4b,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x69,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x8c,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0xb4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0xe1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x113,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @sequence() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 @putchar(i32 44)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 15)
%4 = tail call i32 @putchar(i32 44)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 30)
%6 = tail call i32 @putchar(i32 44)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 50)
%8 = tail call i32 @putchar(i32 44)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 75)
%10 = tail call i32 @putchar(i32 44)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 105)
%12 = tail call i32 @putchar(i32 44)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 140)
%14 = tail call i32 @putchar(i32 44)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 180)
%16 = tail call i32 @putchar(i32 44)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 225)
%18 = tail call i32 @putchar(i32 44)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 275)
ret void
}