xunge/DecIR huggingface dataset:
int strfind(const char *str, char ch) {
  int i;
  for (i = 0; *str != '\0'; i++, str++) {
    if (*str == ch) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<strfind>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <strfind+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1143 <strfind+0x43>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <strfind+0x69>
jmp    1148 <strfind+0x48>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1115 <strfind+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strfind>:
mov    (%rdi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <strfind+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,%dl
je     1123 <strfind+0x23>
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strfind+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strfind(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 0, i32* %6
br label %7
7: ; preds = %22, %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %27
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i8, i8* %5
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %15, %17
br i1 %18, label %19, label %21
19: ; preds = %12
%20 = load i32, i32* %6
store i32 %20, i32* %3
br label %28
21: ; preds = %12
br label %22
22: ; preds = %21
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %4
br label %7
27: ; preds = %7
store i32 -1, i32* %3
br label %28
28: ; preds = %27, %19
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @strfind(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %13, %10 ], [ %3, %2 ]
%7 = phi i32 [ %11, %10 ], [ 0, %2 ]
%8 = phi i8* [ %12, %10 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = add nuw nsw i32 %7, 1
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %10, %2
%16 = phi i32 [ -1, %2 ], [ -1, %10 ], [ %7, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printErr(char const *);
int /*<<< orphan*/ sendPADT();
void fatal(char const *str) {
  printErr(str);
  sendPADT();
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printErr@plt>
mov    $0x0,%al
call   1040 <sendPADT@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1030 <printErr@plt>
xor    %eax,%eax
call   1040 <sendPADT@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printErr(i8* %3)
%5 = call i32 (...) @sendPADT()
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @fatal(i8* %0) {
%2 = tail call i32 @printErr(i8* %0)
%3 = tail call i32 (...) @sendPADT()
%4 = tail call i32 @exit(i32 1)
unreachable
}
int isEmpty(struct Node *root) { return !root; }


x86 assembly (clang, -O0):
<isEmpty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEmpty>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.Node = type opaque
define i32 @isEmpty(%struct.Node* %0) {
%2 = alloca %struct.Node*
store %struct.Node* %0, %struct.Node** %2
%3 = load %struct.Node*, %struct.Node** %2
%4 = icmp ne %struct.Node* %3, null
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.Node = type opaque
define i32 @isEmpty(%struct.Node* readnone %0) {
%2 = icmp eq %struct.Node* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
void test_builtin_cargf(_Complex float f) {
  if (__builtin_cargf(f) != __builtin_cargf(f))
    link_failure_builtin_cargf();
}


x86 assembly (clang, -O0):
<test_builtin_cargf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movlpd %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  %xmm1,-0x10(%rbp)
movss  %xmm0,-0xc(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <cargf@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x14(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <cargf@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jne    118a <test_builtin_cargf+0x6a>
jp     118a <test_builtin_cargf+0x6a>
jmp    1191 <test_builtin_cargf+0x71>
mov    $0x0,%al
call   1040 <link_failure_builtin_cargf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_cargf>:
sub    $0x28,%rsp
movaps %xmm0,0x10(%rsp)
call   1030 <cargf@plt>
movss  %xmm0,0xc(%rsp)
movaps 0x10(%rsp),%xmm0
call   1030 <cargf@plt>
movss  0xc(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jne    114b <test_builtin_cargf+0x2b>
jnp    1156 <test_builtin_cargf+0x36>
xor    %eax,%eax
add    $0x28,%rsp
jmp    1040 <link_failure_builtin_cargf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @test_builtin_cargf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %5
%6 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%7 = load float, float* %6
%8 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%9 = load float, float* %8
%10 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%11 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %7, float* %10
store float %9, float* %11
%12 = bitcast { float, float }* %3 to <2 x float>*
%13 = load <2 x float>, <2 x float>* %12
%14 = call float @cargf(<2 x float> %13)
%15 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%16 = load float, float* %15
%17 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%18 = load float, float* %17
%19 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%20 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
store float %16, float* %19
store float %18, float* %20
%21 = bitcast { float, float }* %4 to <2 x float>*
%22 = load <2 x float>, <2 x float>* %21
%23 = call float @cargf(<2 x float> %22)
%24 = fcmp une float %14, %23
br i1 %24, label %25, label %27
25: ; preds = %1
%26 = call i32 (...) @link_failure_builtin_cargf()
br label %27
27: ; preds = %25, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_cargf(<2 x float> %0) {
%2 = tail call float @cargf(<2 x float> %0)
%3 = tail call float @cargf(<2 x float> %0)
%4 = fcmp une float %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_cargf()
br label %7
7: ; preds = %5, %1
ret void
}
void d(int i) {}


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
ret

LLVM IR (-O0):
define void @d(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @d(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int dlna_get_audio_profile_atrac3plus(int channels, int bitrate, char *profile,
                                      char *mimeType) {
  strcpy(mimeType, "audio/x-sony-oma");
  strcpy(profile, "ATRAC3plus");
  return 0;
}


x86 assembly (clang, -O0):
<dlna_get_audio_profile_atrac3plus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xecf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xed0(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlna_get_audio_profile_atrac3plus>:
push   %rbx
mov    %rdx,%rbx
lea    0xee5(%rip),%rsi
mov    %rcx,%rdi
call   1030 <strcpy@plt>
lea    0xee7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"audio/x-sony-oma\00"
@.str.1 = [11 x i8] c"ATRAC3plus\00"
define i32 @dlna_get_audio_profile_atrac3plus(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %7
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"audio/x-sony-oma\00"
@.str.1 = [11 x i8] c"ATRAC3plus\00"
define i32 @dlna_get_audio_profile_atrac3plus(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ttloop();
int telnet_spin() {
  ttloop();
  return (0);
}


x86 assembly (clang, -O0):
<telnet_spin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ttloop@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<telnet_spin>:
push   %rax
xor    %eax,%eax
call   1030 <ttloop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @telnet_spin() {
%1 = call i32 (...) @ttloop()
ret i32 0
}

LLVM IR (-O2):
define i32 @telnet_spin() {
%1 = tail call i32 (...) @ttloop()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long getfilesize(FILE *fp) {
  fseek(fp, 0L, SEEK_END);
  return ftell(fp);
}


x86 assembly (clang, -O0):
<getfilesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfilesize>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ftell@plt>

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @getfilesize(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_END
%5 = call i32 @fseek(i32* %3, i64 0, i32 %4)
%6 = load i32*, i32** %2
%7 = call i64 @ftell(i32* %6)
ret i64 %7
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @getfilesize(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
ret i64 %4
}
int get_upnp_uuid(void *data) { return 0; }


x86 assembly (clang, -O0):
<get_upnp_uuid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_upnp_uuid>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_upnp_uuid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @get_upnp_uuid(i8* nocapture readnone %0) {
ret i32 0
}
__attribute__((no, noclone)) int f2(signed char x, signed char y) {
  return (x + y) & -4;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
and    $0xfffffffc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
lea    (%rdi,%rsi,1),%eax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @f2(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = add nsw i32 %6, %8
%10 = and i32 %9, -4
ret i32 %10
}

LLVM IR (-O2):
define i32 @f2(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = add nsw i32 %4, %3
%6 = and i32 %5, -4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(void) {
  printf("VectFS Manager %s by uno20001\n"
         "options:\n"
         "\t-h : shows this message\n"
         "\t-d <filename> : sets working disk\n"
         "\t-a <f1> [<f2> ... <fn>] : adds files to the current disk\n"
         "\t-e <f1> [<f2> ... <fn>] : erases files from the current disk\n"
         "\t-i [<f1> <f2> ... <fn>] : shows info about the current disk [or "
         "specified disks]\n"
         "\t-l [<f1> <f2> ... <fn>] : lists files on the current disk [or on "
         "specified disks]\n"
         "\t-f [<f1> <f2> ... <fn>] : defrags the current disk [or the "
         "specified disks]\n"
         "Parameters between '[' and ']' are optional!\n",
         "0.2 Alpha");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0x10d9(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
lea    0x10dd(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [507 x i8] c"VectFS Manager %s by uno20001\0Aoptions:\0A\09-h : shows this message\0A\09-d <filename> : sets working disk\0A\09-a <f1> [<f2> ... <fn>] : adds files to the current disk\0A\09-e <f1> [<f2> ... <fn>] : erases files from the current disk\0A\09-i [<f1> <f2> ... <fn>] : shows info about the current disk [or specified disks]\0A\09-l [<f1> <f2> ... <fn>] : lists files on the current disk [or on specified disks]\0A\09-f [<f1> <f2> ... <fn>] : defrags the current disk [or the specified disks]\0AParameters between '[' and ']' are optional!\0A\00"
@.str.1 = [10 x i8] c"0.2 Alpha\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([507 x i8], [507 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [507 x i8] c"VectFS Manager %s by uno20001\0Aoptions:\0A\09-h : shows this message\0A\09-d <filename> : sets working disk\0A\09-a <f1> [<f2> ... <fn>] : adds files to the current disk\0A\09-e <f1> [<f2> ... <fn>] : erases files from the current disk\0A\09-i [<f1> <f2> ... <fn>] : shows info about the current disk [or specified disks]\0A\09-l [<f1> <f2> ... <fn>] : lists files on the current disk [or on specified disks]\0A\09-f [<f1> <f2> ... <fn>] : defrags the current disk [or the specified disks]\0AParameters between '[' and ']' are optional!\0A\00"
@.str.1 = [10 x i8] c"0.2 Alpha\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([507 x i8], [507 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll38(struct __test_metadata *);
void wrapper_epoll38(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll38(_metadata);
}


x86 assembly (clang, -O0):
<wrapper_epoll38>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <epoll38@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapper_epoll38>:
jmp    1030 <epoll38@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll38(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll38(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll38(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll38(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ POSHrunCommand(char *);
int /*<<< orphan*/ clearEnv(char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv, char **envp) {
  if (argc != 2) {
    fprintf(stderr, "Usage: clearenv command\n");
    exit(1);
  }
  clearEnv(envp);
  POSHrunCommand(argv[1]);
  return 0;
}


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)
mov    %rdx,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1183 <main+0x43>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1030 <clearEnv@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <POSHrunCommand@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    115e <main+0x1e>
mov    %rsi,%rbx
mov    %rdx,%rdi
call   1030 <clearEnv@plt>
mov    0x8(%rbx),%rdi
call   1050 <POSHrunCommand@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: clearenv command\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %3
%15 = load i8**, i8*** %7
%16 = call i32 @clearEnv(i8** %15)
%17 = load i8**, i8*** %6
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @POSHrunCommand(i8* %19)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: clearenv command\0A\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** %2) {
%4 = icmp eq i32 %0, 2
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
%10 = tail call i32 @clearEnv(i8** %2)
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @POSHrunCommand(i8* %12)
ret i32 0
}
int main(void) {
  int var;
  while (var < 10) {
    ++var;
    continue;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1123 <main+0x23>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110b <main+0xb>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int leaps_thru_end_of_nonneg(int const);
int __attribute__((__pure__)) leaps_thru_end_of(const int y) {
  return (y < 0 ? -1 - leaps_thru_end_of_nonneg(-1 - y)
                : leaps_thru_end_of_nonneg(y));
}


x86 assembly (clang, -O0):
<leaps_thru_end_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1143 <leaps_thru_end_of+0x33>
mov    $0xffffffff,%edi
sub    -0x4(%rbp),%edi
call   1030 <leaps_thru_end_of_nonneg@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <leaps_thru_end_of+0x3e>
mov    -0x4(%rbp),%edi
call   1030 <leaps_thru_end_of_nonneg@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leaps_thru_end_of>:
test   %edi,%edi
js     1119 <leaps_thru_end_of+0x9>
jmp    1030 <leaps_thru_end_of_nonneg@plt>
push   %rax
not    %edi
call   1030 <leaps_thru_end_of_nonneg@plt>
not    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @leaps_thru_end_of(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 -1, %6
%8 = call i32 @leaps_thru_end_of_nonneg(i32 %7)
%9 = sub nsw i32 -1, %8
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 @leaps_thru_end_of_nonneg(i32 %11)
br label %13
13: ; preds = %10, %5
%14 = phi i32 [ %9, %5 ], [ %12, %10 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @leaps_thru_end_of(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = xor i32 %0, -1
%5 = tail call i32 @leaps_thru_end_of_nonneg(i32 %4)
%6 = xor i32 %5, -1
br label %9
7: ; preds = %1
%8 = tail call i32 @leaps_thru_end_of_nonneg(i32 %0)
br label %9
9: ; preds = %7, %3
%10 = phi i32 [ %6, %3 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x20_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x20_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x20_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x20_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x20_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void errorFileName(void) {
  error("Invalid or too long file name or path name\n");
}


x86 assembly (clang, -O0):
<errorFileName>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorFileName>:
lea    0xee9(%rip),%rdi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Invalid or too long file name or path name\0A\00"
define void @errorFileName() {
%1 = call i32 @error(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"Invalid or too long file name or path name\0A\00"
define void @errorFileName() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit_with_error(char *);
int /*<<< orphan*/ free(char *);
void ensure_alloc(char *str) {
  if (str == NULL) {
    free(str);
    exit_with_error("Allocation failure!");
  }
}


x86 assembly (clang, -O0):
<ensure_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114c <ensure_alloc+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
lea    0xeb9(%rip),%rdi
call   1040 <exit_with_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensure_alloc>:
test   %rdi,%rdi
je     1126 <ensure_alloc+0x6>
ret
push   %rax
xor    %edi,%edi
call   1030 <free@plt>
lea    0xecb(%rip),%rdi
pop    %rax
jmp    1040 <exit_with_error@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Allocation failure!\00"
define void @ensure_alloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
%8 = call i32 @exit_with_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Allocation failure!\00"
define void @ensure_alloc(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @free(i8* null)
%5 = tail call i32 @exit_with_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %1
ret void
}
int clad_slre_isblank(int c) { return (c == ' ') || (c == '\t'); }


x86 assembly (clang, -O0):
<clad_slre_isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <clad_slre_isblank+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_slre_isblank>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @clad_slre_isblank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @clad_slre_isblank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
const char *string_null(void) { return NULL; }


x86 assembly (clang, -O0):
<string_null>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_null>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @string_null() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @string_null() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_RST(int /*<<< orphan*/);
void do0xC7() { _I8080_RST(0); }


x86 assembly (clang, -O0):
<do0xC7>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <_I8080_RST@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do0xC7>:
xor    %edi,%edi
jmp    1030 <_I8080_RST@plt>

LLVM IR (-O0):
define void @do0xC7() {
%1 = call i32 @_I8080_RST(i32 0)
ret void
}

LLVM IR (-O2):
define void @do0xC7() {
%1 = tail call i32 @_I8080_RST(i32 0)
ret void
}
void SteamAPI_ISteamHTMLSurface_KeyDown(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamHTMLSurface_KeyDown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamHTMLSurface_KeyDown>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_KeyDown = [35 x i8] c"SteamAPI_ISteamHTMLSurface_KeyDown\00"
define void @SteamAPI_ISteamHTMLSurface_KeyDown(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_KeyDown, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_KeyDown = [35 x i8] c"SteamAPI_ISteamHTMLSurface_KeyDown\00"
define void @SteamAPI_ISteamHTMLSurface_KeyDown(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_KeyDown, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t max(uint32_t a, uint32_t b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ check(float);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
scalar_t__ validate(float);
int main(int argc, char const *argv[]) {
  float a;
  scanf("%f", &a);
  validate(a) ? check(a) : printf("SEM RESPOSTA");
  return 0;
}


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)
lea    0xea3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x14(%rbp),%xmm0
call   1040 <validate@plt>
cmp    $0x0,%rax
je     1189 <main+0x49>
movss  -0x14(%rbp),%xmm0
call   1060 <check@plt>
jmp    1195 <main+0x55>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1040 <validate@plt>
test   %rax,%rax
je     116f <main+0x2f>
movss  0x4(%rsp),%xmm0
call   1060 <check@plt>
jmp    117b <main+0x3b>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [13 x i8] c"SEM RESPOSTA\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %6)
%8 = load float, float* %6
%9 = call i64 @validate(float %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load float, float* %6
%13 = call i32 @check(float %12)
br label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %11
%17 = phi i32 [ %13, %11 ], [ %15, %14 ]
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [13 x i8] c"SEM RESPOSTA\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%6 = load float, float* %3
%7 = call i64 @validate(float %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load float, float* %3
%11 = call i32 @check(float %10)
br label %14
12: ; preds = %2
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
ret i32 0
}
unsigned long int
unsignedlongint_ignoring_unsignedlonglongint(unsigned long int x,
                                             unsigned long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedlongint_ignoring_unsignedlonglongint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedlongint_ignoring_unsignedlonglongint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlongint_ignoring_unsignedlonglongint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlongint_ignoring_unsignedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
int test_imm_59uint32_reg(unsigned int val) {
  return ((val) & (0x59 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_59uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x59,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_59uint32_reg>:
test   $0x59,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_59uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 89
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_59uint32_reg(i32 %0) {
%2 = and i32 %0, 89
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int execute_madvise1() { return 0; }


x86 assembly (clang, -O0):
<execute_madvise1>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_madvise1>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @execute_madvise1() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_madvise1() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void ComparatorRefSet(unsigned long ulBase, unsigned long ulRef) {
  DEBUG_ASSERT(ulBase == 0x4003C000);
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = ulRef;
}


x86 assembly (clang, -O0):
<ComparatorRefSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x4003c000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorRefSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x4003c000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,0x10(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ComparatorRefSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1073987584
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = load i64, i64* %3
%11 = add i64 %10, 16
%12 = inttoptr i64 %11 to i64*
store volatile i64 %9, i64* %12
ret void
}

LLVM IR (-O2):
define void @ComparatorRefSet(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1073987584
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 16
%7 = inttoptr i64 %6 to i64*
store volatile i64 %1, i64* %7
ret void
}
int fourTo(int n) { return 1 << (2 * n); }


x86 assembly (clang, -O0):
<fourTo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fourTo>:
lea    (%rdi,%rdi,1),%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @fourTo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = shl i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @fourTo(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = shl nuw i32 1, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __gcov_flush();
int /*<<< orphan*/ bar(int);
int main(int argc, char *argv[]) {
  bar(5);
  __gcov_flush();
  bar(5);
  bar(5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1030 <bar@plt>
mov    $0x0,%al
call   1040 <__gcov_flush@plt>
mov    $0x5,%edi
call   1030 <bar@plt>
mov    $0x5,%edi
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <bar@plt>
xor    %eax,%eax
call   1040 <__gcov_flush@plt>
mov    $0x5,%edi
call   1030 <bar@plt>
mov    $0x5,%edi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @bar(i32 5)
%7 = call i32 (...) @__gcov_flush()
%8 = call i32 @bar(i32 5)
%9 = call i32 @bar(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @bar(i32 5)
%4 = tail call i32 (...) @__gcov_flush()
%5 = tail call i32 @bar(i32 5)
%6 = tail call i32 @bar(i32 5)
ret i32 0
}
int eol(char p) { return (p == '\r' || p == '\n' || p == '\0'); }


x86 assembly (clang, -O0):
<eol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     113b <eol+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     113b <eol+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eol>:
mov    $0x1,%eax
cmp    $0xa,%dil
je     1111 <eol+0x11>
cmp    $0xd,%dil
jne    1112 <eol+0x12>
ret
xor    %eax,%eax
test   %dil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @eol(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 13
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 10
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @eol(i8 signext %0) {
switch i8 %0, label %2 [
i8 13, label %5
i8 10, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 0
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
struct sembuf {
  int sem_op;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int semop(int, struct sembuf *, int);
int ipc_sem_free(int semid, struct sembuf *sb) {
  sb->sem_op = 1;
  if (semop(semid, sb, 1) == -1) {
    perror("semop");
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<ipc_sem_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1040 <semop@plt>
cmp    $0xffffffff,%eax
jne    1179 <ipc_sem_free+0x49>
lea    0xe96(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipc_sem_free>:
push   %rax
movl   $0x1,(%rsi)
mov    $0x1,%edx
call   1040 <semop@plt>
cmp    $0xffffffff,%eax
je     114a <ipc_sem_free+0x1a>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeaf(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.sembuf = type { i32 }
@.str = [6 x i8] c"semop\00"
define i32 @ipc_sem_free(i32 %0, %struct.sembuf* %1) {
%3 = alloca i32
%4 = alloca %struct.sembuf*
store i32 %0, i32* %3
store %struct.sembuf* %1, %struct.sembuf** %4
%5 = load %struct.sembuf*, %struct.sembuf** %4
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
store i32 1, i32* %6
%7 = load i32, i32* %3
%8 = load %struct.sembuf*, %struct.sembuf** %4
%9 = call i32 @semop(i32 %7, %struct.sembuf* %8, i32 1)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
%struct.sembuf = type { i32 }
@.str = [6 x i8] c"semop\00"
define i32 @ipc_sem_free(i32 %0, %struct.sembuf* %1) {
%3 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %1, i64 0, i32 0
store i32 1, i32* %3
%4 = tail call i32 @semop(i32 %0, %struct.sembuf* %1, i32 1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void IntPrint(const void *a) { printf("%s", (char *)a); }


x86 assembly (clang, -O0):
<IntPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntPrint>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @IntPrint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @IntPrint(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *portable_malloc(size_t size) { return malloc(size); }


x86 assembly (clang, -O0):
<portable_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portable_malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @portable_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @portable_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t reorder64(uint64_t n) {
  return ((n & 0xff) << 56) | ((n & 0xff00) << 40) | ((n & 0xff0000) << 24) |
         ((n & 0xff000000LL) << 8) | ((n & 0xff00000000LL) >> 8) |
         ((n & 0xff0000000000LL) >> 24) | ((n & 0xff000000000000LL) >> 40) |
         ((n & 0xff00000000000000LL) >> 56);
}


x86 assembly (clang, -O0):
<reorder64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
and    $0xff00,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
cltq
movslq -0x4(%rbp),%rcx
movabs $0xff000000,%rdx
and    %rdx,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff00000000,%rdx
and    %rdx,%rcx
sar    $0x8,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff0000000000,%rdx
and    %rdx,%rcx
sar    $0x18,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff000000000000,%rdx
and    %rdx,%rcx
sar    $0x28,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff00000000000000,%rdx
and    %rdx,%rcx
shr    $0x38,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reorder64>:
ret

LLVM IR (-O0):
define i32 @reorder64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 56
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 40
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = shl i32 %11, 24
%13 = or i32 %9, %12
%14 = sext i32 %13 to i64
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = and i64 %16, 4278190080
%18 = shl i64 %17, 8
%19 = or i64 %14, %18
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = and i64 %21, 1095216660480
%23 = ashr i64 %22, 8
%24 = or i64 %19, %23
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = and i64 %26, 280375465082880
%28 = ashr i64 %27, 24
%29 = or i64 %24, %28
%30 = load i32, i32* %2
%31 = sext i32 %30 to i64
%32 = and i64 %31, 71776119061217280
%33 = ashr i64 %32, 40
%34 = or i64 %29, %33
%35 = load i32, i32* %2
%36 = sext i32 %35 to i64
%37 = and i64 %36, -72057594037927936
%38 = lshr i64 %37, 56
%39 = or i64 %34, %38
%40 = trunc i64 %39 to i32
ret i32 %40
}

LLVM IR (-O2):
define i32 @reorder64(i32 %0) {
ret i32 poison
}