#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 strlen(char *);
void geralinha(char s[]) {
  int larg = strlen(s) + 11;
  int i;
  printf("          =");
  for (i = 0; i < larg; i++)
    printf("=");
  printf("=\n");
}


x86 assembly (clang, -O0):
<geralinha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0xb,%eax
mov    %eax,-0xc(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1174 <geralinha+0x54>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <geralinha+0x2e>
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geralinha>:
push   %rbp
push   %rbx
push   %rax
call   1050 <strlen@plt>
mov    %eax,%ebx
lea    0xeaf(%rip),%rdi
call   1060 <printf@plt>
cmp    $0xfffffff6,%ebx
jl     117f <geralinha+0x3f>
add    $0xa,%ebx
xor    %ebp,%ebp
test   %ebx,%ebx
cmovg  %ebx,%ebp
add    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x3d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1170 <geralinha+0x30>
lea    0xe84(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c" =\00"
@str = [2 x i8] c"=\00"
define void @geralinha(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %2, -11
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = add i32 %2, 10
%7 = call i32 @llvm.smax.i32(i32 %6, i32 0)
br label %8
8: ; preds = %5, %8
%9 = phi i32 [ %11, %8 ], [ 0, %5 ]
%10 = tail call i32 @putchar(i32 61)
%11 = add nuw i32 %9, 1
%12 = icmp eq i32 %9, %7
br i1 %12, label %13, label %8
13: ; preds = %8, %1
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}