#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 */
char *malloc(int);
int /*<<< orphan*/ memset(char *, float, int);
void FF_trick(char *list[]) {
  for (int k = 0; k < 4; k++) {
    list[k] = malloc(3);
    memset(list[k], 'F', 2);
    list[k][2] = '\0';
  }
}


x86 assembly (clang, -O0):
<FF_trick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1192 <FF_trick+0x72>
mov    $0x3,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movss  0xe96(%rip),%xmm0
mov    $0x2,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movb   $0x0,0x2(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <FF_trick+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FF_trick>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3,%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
movss  0xec7(%rip),%xmm0
mov    %rax,%rdi
mov    $0x2,%esi
call   1030 <memset@plt>
mov    (%rbx),%rax
movb   $0x0,0x2(%rax)
mov    $0x3,%edi
call   1040 <malloc@plt>
mov    %rax,0x8(%rbx)
mov    %rax,%rdi
movss  0xe9a(%rip),%xmm0
mov    $0x2,%esi
call   1030 <memset@plt>
mov    0x8(%rbx),%rax
movb   $0x0,0x2(%rax)
mov    $0x3,%edi
call   1040 <malloc@plt>
mov    %rax,0x10(%rbx)
mov    %rax,%rdi
movss  0xe6f(%rip),%xmm0
mov    $0x2,%esi
call   1030 <memset@plt>
mov    0x10(%rbx),%rax
movb   $0x0,0x2(%rax)
mov    $0x3,%edi
call   1040 <malloc@plt>
mov    %rax,0x18(%rbx)
mov    %rax,%rdi
movss  0xe44(%rip),%xmm0
mov    $0x2,%esi
call   1030 <memset@plt>
mov    0x18(%rbx),%rax
movb   $0x0,0x2(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @FF_trick(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %25, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %28
7: ; preds = %4
%8 = call i8* @malloc(i32 3)
%9 = load i8**, i8*** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8*, i8** %9, i64 %11
store i8* %8, i8** %12
%13 = load i8**, i8*** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @memset(i8* %17, float 7.000000e+01, i32 2)
%19 = load i8**, i8*** %2
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 2
store i8 0, i8* %24
br label %25
25: ; preds = %7
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %4
28: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @FF_trick(i8** nocapture %0) {
%2 = tail call dereferenceable_or_null(3) i8* @malloc(i32 3)
store i8* %2, i8** %0
%3 = tail call i32 @memset(i8* %2, float 7.000000e+01, i32 2)
%4 = load i8*, i8** %0
%5 = getelementptr inbounds i8, i8* %4, i64 2
store i8 0, i8* %5
%6 = tail call dereferenceable_or_null(3) i8* @malloc(i32 3)
%7 = getelementptr inbounds i8*, i8** %0, i64 1
store i8* %6, i8** %7
%8 = tail call i32 @memset(i8* %6, float 7.000000e+01, i32 2)
%9 = load i8*, i8** %7
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8 0, i8* %10
%11 = tail call dereferenceable_or_null(3) i8* @malloc(i32 3)
%12 = getelementptr inbounds i8*, i8** %0, i64 2
store i8* %11, i8** %12
%13 = tail call i32 @memset(i8* %11, float 7.000000e+01, i32 2)
%14 = load i8*, i8** %12
%15 = getelementptr inbounds i8, i8* %14, i64 2
store i8 0, i8* %15
%16 = tail call dereferenceable_or_null(3) i8* @malloc(i32 3)
%17 = getelementptr inbounds i8*, i8** %0, i64 3
store i8* %16, i8** %17
%18 = tail call i32 @memset(i8* %16, float 7.000000e+01, i32 2)
%19 = load i8*, i8** %17
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 0, i8* %20
ret void
}