#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 */
typedef int uint8_t;

/* Variables and functions */
uint8_t *dilatation_ligne(uint8_t *bloc, uint8_t *out) {
  for (uint8_t i = 0; i < 32; i++) {
    out[i] = bloc[i / 2];
  }
  return out;
}


x86 assembly (clang, -O0):
<dilatation_ligne>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    1155 <dilatation_ligne+0x55>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <dilatation_ligne+0x13>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dilatation_ligne>:
mov    %rsi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rdi,%rcx,2),%edx
mov    %edx,(%rax,%rcx,4)
mov    (%rdi,%rcx,2),%edx
mov    %edx,0x4(%rax,%rcx,4)
mov    0x4(%rdi,%rcx,2),%edx
mov    %edx,0x8(%rax,%rcx,4)
mov    0x4(%rdi,%rcx,2),%edx
mov    %edx,0xc(%rax,%rcx,4)
add    $0x4,%rcx
cmp    $0x20,%rcx
jne    1110 <dilatation_ligne+0x10>
ret

LLVM IR (-O0):
define i32* @dilatation_ligne(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %20, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 32
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32*, i32** %3
%11 = load i32, i32* %5
%12 = sdiv i32 %11, 2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %10, i64 %13
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
%24 = load i32*, i32** %4
ret i32* %24
}

LLVM IR (-O2):
define i32* @dilatation_ligne(i32* nocapture %0, i32* returned writeonly %1) {
br label %4
3: ; preds = %4
ret i32* %1
4: ; preds = %4, %2
%5 = phi i64 [ 0, %2 ], [ %25, %4 ]
%6 = lshr exact i64 %5, 1
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %1, i64 %5
store i32 %8, i32* %9
%10 = or i64 %5, 1
%11 = lshr exact i64 %5, 1
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %1, i64 %10
store i32 %13, i32* %14
%15 = or i64 %5, 2
%16 = lshr exact i64 %15, 1
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
%19 = getelementptr inbounds i32, i32* %1, i64 %15
store i32 %18, i32* %19
%20 = or i64 %5, 3
%21 = lshr exact i64 %15, 1
%22 = getelementptr inbounds i32, i32* %0, i64 %21
%23 = load i32, i32* %22
%24 = getelementptr inbounds i32, i32* %1, i64 %20
store i32 %23, i32* %24
%25 = add nuw nsw i64 %5, 4
%26 = icmp eq i64 %25, 32
br i1 %26, label %3, label %4
}