#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*/ regex_t;
typedef int /*<<< orphan*/ r;

/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ regcomp(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ regexec(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main(void) {
  regex_t r;
  memset(&r, 0, sizeof(r));
  setlocale(LC_ALL, "de_DE.UTF-8");
  regcomp(&r, "[-a-z_0-9.]+@[-a-z_0-9.]+", 1 | (1 << 1));
  regexec(&r, "\xe7\xb7\x95\xe7\x97", 0, NULL, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1060 <setlocale@plt>
lea    -0x8(%rbp),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x3,%edx
call   1040 <regcomp@plt>
lea    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
xor    %r8d,%r8d
xor    %eax,%eax
mov    %eax,%ecx
mov    %r8d,%edx
call   1050 <regexec@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1060 <setlocale@plt>
lea    0xe97(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1040 <regcomp@plt>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1050 <regexec@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [12 x i8] c"de_DE.UTF-8\00"
@.str.1 = [26 x i8] c"[-a-z_0-9.]+@[-a-z_0-9.]+\00"
@.str.2 = [6 x i8] c"\E7\B7\95\E7\97\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @memset(i32* %2, i32 0, i32 4)
%4 = load i32, i32* @LC_ALL
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @regcomp(i32* %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 3)
%7 = call i32 @regexec(i32* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 0, i32* null, i32 0)
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [12 x i8] c"de_DE.UTF-8\00"
@.str.1 = [26 x i8] c"[-a-z_0-9.]+@[-a-z_0-9.]+\00"
@.str.2 = [6 x i8] c"\E7\B7\95\E7\97\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @memset(i32* %1, i32 0, i32 4)
%4 = load i32, i32* @LC_ALL
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @regcomp(i32* %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 3)
%7 = call i32 @regexec(i32* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 0, i32* null, i32 0)
ret i32 0
}