xunge/DecIR huggingface dataset:
unsigned long Formike128x128x16ColorTranslate(void *pvDisplayData,
                                              unsigned long ulValue) {
  return (((((ulValue)&0x00ff0000) >> 19) |
           ((((ulValue)&0x0000ff00) >> 5) & 0x000007e0) |
           ((((ulValue)&0x000000ff) << 8) & 0x0000f800)));
}


x86 assembly (clang, -O0):
<Formike128x128x16ColorTranslate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff0000,%rax
shr    $0x13,%rax
mov    -0x10(%rbp),%rcx
and    $0xff00,%rcx
shr    $0x5,%rcx
and    $0x7e0,%rcx
or     %rcx,%rax
mov    -0x10(%rbp),%rcx
and    $0xff,%rcx
shl    $0x8,%rcx
and    $0xf800,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Formike128x128x16ColorTranslate>:
mov    %rsi,%rax
mov    %eax,%ecx
shr    $0x13,%ecx
and    $0x1f,%ecx
mov    %rsi,%rdx
shr    $0x5,%rdx
and    $0x7e0,%edx
or     %rdx,%rcx
shl    $0x8,%eax
and    $0xf800,%eax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @Formike128x128x16ColorTranslate(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 16711680
%7 = lshr i64 %6, 19
%8 = load i64, i64* %4
%9 = and i64 %8, 65280
%10 = lshr i64 %9, 5
%11 = and i64 %10, 2016
%12 = or i64 %7, %11
%13 = load i64, i64* %4
%14 = and i64 %13, 255
%15 = shl i64 %14, 8
%16 = and i64 %15, 63488
%17 = or i64 %12, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @Formike128x128x16ColorTranslate(i8* nocapture readnone %0, i64 %1) {
%3 = lshr i64 %1, 19
%4 = and i64 %3, 31
%5 = lshr i64 %1, 5
%6 = and i64 %5, 2016
%7 = or i64 %4, %6
%8 = shl i64 %1, 8
%9 = and i64 %8, 63488
%10 = or i64 %7, %9
ret i64 %10
}
unsigned int f43(unsigned int x, int y __attribute__((unused))) {
  return (x >> 1) | (x << (8 * sizeof(unsigned int) - 1));
}


x86 assembly (clang, -O0):
<f43>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f43>:
mov    %edi,%eax
ror    %eax
ret

LLVM IR (-O0):
define i32 @f43(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 = lshr i32 %5, 1
%7 = load i32, i32* %3
%8 = shl i32 %7, 31
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f43(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 31)
ret i32 %3
}
/* Variables and functions */
void *GetNullPointer(void) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @GetNullPointer() {
ret i8* null
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void s337_clear_error(uint8_t *p_s337) { p_s337[5] &= ~0x80; }


x86 assembly (clang, -O0):
<s337_clear_error>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
and    $0xffffff7f,%ecx
mov    %ecx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<s337_clear_error>:
andb   $0x7f,0x14(%rdi)
ret

LLVM IR (-O0):
define void @s337_clear_error(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = and i32 %5, -129
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @s337_clear_error(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = and i32 %3, -129
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logger(int /*<<< orphan*/, char *, int);
int read_int4(char const *);
int read_mysql_long(const char *buf) {
  int iv = 0;
  iv = read_int4(buf);
  logger(0, "LONG %d\n", iv);
  return iv;
}


x86 assembly (clang, -O0):
<read_mysql_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_int4@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
xor    %edi,%edi
lea    0xeb5(%rip),%rsi
call   1040 <logger@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_mysql_long>:
push   %rbx
call   1030 <read_int4@plt>
mov    %eax,%ebx
lea    0xed1(%rip),%rsi
xor    %edi,%edi
mov    %eax,%edx
call   1040 <logger@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"LONG %d\0A\00"
define i32 @read_mysql_long(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 @read_int4(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @logger(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"LONG %d\0A\00"
define i32 @read_mysql_long(i8* %0) {
%2 = tail call i32 @read_int4(i8* %0)
%3 = tail call i32 @logger(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %2
}
unsigned int fn4(unsigned int x, unsigned int y) {
  unsigned int tem1 = x & y;
  unsigned int tem2 = x | y;
  return tem2 ^ tem1;
}


x86 assembly (clang, -O0):
<fn4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn4>:
mov    %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = and i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = or i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn4(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
int relayStatus(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @relayStatus() {
ret i32 0
}
/* Variables and functions */
unsigned char redupe_gf_mul(unsigned char, unsigned int);
void redupe_gf_poly_scale(unsigned char *poly, unsigned poly_sz, unsigned x) {
  for (unsigned i = 0; i < poly_sz; ++i) {
    poly[i] = redupe_gf_mul(poly[i], x);
  }
}


x86 assembly (clang, -O0):
<redupe_gf_poly_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1164 <redupe_gf_poly_scale+0x54>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,1),%al
mov    -0x10(%rbp),%esi
movzbl %al,%edi
call   1030 <redupe_gf_mul@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <redupe_gf_poly_scale+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redupe_gf_poly_scale>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     1148 <redupe_gf_poly_scale+0x38>
mov    %edx,%r14d
mov    %rdi,%rbx
mov    %esi,%r15d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
movzbl (%rbx,%rbp,1),%edi
mov    %r14d,%esi
call   1030 <redupe_gf_mul@plt>
mov    %al,(%rbx,%rbp,1)
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1130 <redupe_gf_poly_scale+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @redupe_gf_poly_scale(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %24, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i32, i32* %7
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = load i32, i32* %6
%19 = call zeroext i8 @redupe_gf_mul(i8 zeroext %17, i32 %18)
%20 = load i8*, i8** %4
%21 = load i32, i32* %7
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 %19, i8* %23
br label %24
24: ; preds = %12
%25 = load i32, i32* %7
%26 = add i32 %25, 1
store i32 %26, i32* %7
br label %8
27: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @redupe_gf_poly_scale(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call zeroext i8 @redupe_gf_mul(i8 zeroext %11, i32 %2)
store i8 %12, i8* %10
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %7, label %8
}
void RTTlsAllocEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTlsAllocEx() {
ret void
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
void becomesUppercase(char *s) {
  int i;
  for (i = 0; i < strlen(s); i++) {
    s[i] = toupper(s[i]);
  }
}


x86 assembly (clang, -O0):
<becomesUppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <becomesUppercase+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <becomesUppercase+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<becomesUppercase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <becomesUppercase+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <becomesUppercase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @becomesUppercase(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %23
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = call signext i8 @toupper(i8 signext %14)
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 %15, i8* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @becomesUppercase(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
float __nv_nearbyintf(float);
float nearbyintf(float __a) { return __nv_nearbyintf(__a); }


x86 assembly (clang, -O0):
<nearbyintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__nv_nearbyintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearbyintf>:
jmp    1030 <__nv_nearbyintf@plt>

LLVM IR (-O0):
define float @nearbyintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__nv_nearbyintf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @nearbyintf(float %0) {
%2 = tail call float @__nv_nearbyintf(float %0)
ret float %2
}
int is_directory(char *fn) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_directory(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_override_default_ssl_roots() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_override_default_ssl_roots>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_override_default_ssl_roots>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_override_default_ssl_roots() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_override_default_ssl_roots() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
double powf(double, int);
float midi_freq(int note) { return powf(2.0, (note - 69.0) / 12.0) * 440.0; }


x86 assembly (clang, -O0):
<midi_freq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xef0(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xec4(%rip),%xmm0
call   1030 <powf@plt>
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midi_freq>:
push   %rax
cvtsi2sd %edi,%xmm0
addsd  0xee3(%rip),%xmm0
divsd  0xee3(%rip),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xedf(%rip),%xmm0
call   1030 <powf@plt>
mulsd  0xeda(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @midi_freq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fsub double %4, 6.900000e+01
%6 = fdiv double %5, 1.200000e+01
%7 = fptosi double %6 to i32
%8 = call double @powf(double 2.000000e+00, i32 %7)
%9 = fmul double %8, 4.400000e+02
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @midi_freq(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, -6.900000e+01
%4 = fdiv double %3, 1.200000e+01
%5 = fptosi double %4 to i32
%6 = tail call double @powf(double 2.000000e+00, i32 %5)
%7 = fmul double %6, 4.400000e+02
%8 = fptrunc double %7 to float
ret float %8
}
void audio_init(void) {
  static int initted = 0;
  if (initted)
    return;
  initted = 1;
}


x86 assembly (clang, -O0):
<audio_init>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f19(%rip)
je     1116 <audio_init+0x16>
jmp    1120 <audio_init+0x20>
movl   $0x1,0x2f04(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_init>:
cmpb   $0x0,0x2f1d(%rip)
jne    1110 <audio_init+0x10>
movb   $0x1,0x2f14(%rip)
ret

LLVM IR (-O0):
@audio_init.initted = internal global i32 0
define void @audio_init() {
%1 = load i32, i32* @audio_init.initted
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %5
4: ; preds = %0
store i32 1, i32* @audio_init.initted
br label %5
5: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
@audio_init.initted = internal unnamed_addr global i1 false
define void @audio_init() {
%1 = load i1, i1* @audio_init.initted
br i1 %1, label %3, label %2
2: ; preds = %0
store i1 true, i1* @audio_init.initted
br label %3
3: ; preds = %0, %2
ret void
}
int qpow(int a, int b, int mod) {
  int ret = 1, base = a;
  while (b) {
    if (b & 1)
      ret = (ret * base) % mod;
    base = (base * base) % mod;
    b >>= 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<qpow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115d <qpow+0x5d>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1141 <qpow+0x41>
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111a <qpow+0x1a>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qpow>:
test   %esi,%esi
je     113c <qpow+0x3c>
mov    %edx,%r8d
mov    $0x1,%ecx
jmp    1126 <qpow+0x26>
xchg   %ax,%ax
imul   %edi,%edi
mov    %edi,%eax
cltd
idiv   %r8d
mov    %esi,%eax
sar    %eax
mov    %edx,%edi
cmp    $0x1,%esi
mov    %eax,%esi
jbe    1139 <qpow+0x39>
test   $0x1,%sil
je     1110 <qpow+0x10>
imul   %edi,%ecx
mov    %ecx,%eax
cltd
idiv   %r8d
mov    %edx,%ecx
jmp    1110 <qpow+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @qpow(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 1, i32* %7
%9 = load i32, i32* %4
store i32 %9, i32* %8
br label %10
10: ; preds = %23, %3
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %31
13: ; preds = %10
%14 = load i32, i32* %5
%15 = and i32 %14, 1
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = load i32, i32* %7
%19 = load i32, i32* %8
%20 = mul nsw i32 %18, %19
%21 = load i32, i32* %6
%22 = srem i32 %20, %21
store i32 %22, i32* %7
br label %23
23: ; preds = %17, %13
%24 = load i32, i32* %8
%25 = load i32, i32* %8
%26 = mul nsw i32 %24, %25
%27 = load i32, i32* %6
%28 = srem i32 %26, %27
store i32 %28, i32* %8
%29 = load i32, i32* %5
%30 = ashr i32 %29, 1
store i32 %30, i32* %5
br label %10
31: ; preds = %10
%32 = load i32, i32* %7
ret i32 %32
}

LLVM IR (-O2):
define i32 @qpow(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %20, label %5
5: ; preds = %3, %14
%6 = phi i32 [ %17, %14 ], [ %0, %3 ]
%7 = phi i32 [ %15, %14 ], [ 1, %3 ]
%8 = phi i32 [ %18, %14 ], [ %1, %3 ]
%9 = and i32 %8, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %5
%12 = mul nsw i32 %6, %7
%13 = srem i32 %12, %2
br label %14
14: ; preds = %11, %5
%15 = phi i32 [ %13, %11 ], [ %7, %5 ]
%16 = mul nsw i32 %6, %6
%17 = srem i32 %16, %2
%18 = ashr i32 %8, 1
%19 = icmp ult i32 %8, 2
br i1 %19, label %20, label %5
20: ; preds = %14, %3
%21 = phi i32 [ 1, %3 ], [ %15, %14 ]
ret i32 %21
}
/* Variables and functions */
scalar_t__ do_something_evil();
__attribute__((always_)) void q2(void) {
  if (do_something_evil())
    return;
  q2();
  q2();
}


x86 assembly (clang, -O0):
<q2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <do_something_evil@plt>
cmp    $0x0,%rax
je     113a <q2+0x1a>
jmp    1144 <q2+0x24>
call   1040 <q2@plt>
call   1040 <q2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<q2>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <do_something_evil@plt>
test   %rax,%rax
jne    1143 <q2+0x23>
call   1040 <q2@plt>
jmp    1130 <q2+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @q2() {
%1 = call i64 (...) @do_something_evil()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %5
4: ; preds = %0
br label %5
5: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
define void @q2() {
%1 = tail call i64 (...) @do_something_evil()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0, %3
tail call void @q2()
%4 = tail call i64 (...) @do_something_evil()
%5 = icmp eq i64 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3, %0
ret void
}
void mvni_msl16(int *__restrict a) {
  int i;
  for (i = 0; i < 16; i++)
    a[i] = 0xff540000;
}


x86 assembly (clang, -O0):
<mvni_msl16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1136 <mvni_msl16+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xff540000,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <mvni_msl16+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvni_msl16>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x30(%rdi)
ret

LLVM IR (-O0):
define void @mvni_msl16(i32* noalias %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 16
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 -11272192, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @mvni_msl16(i32* noalias nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 -11272192, i32 -11272192, i32 -11272192, i32 -11272192>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 -11272192, i32 -11272192, i32 -11272192, i32 -11272192>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 -11272192, i32 -11272192, i32 -11272192, i32 -11272192>, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %0, i64 12
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 -11272192, i32 -11272192, i32 -11272192, i32 -11272192>, <4 x i32>* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sa_handler_exit(int signum) {
  cleanup();
  exit(0);
}


x86 assembly (clang, -O0):
<sa_handler_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <cleanup@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sa_handler_exit>:
push   %rax
xor    %eax,%eax
call   1030 <cleanup@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sa_handler_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cleanup()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sa_handler_exit(i32 %0) {
%2 = tail call i32 (...) @cleanup()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int snprintf(char *, int, char *, int);
int senFunc5(char *s, int n, int a) {
  return snprintf(s, n, "Humidity: %lf%% ", a * 100 / 1023.0);
}


x86 assembly (clang, -O0):
<senFunc5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
imul   $0x64,-0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
lea    0xec0(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<senFunc5>:
imul   $0x64,%edx,%eax
cvtsi2sd %eax,%xmm0
divsd  0xee1(%rip),%xmm0
cvttsd2si %xmm0,%ecx
lea    0xede(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Humidity: %lf%% \00"
define i32 @senFunc5(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = mul nsw i32 %9, 100
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 1.023000e+03
%13 = fptosi double %12 to i32
%14 = call i32 @snprintf(i8* %7, i32 %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [17 x i8] c"Humidity: %lf%% \00"
define i32 @senFunc5(i8* %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, 100
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 1.023000e+03
%7 = fptosi double %6 to i32
%8 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ace_init_convert();
void ACE_init(void) { ace_init_convert(); }


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

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

LLVM IR (-O0):
define void @ACE_init() {
%1 = call i32 (...) @ace_init_convert()
ret void
}

LLVM IR (-O2):
define void @ACE_init() {
%1 = tail call i32 (...) @ace_init_convert()
ret void
}
/* Variables and functions */
#define AF_INET 129
#define AF_INET6 128
int addr_unicast_masklen(int af) {
  switch (af) {
  case AF_INET:
    return (32);
  case AF_INET6:
    return (128);
  default:
    return (-1);
  }
}


x86 assembly (clang, -O0):
<addr_unicast_masklen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x80,%eax
je     113c <addr_unicast_masklen+0x3c>
jmp    111d <addr_unicast_masklen+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x81,%eax
jne    1148 <addr_unicast_masklen+0x48>
jmp    1130 <addr_unicast_masklen+0x30>
movl   $0x20,-0x4(%rbp)
jmp    114f <addr_unicast_masklen+0x4f>
movl   $0x80,-0x4(%rbp)
jmp    114f <addr_unicast_masklen+0x4f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr_unicast_masklen>:
cmp    $0x80,%edi
mov    $0xffffffff,%ecx
cmove  %edi,%ecx
cmp    $0x81,%edi
mov    $0x20,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @addr_unicast_masklen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 129, label %5
i32 128, label %6
]
5: ; preds = %1
store i32 32, i32* %2
br label %8
6: ; preds = %1
store i32 128, i32* %2
br label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @addr_unicast_masklen(i32 %0) {
%2 = icmp eq i32 %0, 128
%3 = select i1 %2, i32 128, i32 -1
%4 = icmp eq i32 %0, 129
%5 = select i1 %4, i32 32, i32 %3
ret i32 %5
}
void initTypeDeJeux(int typeJeux[4]) {
  int indexJeux;
  for (indexJeux = 0; indexJeux < 4; indexJeux++)
    typeJeux[indexJeux] = 0;
}


x86 assembly (clang, -O0):
<initTypeDeJeux>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1136 <initTypeDeJeux+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <initTypeDeJeux+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initTypeDeJeux>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @initTypeDeJeux(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 0, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @initTypeDeJeux(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int strlen(char *);
main(int argc, char **argv) {
  char *frase;
  int n;
  if (argc >= 2) {
    frase = argv[1];
    n = strlen(frase);
    printf("A frase \"%s\" tem comprimento %d.\n", frase, n);
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jl     116b <main+0x4b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     1144 <main+0x24>
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
pop    %rbx
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [34 x i8] c"A frase \22%s\22 tem comprimento %d.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 2
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = call i32 @strlen(i8* %14)
store i32 %15, i32* %7
%16 = load i8*, i8** %6
%17 = load i32, i32* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %16, i32 %17)
br label %19
19: ; preds = %10, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"A frase \22%s\22 tem comprimento %d.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strlen(i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
br label %9
9: ; preds = %4, %2
ret i32 0
}
int execute_oldlstat() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_oldlstat() {
ret i32 0
}
/* Variables and functions */
unsigned char rand();
unsigned char range_uchar(unsigned char min, unsigned char max) {
  unsigned char val = rand();
  return val < min || max < val ? min : val;
}


x86 assembly (clang, -O0):
<range_uchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
movzbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jl     114e <range_uchar+0x3e>
movzbl -0x2(%rbp),%eax
movzbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
jge    115a <range_uchar+0x4a>
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1161 <range_uchar+0x51>
movzbl -0x3(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_uchar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cmp    %bl,%al
movzbl %al,%ecx
mov    %ecx,%eax
cmova  %ebp,%eax
cmp    %bpl,%cl
cmovb  %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @range_uchar(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = call zeroext i8 (...) @rand()
store i8 %6, i8* %5
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp slt i32 %8, %10
br i1 %11, label %18, label %12
12: ; preds = %2
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %21
18: ; preds = %12, %2
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
br label %24
21: ; preds = %12
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
br label %24
24: ; preds = %21, %18
%25 = phi i32 [ %20, %18 ], [ %23, %21 ]
%26 = trunc i32 %25 to i8
ret i8 %26
}

LLVM IR (-O2):
define zeroext i8 @range_uchar(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call zeroext i8 (...) @rand()
%4 = icmp ult i8 %3, %0
%5 = icmp ugt i8 %3, %1
%6 = or i1 %4, %5
%7 = select i1 %6, i8 %0, i8 %3
ret i8 %7
}
unsigned int rev_s_pair_m(const unsigned char *p) {
  unsigned int a, b, c, d;
  a = p[0];
  b = p[1];
  c = p[2];
  d = p[3];
  return (a << 8) | (b << 0) | (c << 24) | (d << 16);
}


x86 assembly (clang, -O0):
<rev_s_pair_m>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_s_pair_m>:
movzbl 0x2(%rdi),%ecx
movzbl 0x3(%rdi),%eax
movzwl (%rdi),%edx
shl    $0x10,%edx
bswap  %edx
shl    $0x18,%ecx
or     %edx,%ecx
shl    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @rev_s_pair_m(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
store i32 %10, i32* %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
store i32 %14, i32* %4
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
store i32 %18, i32* %5
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
store i32 %22, i32* %6
%23 = load i32, i32* %3
%24 = shl i32 %23, 8
%25 = load i32, i32* %4
%26 = shl i32 %25, 0
%27 = or i32 %24, %26
%28 = load i32, i32* %5
%29 = shl i32 %28, 24
%30 = or i32 %27, %29
%31 = load i32, i32* %6
%32 = shl i32 %31, 16
%33 = or i32 %30, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @rev_s_pair_m(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %3, 8
%14 = or i32 %13, %6
%15 = shl nuw i32 %9, 24
%16 = or i32 %14, %15
%17 = shl nuw nsw i32 %12, 16
%18 = or i32 %16, %17
ret i32 %18
}
/* Variables and functions */
char *getenv(char *);
char *getDllPath() { return getenv("LD_LIBRARY_PATH"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"LD_LIBRARY_PATH\00"
define i8* @getDllPath() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [16 x i8] c"LD_LIBRARY_PATH\00"
define i8* @getDllPath() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
scalar_t__ munmap(void *, int);
int /*<<< orphan*/ perror(char *);
int free_anonymous_hugepage(void *addr, int size) {
  int ret = 0;
  if (munmap(addr, size)) {
    perror("munmap");
    ret = -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<free_anonymous_hugepage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <munmap@plt>
cmp    $0x0,%rax
je     115f <free_anonymous_hugepage+0x3f>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_anonymous_hugepage>:
push   %rax
call   1030 <munmap@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1132 <free_anonymous_hugepage+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"munmap\00"
define i32 @free_anonymous_hugepage(i8* %0, i32 %1) {
%3 = tail call i64 @munmap(i8* %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %8
}
void *gettcpL7(struct udphdr *pudp, int tproto, void *pdir, void *plast) {
  return (void *)pudp;
}


x86 assembly (clang, -O0):
<gettcpL7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.udphdr = type opaque
define i8* @gettcpL7(%struct.udphdr* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.udphdr*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.udphdr* %0, %struct.udphdr** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load %struct.udphdr*, %struct.udphdr** %5
%10 = bitcast %struct.udphdr* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
%struct.udphdr = type opaque
define i8* @gettcpL7(%struct.udphdr* readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = bitcast %struct.udphdr* %0 to i8*
ret i8* %5
}
/* Variables and functions */
int atoi(char *);
char *midi_ntos(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  int i = atoi(argv[1]);
  printf("RESULT : %s\n", midi_ntos(i));
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <midi_ntos@plt>
mov    %rax,%rsi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <midi_ntos@plt>
lea    0xeb8(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"RESULT : %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i8* @midi_ntos(i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"RESULT : %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i8* @midi_ntos(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Count_Stack(int /*<<< orphan*/);
int main(void) {
  Count_Stack(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Count_Stack(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void panic(const char *msg) {
  fprintf(stderr, "PANIC: %s: %s\n", msg, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"PANIC: %s: %s\0A\00"
@errno = global i32 0
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"PANIC: %s: %s\0A\00"
@errno = global i32 0
define void @panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "usage: %s [-s srcdir] [-b builddir] [sysname]\n", progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"usage: %s [-s srcdir] [-b builddir] [sysname]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"usage: %s [-s srcdir] [-b builddir] [sysname]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LED_on(int /*<<< orphan*/);
void Error_Handler(void) {
  LED_on(0);
  while (1) {
  }
}


x86 assembly (clang, -O0):
<Error_Handler>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <LED_on@plt>
jmp    111b <Error_Handler+0xb>

x86 assembly (clang, -O2):
<Error_Handler>:
push   %rax
xor    %edi,%edi
call   1030 <LED_on@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <Error_Handler+0x10>

LLVM IR (-O0):
define void @Error_Handler() {
%1 = call i32 @LED_on(i32 0)
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @Error_Handler() {
%1 = tail call i32 @LED_on(i32 0)
br label %2
2: ; preds = %0, %2
br label %2
}
_Atomic(int) compound_xor(_Atomic(int) in) { return (in ^= 5); }


x86 assembly (clang, -O0):
<compound_xor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
xor    $0x5,%ecx
lock cmpxchg %ecx,-0x4(%rbp)
sete   %cl
mov    %eax,-0xc(%rbp)
test   $0x1,%cl
mov    %eax,-0x8(%rbp)
jne    1131 <compound_xor+0x31>
jmp    110d <compound_xor+0xd>
mov    -0xc(%rbp),%eax
xor    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compound_xor>:
mov    %edi,%eax
mov    %edi,-0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
xor    $0x5,%ecx
lock cmpxchg %ecx,-0x4(%rsp)
jne    1110 <compound_xor+0x10>
xor    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @compound_xor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = atomicrmw xor i32* %2, i32 5 seq_cst
%4 = xor i32 %3, 5
ret i32 %4
}

LLVM IR (-O2):
define i32 @compound_xor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = atomicrmw xor i32* %2, i32 5 seq_cst
%4 = xor i32 %3, 5
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ read();
int /*<<< orphan*/ writeVTK();
int main() {
  read();
  writeVTK();
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @read()
%2 = call i32 (...) @writeVTK()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @read()
%2 = tail call i32 (...) @writeVTK()
ret i32 0
}