#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 EXIT_SUCCESS;
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main(int argc, char *argv[]) {
  int n = 12345678;
  printf("init        %%i  -> %i\n", n);
  printf("init        %%'i -> %'i\n", n);
  setlocale(LC_ALL, "");
  printf("env         %%i  -> %i\n", n);
  printf("env         %%'i -> %'i\n", n);
  setlocale(LC_ALL, "C");
  printf("C           %%i  -> %i\n", n);
  printf("C           %%'i -> %'i\n", n);
  setlocale(LC_ALL, "en_US.UTF-8");
  printf("en_US.UTF-8 %%i  -> %i\n", n);
  printf("en_US.UTF-8 %%'i -> %'i\n", n);
  setlocale(LC_ALL, "fr_FR.UTF-8");
  printf("fr_FR.UTF-8 %%i  -> %i\n", n);
  printf("fr_FR.UTF-8 %%'i -> %'i\n", n);
  setlocale(LC_ALL, "de_DE.UTF-8");
  printf("de_DE.UTF-8 %%i  -> %i\n", n);
  printf("de_DE.UTF-8 %%'i -> %'i\n", n);
  setlocale(LC_ALL, "ja_JP.UTF-8");
  printf("ja_JP.UTF-8 %%i  -> %i\n", n);
  printf("ja_JP.UTF-8 %%'i -> %'i\n", n);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xbc614e,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xf10(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x14(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x14(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e10(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x14(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ddd(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x14(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2daa(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x14(%rbp),%esi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
lea    0xee2(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x14(%rbp),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2d4c(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
mov    0x2e8e(%rip),%rbx
mov    (%rbx),%edi
lea    0xf28(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xed2(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xed5(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
mov    (%rbx),%edi
lea    0xee2(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xee2(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
mov    (%rbx),%edi
lea    0xeef(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xeef(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
mov    (%rbx),%edi
lea    0xefc(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xefc(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
mov    (%rbx),%edi
lea    0xf09(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xf09(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
mov    $0xbc614e,%esi
call   1030 <printf@plt>
mov    0x2d6f(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"init %%i -> %i\0A\00"
@.str.1 = [25 x i8] c"init %%'i -> %'i\0A\00"
@LC_ALL = global i32 0
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [24 x i8] c"env %%i -> %i\0A\00"
@.str.4 = [25 x i8] c"env %%'i -> %'i\0A\00"
@.str.5 = [2 x i8] c"C\00"
@.str.6 = [24 x i8] c"C %%i -> %i\0A\00"
@.str.7 = [25 x i8] c"C %%'i -> %'i\0A\00"
@.str.8 = [12 x i8] c"en_US.UTF-8\00"
@.str.9 = [24 x i8] c"en_US.UTF-8 %%i -> %i\0A\00"
@.str.10 = [25 x i8] c"en_US.UTF-8 %%'i -> %'i\0A\00"
@.str.11 = [12 x i8] c"fr_FR.UTF-8\00"
@.str.12 = [24 x i8] c"fr_FR.UTF-8 %%i -> %i\0A\00"
@.str.13 = [25 x i8] c"fr_FR.UTF-8 %%'i -> %'i\0A\00"
@.str.14 = [12 x i8] c"de_DE.UTF-8\00"
@.str.15 = [24 x i8] c"de_DE.UTF-8 %%i -> %i\0A\00"
@.str.16 = [25 x i8] c"de_DE.UTF-8 %%'i -> %'i\0A\00"
@.str.17 = [12 x i8] c"ja_JP.UTF-8\00"
@.str.18 = [24 x i8] c"ja_JP.UTF-8 %%i -> %i\0A\00"
@.str.19 = [25 x i8] c"ja_JP.UTF-8 %%'i -> %'i\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 12345678, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @LC_ALL
%12 = call i32 @setlocale(i32 %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @LC_ALL
%18 = call i32 @setlocale(i32 %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %6
%22 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %21)
%23 = load i32, i32* @LC_ALL
%24 = call i32 @setlocale(i32 %23, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%25 = load i32, i32* %6
%26 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %6
%28 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i32 %27)
%29 = load i32, i32* @LC_ALL
%30 = call i32 @setlocale(i32 %29, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
%31 = load i32, i32* %6
%32 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %6
%34 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), i32 %33)
%35 = load i32, i32* @LC_ALL
%36 = call i32 @setlocale(i32 %35, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0))
%37 = load i32, i32* %6
%38 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %6
%40 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i64 0, i64 0), i32 %39)
%41 = load i32, i32* @LC_ALL
%42 = call i32 @setlocale(i32 %41, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0))
%43 = load i32, i32* %6
%44 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i64 0, i64 0), i32 %43)
%45 = load i32, i32* %6
%46 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.19, i64 0, i64 0), i32 %45)
%47 = load i32, i32* @EXIT_SUCCESS
ret i32 %47
}

LLVM IR (-O2):
@.str = [24 x i8] c"init %%i -> %i\0A\00"
@.str.1 = [25 x i8] c"init %%'i -> %'i\0A\00"
@LC_ALL = global i32 0
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [24 x i8] c"env %%i -> %i\0A\00"
@.str.4 = [25 x i8] c"env %%'i -> %'i\0A\00"
@.str.5 = [2 x i8] c"C\00"
@.str.6 = [24 x i8] c"C %%i -> %i\0A\00"
@.str.7 = [25 x i8] c"C %%'i -> %'i\0A\00"
@.str.8 = [12 x i8] c"en_US.UTF-8\00"
@.str.9 = [24 x i8] c"en_US.UTF-8 %%i -> %i\0A\00"
@.str.10 = [25 x i8] c"en_US.UTF-8 %%'i -> %'i\0A\00"
@.str.11 = [12 x i8] c"fr_FR.UTF-8\00"
@.str.12 = [24 x i8] c"fr_FR.UTF-8 %%i -> %i\0A\00"
@.str.13 = [25 x i8] c"fr_FR.UTF-8 %%'i -> %'i\0A\00"
@.str.14 = [12 x i8] c"de_DE.UTF-8\00"
@.str.15 = [24 x i8] c"de_DE.UTF-8 %%i -> %i\0A\00"
@.str.16 = [25 x i8] c"de_DE.UTF-8 %%'i -> %'i\0A\00"
@.str.17 = [12 x i8] c"ja_JP.UTF-8\00"
@.str.18 = [24 x i8] c"ja_JP.UTF-8 %%i -> %i\0A\00"
@.str.19 = [25 x i8] c"ja_JP.UTF-8 %%'i -> %'i\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 12345678)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 12345678)
%5 = load i32, i32* @LC_ALL
%6 = tail call i32 @setlocale(i32 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 12345678)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 12345678)
%9 = load i32, i32* @LC_ALL
%10 = tail call i32 @setlocale(i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 12345678)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 12345678)
%13 = load i32, i32* @LC_ALL
%14 = tail call i32 @setlocale(i32 %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%15 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 12345678)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i32 12345678)
%17 = load i32, i32* @LC_ALL
%18 = tail call i32 @setlocale(i32 %17, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
%19 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i32 12345678)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), i32 12345678)
%21 = load i32, i32* @LC_ALL
%22 = tail call i32 @setlocale(i32 %21, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0))
%23 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i32 12345678)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i64 0, i64 0), i32 12345678)
%25 = load i32, i32* @LC_ALL
%26 = tail call i32 @setlocale(i32 %25, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0))
%27 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i64 0, i64 0), i32 12345678)
%28 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.19, i64 0, i64 0), i32 12345678)
%29 = load i32, i32* @EXIT_SUCCESS
ret i32 %29
}