xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ slog(int /*<<< orphan*/, int, char *, ...);
void err_exit(char *message) {
  slog(0, 5, "%s", message);
  slog(0, 2, "The reason can be wrong username and/or password");
  slog(0, 2, "Also make sure magtifun.ge is not down");
}


x86 assembly (clang, -O0):
<err_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %edi,%edi
mov    $0x5,%esi
lea    0xed2(%rip),%rdx
mov    $0x0,%al
call   1030 <slog@plt>
xor    %edi,%edi
mov    $0x2,%esi
lea    0xec0(%rip),%rdx
mov    $0x0,%al
call   1030 <slog@plt>
xor    %edi,%edi
mov    $0x2,%esi
lea    0xedc(%rip),%rdx
mov    $0x0,%al
call   1030 <slog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_exit>:
push   %rax
mov    %rdi,%rcx
lea    0xee5(%rip),%rdx
xor    %edi,%edi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <slog@plt>
lea    0xed3(%rip),%rdx
xor    %edi,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <slog@plt>
lea    0xeef(%rip),%rdx
xor    %edi,%edi
mov    $0x2,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <slog@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [49 x i8] c"The reason can be wrong username and/or password\00"
@.str.2 = [39 x i8] c"Also make sure magtifun.ge is not down\00"
define void @err_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i32, i32, i8*, ...) @slog(i32 0, i32 5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i32, i32, i8*, ...) @slog(i32 0, i32 2, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i32, i32, i8*, ...) @slog(i32 0, i32 2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [49 x i8] c"The reason can be wrong username and/or password\00"
@.str.2 = [39 x i8] c"Also make sure magtifun.ge is not down\00"
define void @err_exit(i8* %0) {
%2 = tail call i32 (i32, i32, i8*, ...) @slog(i32 0, i32 5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i32, i32, i8*, ...) @slog(i32 0, i32 2, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i32, i32, i8*, ...) @slog(i32 0, i32 2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Fortran2cstring(char *, char *, int, int);
int PAPI_remove_named_event(int, char *);
void papif_remove_named_event_(int *EventSet, char *EventName, int *check,
                               int Event_len) {
  char tmp[128];
  Fortran2cstring(tmp, EventName, 128, Event_len);
  *check = PAPI_remove_named_event(*EventSet, tmp);
}


x86 assembly (clang, -O0):
<papif_remove_named_event_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%ecx
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    -0xa0(%rbp),%rsi
call   1030 <PAPI_remove_named_event@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_remove_named_event_>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
call   1030 <PAPI_remove_named_event@plt>
mov    %eax,(%r14)
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @papif_remove_named_event_(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [128 x i8]
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %6
%12 = load i32, i32* %8
%13 = call i32 @Fortran2cstring(i8* %10, i8* %11, i32 128, i32 %12)
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%17 = call i32 @PAPI_remove_named_event(i32 %15, i8* %16)
%18 = load i32*, i32** %7
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @papif_remove_named_event_(i32* nocapture %0, i8* %1, i32* nocapture writeonly %2, i32 %3) {
%5 = alloca [128 x i8]
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = call i32 @Fortran2cstring(i8* %6, i8* %1, i32 128, i32 %3)
%8 = load i32, i32* %0
%9 = call i32 @PAPI_remove_named_event(i32 %8, i8* %6)
store i32 %9, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help(void) {
  fprintf(stderr,
          " ---------------------------------------------------------------\n"
          " Help for input plugin..: "
          "FILE input plugin"
          "\n"
          " ---------------------------------------------------------------\n"
          " The following parameters can be passed to this plugin:\n\n"
          " [-d | --delay ]........: delay to pause between frames\n"
          " [-f | --folder ].......: folder to watch for new JPEG files\n"
          " [-r | --remove ].......: remove/delete JPEG file after reading\n"
          " [-n | --name ].........: ignore changes unless filename matches\n"
          " ---------------------------------------------------------------\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [543 x i8] c" ---------------------------------------------------------------\0A Help for input plugin..: FILE input plugin\0A ---------------------------------------------------------------\0A The following parameters can be passed to this plugin:\0A\0A [-d | --delay ]........: delay to pause between frames\0A [-f | --folder ].......: folder to watch for new JPEG files\0A [-r | --remove ].......: remove/delete JPEG file after reading\0A [-n | --name ].........: ignore changes unless filename matches\0A ---------------------------------------------------------------\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([543 x i8], [543 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [543 x i8] c" ---------------------------------------------------------------\0A Help for input plugin..: FILE input plugin\0A ---------------------------------------------------------------\0A The following parameters can be passed to this plugin:\0A\0A [-d | --delay ]........: delay to pause between frames\0A [-f | --folder ].......: folder to watch for new JPEG files\0A [-r | --remove ].......: remove/delete JPEG file after reading\0A [-n | --name ].........: ignore changes unless filename matches\0A ---------------------------------------------------------------\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([543 x i8], [543 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ libb_func();
int main() {
  libb_func();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @libb_func()
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ _mm_max_epu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_max_epu8(__m128i A, __m128i B) { return _mm_max_epu8(A, B); }


x86 assembly (clang, -O0):
<test_mm_max_epu8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_max_epu8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_max_epu8>:
jmp    1030 <_mm_max_epu8@plt>

LLVM IR (-O0):
define i32 @test_mm_max_epu8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_max_epu8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_max_epu8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_max_epu8(i32 %0, i32 %1)
ret i32 %3
}
void XcmsQueryColor() {}


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

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

LLVM IR (-O0):
define void @XcmsQueryColor() {
ret void
}

LLVM IR (-O2):
define void @XcmsQueryColor() {
ret void
}
int input_map_abegin(char c) {
  if (c >= '0' && c <= '7')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<input_map_abegin>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <input_map_abegin+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x37,%eax
jg     1130 <input_map_abegin+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <input_map_abegin+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_map_abegin>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @input_map_abegin(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 55
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @input_map_abegin(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
long long int mdc(long long int a, long long int b) {
  while (b > 0) {
    long long int r = a % b;
    a = b;
    b = r;
  }
  return a;
}


x86 assembly (clang, -O0):
<mdc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    113a <mdc+0x3a>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    110c <mdc+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdc>:
mov    %rdi,%rax
test   %rsi,%rsi
jle    1135 <mdc+0x35>
mov    %rsi,%rdx
jmp    111d <mdc+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
jle    1132 <mdc+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <mdc+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <mdc+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @mdc(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = srem i64 %5, %6
%8 = icmp sgt i64 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %6, %4 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ dhead();
int /*<<< orphan*/ jputs(char *);
void dheadp(void) {
  dhead();
  jputs("   ");
}


x86 assembly (clang, -O0):
<dheadp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <dhead@plt>
lea    0xece(%rip),%rdi
call   1030 <jputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dheadp>:
push   %rax
xor    %eax,%eax
call   1040 <dhead@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <jputs@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" \00"
define void @dheadp() {
%1 = call i32 (...) @dhead()
%2 = call i32 @jputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
define void @dheadp() {
%1 = tail call i32 (...) @dhead()
%2 = tail call i32 @jputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *__cvt(double, int, int *, int *, int, int);
char *fcvt(double value, int ndigit, int *__restrict decpt,
           int *__restrict sign) {
  return (__cvt(value, ndigit, decpt, sign, 1, 1));
}


x86 assembly (clang, -O0):
<fcvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1030 <__cvt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcvt>:
mov    $0x1,%ecx
mov    $0x1,%r8d
jmp    1030 <__cvt@plt>

LLVM IR (-O0):
define i8* @fcvt(double %0, i32 %1, i32* noalias %2, i32* noalias %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store double %0, double* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load double, double* %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i8* @__cvt(double %9, i32 %10, i32* %11, i32* %12, i32 1, i32 1)
ret i8* %13
}

LLVM IR (-O2):
define i8* @fcvt(double %0, i32 %1, i32* noalias %2, i32* noalias %3) {
%5 = tail call i8* @__cvt(double %0, i32 %1, i32* %2, i32* %3, i32 1, i32 1)
ret i8* %5
}
void implied6502() {}


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

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

LLVM IR (-O0):
define void @implied6502() {
ret void
}

LLVM IR (-O2):
define void @implied6502() {
ret void
}
double cog_math_max(double x, double y) {
  if (x > y) {
    return x;
  } else {
    return y;
  }
}


x86 assembly (clang, -O0):
<cog_math_max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <cog_math_max+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <cog_math_max+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cog_math_max>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cog_math_max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @cog_math_max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double fminl(long double x, long double y) {
  return __infer_nondet_long_double();
}


x86 assembly (clang, -O0):
<fminl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fminl>:
xor    %eax,%eax
jmp    1030 <__infer_nondet_long_double@plt>

LLVM IR (-O0):
define x86_fp80 @fminl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @fminl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ dup2(int, int /*<<< orphan*/);
int /*<<< orphan*/ execvpe(char const *, char *const *, char *const *);
scalar_t__ fork();
int parExec(const char *file, int out, char *const argv[], char *const envp[]) {
  if (fork() == 0) {
    dup2(out, STDOUT_FILENO);
    execvpe(file, argv, envp);
  }
  return 0;
}


x86 assembly (clang, -O0):
<parExec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%rax
jne    117a <parExec+0x4a>
mov    -0xc(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
call   1030 <dup2@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <execvpe@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parExec>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
jne    116c <parExec+0x3c>
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
call   1030 <dup2@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <execvpe@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define i32 @parExec(i8* %0, i32 %1, i8** %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8**
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%9 = call i64 (...) @fork()
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %4
%12 = load i32, i32* %6
%13 = load i32, i32* @STDOUT_FILENO
%14 = call i32 @dup2(i32 %12, i32 %13)
%15 = load i8*, i8** %5
%16 = load i8**, i8*** %7
%17 = load i8**, i8*** %8
%18 = call i32 @execvpe(i8* %15, i8** %16, i8** %17)
br label %19
19: ; preds = %11, %4
ret i32 0
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define i32 @parExec(i8* %0, i32 %1, i8** %2, i8** %3) {
%5 = tail call i64 (...) @fork()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* @STDOUT_FILENO
%9 = tail call i32 @dup2(i32 %1, i32 %8)
%10 = tail call i32 @execvpe(i8* %0, i8** %2, i8** %3)
br label %11
11: ; preds = %7, %4
ret i32 0
}
void g_signal_connect_object() {}


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

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

LLVM IR (-O0):
define void @g_signal_connect_object() {
ret void
}

LLVM IR (-O2):
define void @g_signal_connect_object() {
ret void
}
int test_imm_68uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x68 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_68uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x68,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_68uint64_midword_mem>:
testb  $0x68,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_68uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6815744
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: test_swipe $target $victim\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Usage: test_swipe $target $victim\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [34 x i8] c"Usage: test_swipe $target $victim\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
int test_imm_FDint8_reg(signed char val) {
  return ((val) & (-0xFD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FDint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff03,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FDint8_reg>:
test   $0xffffff03,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FDint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -253
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float max(float a, float b, float c) {
  float max;
  if (a < b)
    max = b;
  else
    max = a;
  if (max < c)
    return c;
  else
    return max;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <max+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    113f <max+0x3f>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1161 <max+0x61>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116b <max+0x6b>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxss  %xmm0,%xmm1
maxss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @max(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%9 = load float, float* %5
%10 = load float, float* %6
%11 = fcmp olt float %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load float, float* %6
store float %13, float* %8
br label %16
14: ; preds = %3
%15 = load float, float* %5
store float %15, float* %8
br label %16
16: ; preds = %14, %12
%17 = load float, float* %8
%18 = load float, float* %7
%19 = fcmp olt float %17, %18
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = load float, float* %7
store float %21, float* %4
br label %24
22: ; preds = %16
%23 = load float, float* %8
store float %23, float* %4
br label %24
24: ; preds = %22, %20
%25 = load float, float* %4
ret float %25
}

LLVM IR (-O2):
define float @max(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = select i1 %4, float %1, float %0
%6 = fcmp olt float %5, %2
%7 = select i1 %6, float %2, float %5
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XNVCTRLSetTargetAttribute(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/, int,
                                             unsigned int, unsigned int, int);
void XNVCTRLSetAttribute(Display *dpy, int screen, unsigned int display_mask,
                         unsigned int attribute, int value) {
  XNVCTRLSetTargetAttribute(dpy, 0, screen, display_mask, attribute, value);
}


x86 assembly (clang, -O0):
<XNVCTRLSetAttribute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
xor    %esi,%esi
call   1030 <XNVCTRLSetTargetAttribute@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XNVCTRLSetAttribute>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <XNVCTRLSetTargetAttribute@plt>

LLVM IR (-O0):
define void @XNVCTRLSetAttribute(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @XNVCTRLSetTargetAttribute(i32* %11, i32 0, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @XNVCTRLSetAttribute(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @XNVCTRLSetTargetAttribute(i32* %0, i32 0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ V3DMPGetAttributes(void *, int /*<<< orphan*/,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *, int *);
int V3DMPGetTotal(void *p) {
  int total = 0;
  V3DMPGetAttributes(p, 0, NULL, NULL, NULL, &total);
  return (total);
}


x86 assembly (clang, -O0):
<V3DMPGetTotal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%r8d
lea    -0xc(%rbp),%r9
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <V3DMPGetAttributes@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V3DMPGetTotal>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%r9
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <V3DMPGetAttributes@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @V3DMPGetTotal(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 @V3DMPGetAttributes(i8* %4, i32 0, i32* null, i32* null, i32* null, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @V3DMPGetTotal(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @V3DMPGetAttributes(i8* %0, i32 0, i32* null, i32* null, i32* null, i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
int scanf_hack(char *fmt, int *v) {
  static int next = 2;
  *v = next;
  next = 34;
}


x86 assembly (clang, -O0):
<scanf_hack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2f0e(%rip),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x22,0x2efe(%rip)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanf_hack>:
movzbl 0x2f1d(%rip),%eax
shl    $0x5,%eax
or     $0x2,%eax
mov    %eax,(%rsi)
movb   $0x1,0x2f0e(%rip)
ret

LLVM IR (-O0):
@scanf_hack.next = internal global i32 2
define i32 @scanf_hack(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
%6 = load i32, i32* @scanf_hack.next
%7 = load i32*, i32** %5
store i32 %6, i32* %7
store i32 34, i32* @scanf_hack.next
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@scanf_hack.next = internal unnamed_addr global i1 false
define i32 @scanf_hack(i8* nocapture readnone %0, i32* nocapture writeonly %1) {
%3 = load i1, i1* @scanf_hack.next
%4 = select i1 %3, i32 34, i32 2
store i32 %4, i32* %1
store i1 true, i1* @scanf_hack.next
ret i32 undef
}
/* Variables and functions */
unsigned int memcmp(unsigned char *, unsigned char *, unsigned int);
unsigned int _ZNSt11char_traitsIcE7compareEPKcS2_j(unsigned char *llvm_cbe___s1,
                                                   unsigned char *llvm_cbe___s2,
                                                   unsigned int llvm_cbe___n) {
  unsigned char *llvm_cbe_tmp__127;
  unsigned char *llvm_cbe_tmp__128;
  unsigned int llvm_cbe_tmp__129;
  unsigned char *llvm_cbe_tmp__130;
  unsigned char *llvm_cbe_tmp__131;
  unsigned int llvm_cbe_tmp__132;
  unsigned int llvm_cbe_tmp__133;
  *(&llvm_cbe_tmp__127) = llvm_cbe___s1;
  *(&llvm_cbe_tmp__128) = llvm_cbe___s2;
  *(&llvm_cbe_tmp__129) = llvm_cbe___n;
  llvm_cbe_tmp__130 = *(&llvm_cbe_tmp__127);
  llvm_cbe_tmp__131 = *(&llvm_cbe_tmp__128);
  llvm_cbe_tmp__132 = *(&llvm_cbe_tmp__129);
  llvm_cbe_tmp__133 =
      memcmp(llvm_cbe_tmp__130, llvm_cbe_tmp__131, llvm_cbe_tmp__132);
  return llvm_cbe_tmp__133;
}


x86 assembly (clang, -O0):
<_ZNSt11char_traitsIcE7compareEPKcS2_j>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x44(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ZNSt11char_traitsIcE7compareEPKcS2_j>:
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
define i32 @_ZNSt11char_traitsIcE7compareEPKcS2_j(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%14 = load i8*, i8** %4
store i8* %14, i8** %7
%15 = load i8*, i8** %5
store i8* %15, i8** %8
%16 = load i32, i32* %6
store i32 %16, i32* %9
%17 = load i8*, i8** %7
store i8* %17, i8** %10
%18 = load i8*, i8** %8
store i8* %18, i8** %11
%19 = load i32, i32* %9
store i32 %19, i32* %12
%20 = load i8*, i8** %10
%21 = load i8*, i8** %11
%22 = load i32, i32* %12
%23 = call i32 @memcmp(i8* %20, i8* %21, i32 %22)
store i32 %23, i32* %13
%24 = load i32, i32* %13
ret i32 %24
}

LLVM IR (-O2):
define i32 @_ZNSt11char_traitsIcE7compareEPKcS2_j(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
int zicheng(int x, int n) {
  int i;
  for (i = 1; i <= n; i++) {
    x *= x;
  }
  return x;
}


x86 assembly (clang, -O0):
<zicheng>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1135 <zicheng+0x35>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <zicheng+0x11>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zicheng>:
mov    %edi,%eax
test   %esi,%esi
jle    1158 <zicheng+0x58>
lea    -0x1(%rsi),%edx
mov    %esi,%ecx
and    $0x7,%ecx
cmp    $0x7,%edx
jb     113d <zicheng+0x3d>
and    $0xfffffff8,%esi
cs nopw 0x0(%rax,%rax,1)
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
add    $0xfffffff8,%esi
jne    1120 <zicheng+0x20>
test   %ecx,%ecx
je     1158 <zicheng+0x58>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %eax,%eax
add    $0xffffffff,%ecx
jne    1150 <zicheng+0x50>
ret

LLVM IR (-O0):
define i32 @zicheng(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 1, i32* %5
br label %6
6: ; preds = %14, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, %11
store i32 %13, i32* %3
br label %14
14: ; preds = %10
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @zicheng(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %33, label %4
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i32 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi i32 [ %0, %8 ], [ %20, %10 ]
%12 = phi i32 [ 0, %8 ], [ %21, %10 ]
%13 = mul nsw i32 %11, %11
%14 = mul nsw i32 %13, %13
%15 = mul nsw i32 %14, %14
%16 = mul nsw i32 %15, %15
%17 = mul nsw i32 %16, %16
%18 = mul nsw i32 %17, %17
%19 = mul nsw i32 %18, %18
%20 = mul nsw i32 %19, %19
%21 = add i32 %12, 8
%22 = icmp eq i32 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi i32 [ undef, %4 ], [ %20, %10 ]
%25 = phi i32 [ %0, %4 ], [ %20, %10 ]
%26 = icmp eq i32 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i32 [ %30, %27 ], [ %25, %23 ]
%29 = phi i32 [ %31, %27 ], [ 0, %23 ]
%30 = mul nsw i32 %28, %28
%31 = add i32 %29, 1
%32 = icmp eq i32 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi i32 [ %0, %2 ], [ %24, %23 ], [ %30, %27 ]
ret i32 %34
}
exit_here(status) int status;
{ exit(abs(status)); }


x86 assembly (clang, -O0):
<exit_here>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_here>:
push   %rax
mov    %edi,%eax
neg    %eax
cmovns %eax,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @exit_here(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @abs(i32 %3)
unreachable
}

LLVM IR (-O2):
define i32 @exit_here(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
tail call void @exit(i32 %2)
unreachable
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int set_dobldobl_state_to_verbose(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(660, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<set_dobldobl_state_to_verbose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x294,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_dobldobl_state_to_verbose>:
mov    $0x294,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @set_dobldobl_state_to_verbose() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 660, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @set_dobldobl_state_to_verbose() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 660, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void caller_1_2_1_1_1_1_2() {}


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

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

LLVM IR (-O0):
define void @caller_1_2_1_1_1_1_2() {
ret void
}

LLVM IR (-O2):
define void @caller_1_2_1_1_1_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_uuid(unsigned char *);
int /*<<< orphan*/ uuid2str(unsigned char *, char *);
void get_uuid(char uuidstr[(16 * 2 + 4)]) {
  unsigned char uuid[16];
  create_uuid(uuid);
  uuid2str(uuid, uuidstr);
}


x86 assembly (clang, -O0):
<get_uuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <create_uuid@plt>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <uuid2str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uuid>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <create_uuid@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <uuid2str@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @get_uuid(i8* %0) {
%2 = alloca i8*
%3 = alloca [16 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @create_uuid(i8* %4)
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @uuid2str(i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
define void @get_uuid(i8* %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @create_uuid(i8* %3)
%5 = call i32 @uuid2str(i8* %3, i8* %0)
ret void
}
int Values(char c) {
  int n = 0;
  switch (c) {
  case 'I':
    n = 1;
    break;
  case 'V':
    n = 5;
    break;
  case 'X':
    n = 10;
    break;
  case 'L':
    n = 50;
    break;
  case 'C':
    n = 100;
    break;
  case '\0':
    n = 0;
    break;
  }
  return n;
}


x86 assembly (clang, -O0):
<Values>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     11b6 <Values+0xb6>
jmp    1125 <Values+0x25>
mov    -0xc(%rbp),%eax
sub    $0x43,%eax
je     11aa <Values+0xaa>
jmp    1136 <Values+0x36>
mov    -0xc(%rbp),%eax
sub    $0x49,%eax
je     117a <Values+0x7a>
jmp    1147 <Values+0x47>
mov    -0xc(%rbp),%eax
sub    $0x4c,%eax
je     119e <Values+0x9e>
jmp    1158 <Values+0x58>
mov    -0xc(%rbp),%eax
sub    $0x56,%eax
je     1186 <Values+0x86>
jmp    1169 <Values+0x69>
mov    -0xc(%rbp),%eax
sub    $0x58,%eax
je     1192 <Values+0x92>
jmp    11bd <Values+0xbd>
movl   $0x1,-0x8(%rbp)
jmp    11bd <Values+0xbd>
movl   $0x5,-0x8(%rbp)
jmp    11bd <Values+0xbd>
movl   $0xa,-0x8(%rbp)
jmp    11bd <Values+0xbd>
movl   $0x32,-0x8(%rbp)
jmp    11bd <Values+0xbd>
movl   $0x64,-0x8(%rbp)
jmp    11bd <Values+0xbd>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Values>:
xor    %eax,%eax
add    $0xffffffbd,%edi
cmp    $0x15,%edi
ja     111f <Values+0x1f>
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x64,%eax
ret
mov    $0x1,%eax
ret
mov    $0x32,%eax
ret
mov    $0x5,%eax
ret
mov    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @Values(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 73, label %6
i32 86, label %7
i32 88, label %8
i32 76, label %9
i32 67, label %10
i32 0, label %11
]
6: ; preds = %1
store i32 1, i32* %3
br label %12
7: ; preds = %1
store i32 5, i32* %3
br label %12
8: ; preds = %1
store i32 10, i32* %3
br label %12
9: ; preds = %1
store i32 50, i32* %3
br label %12
10: ; preds = %1
store i32 100, i32* %3
br label %12
11: ; preds = %1
store i32 0, i32* %3
br label %12
12: ; preds = %1, %11, %10, %9, %8, %7, %6
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @Values(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %8 [
i32 73, label %3
i32 86, label %4
i32 88, label %5
i32 76, label %6
i32 67, label %7
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3
%9 = phi i32 [ 100, %7 ], [ 50, %6 ], [ 10, %5 ], [ 5, %4 ], [ 1, %3 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int UINT8_MAX;
uint8_t rotl8(uint8_t x, int n) {
  return ((x << n) | (x >> (8 - n))) & UINT8_MAX;
}


x86 assembly (clang, -O0):
<rotl8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    0x2eb6(%rip),%rcx
and    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl8>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    $0x8,%dl
sub    %cl,%dl
mov    %edx,%ecx
sar    %cl,%edi
or     %edi,%eax
mov    0x2ec9(%rip),%rcx
and    (%rcx),%eax
ret

LLVM IR (-O0):
@UINT8_MAX = global i32 0
define i32 @rotl8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 8, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
%13 = load i32, i32* @UINT8_MAX
%14 = and i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
@UINT8_MAX = global i32 0
define i32 @rotl8(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 8, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
%7 = load i32, i32* @UINT8_MAX
%8 = and i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ writeBit(int);
void writeByte(int hexNum) {
  int i;
  for (i = 0; i < 8; i++) {
    writeBit(hexNum & 0x01);
    hexNum >>= 1;
  }
}


x86 assembly (clang, -O0):
<writeByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    114e <writeByte+0x3e>
mov    -0x4(%rbp),%edi
and    $0x1,%edi
call   1030 <writeBit@plt>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <writeByte+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeByte>:
push   %rbx
mov    %edi,%ebx
and    $0x1,%edi
call   1030 <writeBit@plt>
mov    %ebx,%edi
shr    %edi
and    $0x1,%edi
call   1030 <writeBit@plt>
mov    %ebx,%edi
shr    $0x2,%edi
and    $0x1,%edi
call   1030 <writeBit@plt>
mov    %ebx,%edi
shr    $0x3,%edi
and    $0x1,%edi
call   1030 <writeBit@plt>
mov    %ebx,%edi
shr    $0x4,%edi
and    $0x1,%edi
call   1030 <writeBit@plt>
mov    %ebx,%edi
shr    $0x5,%edi
and    $0x1,%edi
call   1030 <writeBit@plt>
mov    %ebx,%edi
shr    $0x6,%edi
and    $0x1,%edi
call   1030 <writeBit@plt>
shr    $0x7,%ebx
and    $0x1,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <writeBit@plt>

LLVM IR (-O0):
define void @writeByte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %2
%9 = and i32 %8, 1
%10 = call i32 @writeBit(i32 %9)
%11 = load i32, i32* %2
%12 = ashr i32 %11, 1
store i32 %12, i32* %2
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @writeByte(i32 %0) {
%2 = and i32 %0, 1
%3 = tail call i32 @writeBit(i32 %2)
%4 = lshr i32 %0, 1
%5 = and i32 %4, 1
%6 = tail call i32 @writeBit(i32 %5)
%7 = lshr i32 %0, 2
%8 = and i32 %7, 1
%9 = tail call i32 @writeBit(i32 %8)
%10 = lshr i32 %0, 3
%11 = and i32 %10, 1
%12 = tail call i32 @writeBit(i32 %11)
%13 = lshr i32 %0, 4
%14 = and i32 %13, 1
%15 = tail call i32 @writeBit(i32 %14)
%16 = lshr i32 %0, 5
%17 = and i32 %16, 1
%18 = tail call i32 @writeBit(i32 %17)
%19 = lshr i32 %0, 6
%20 = and i32 %19, 1
%21 = tail call i32 @writeBit(i32 %20)
%22 = lshr i32 %0, 7
%23 = and i32 %22, 1
%24 = tail call i32 @writeBit(i32 %23)
ret void
}
int sjis_mblen(unsigned char *str, int len) {
  if (str[0] >= 0xa0 && str[0] <= 0xdf) {
    return 1;
  } else if (len >= 2 && (str[0] & 0x80)) {
    return 2;
  }
  return 1;
}


x86 assembly (clang, -O0):
<sjis_mblen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xa0,%eax
jl     113b <sjis_mblen+0x3b>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xdf,%eax
jg     113b <sjis_mblen+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1172 <sjis_mblen+0x72>
cmpl   $0x2,-0x14(%rbp)
jl     1166 <sjis_mblen+0x66>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1166 <sjis_mblen+0x66>
movl   $0x2,-0x4(%rbp)
jmp    1172 <sjis_mblen+0x72>
jmp    116b <sjis_mblen+0x6b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sjis_mblen>:
mov    (%rdi),%al
lea    0x60(%rax),%ecx
cmp    $0x40,%cl
setb   %cl
cmp    $0x2,%esi
setl   %dl
test   %al,%al
setns  %al
or     %dl,%al
or     %cl,%al
movzbl %al,%ecx
mov    $0x2,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sjis_mblen(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = icmp sge i32 %9, 160
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = icmp sle i32 %15, 223
br i1 %16, label %17, label %18
17: ; preds = %11
store i32 1, i32* %3
br label %31
18: ; preds = %11, %2
%19 = load i32, i32* %5
%20 = icmp sge i32 %19, 2
br i1 %20, label %21, label %29
21: ; preds = %18
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = and i32 %25, 128
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %21
store i32 2, i32* %3
br label %31
29: ; preds = %21, %18
br label %30
30: ; preds = %29
store i32 1, i32* %3
br label %31
31: ; preds = %30, %28, %17
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @sjis_mblen(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, 96
%5 = icmp ult i8 %4, 64
%6 = icmp slt i32 %1, 2
%7 = icmp sgt i8 %3, -1
%8 = select i1 %6, i1 true, i1 %7
%9 = or i1 %5, %8
%10 = select i1 %9, i32 1, i32 2
ret i32 %10
}
void outsl(int port, const void *addr, int cnt) {
  asm volatile("cld; rep outsl"
               : "=S"(addr), "=c"(cnt)
               : "d"(port), "0"(addr), "1"(cnt)
               : "cc");
}


x86 assembly (clang, -O0):
<outsl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
cld
rep outsl %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsl>:
mov    %edx,%ecx
mov    %edi,%edx
cld
rep outsl %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsl(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call { i8*, i32 } asm sideeffect "cld; rep outsl", "={si},={cx},{dx},0,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %7, i8* %8, i32 %9)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %5
store i32 %12, i32* %6
ret void
}

LLVM IR (-O2):
define void @outsl(i32 %0, i8* %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "cld; rep outsl", "={si},={cx},{dx},0,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i32 %2)
ret void
}