#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 /*<<< orphan*/ test;

/* Variables and functions */
int EXIT_SUCCESS;
int digit_multiple(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int test[] = {128, 12, 120, 122, 13, 32, 22, 42, 212, 213, 162, 204};
  int length = sizeof(test) / sizeof(test[0]);
  for (int i = 0; i < length; ++i) {
    printf("%5d -> %d\n", test[i], digit_multiple(test[i]));
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
movl   $0xc,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    11a5 <main+0x75>
movslq -0x48(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x4c(%rbp)
movslq -0x48(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edi
call   1050 <digit_multiple@plt>
mov    -0x4c(%rbp),%esi
mov    %eax,%edx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1162 <main+0x32>
mov    0x2e34(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x80,%edi
call   1040 <digit_multiple@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0xc,%edi
call   1040 <digit_multiple@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x78,%edi
call   1040 <digit_multiple@plt>
mov    %rbx,%rdi
mov    $0x78,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x7a,%edi
call   1040 <digit_multiple@plt>
mov    %rbx,%rdi
mov    $0x7a,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0xd,%edi
call   1040 <digit_multiple@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x20,%edi
call   1040 <digit_multiple@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x16,%edi
call   1040 <digit_multiple@plt>
mov    %rbx,%rdi
mov    $0x16,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x2a,%edi
call   1040 <digit_multiple@plt>
mov    %rbx,%rdi
mov    $0x2a,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0xd4,%edi
call   1040 <digit_multiple@plt>
mov    %rbx,%rdi
mov    $0xd4,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0xd5,%edi
call   1040 <digit_multiple@plt>
mov    %rbx,%rdi
mov    $0xd5,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0xa2,%edi
call   1040 <digit_multiple@plt>
mov    %rbx,%rdi
mov    $0xa2,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0xcc,%edi
call   1040 <digit_multiple@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    0x2d85(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.test = [12 x i32] [i32 128, i32 12, i32 120, i32 122, i32 13, i32 32, i32 22, i32 42, i32 212, i32 213, i32 162, i32 204]
@.str = [11 x i8] c"%5d -> %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [12 x i32]* %2 to i8*
store i32 12, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %21, %0
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = call i32 @digit_multiple(i32 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %19)
br label %21
21: ; preds = %10
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %6
24: ; preds = %6
%25 = load i32, i32* @EXIT_SUCCESS
ret i32 %25
}

LLVM IR (-O2):
@.str = [11 x i8] c"%5d -> %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @digit_multiple(i32 128)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 128, i32 %1)
%3 = tail call i32 @digit_multiple(i32 12)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 12, i32 %3)
%5 = tail call i32 @digit_multiple(i32 120)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 120, i32 %5)
%7 = tail call i32 @digit_multiple(i32 122)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 122, i32 %7)
%9 = tail call i32 @digit_multiple(i32 13)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 13, i32 %9)
%11 = tail call i32 @digit_multiple(i32 32)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 32, i32 %11)
%13 = tail call i32 @digit_multiple(i32 22)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 22, i32 %13)
%15 = tail call i32 @digit_multiple(i32 42)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 42, i32 %15)
%17 = tail call i32 @digit_multiple(i32 212)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 212, i32 %17)
%19 = tail call i32 @digit_multiple(i32 213)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 213, i32 %19)
%21 = tail call i32 @digit_multiple(i32 162)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 162, i32 %21)
%23 = tail call i32 @digit_multiple(i32 204)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 204, i32 %23)
%25 = load i32, i32* @EXIT_SUCCESS
ret i32 %25
}