xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
void min_input(char *tekst, int *data) {
  printf("%s", tekst);
  scanf("%d", data);
}


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

x86 assembly (clang, -O2):
<min_input>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define void @min_input(i8* %0, i32* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret void
}
void glFrontFace(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glFrontFace() {
ret void
}
char *getEnumFormKind(int value) {
  switch (value) {
  case 0:
    return "NOLL_FORM_UNSAT";
  case 1:
    return "NOLL_FORM_SAT";
  case 2:
    return "NOLL_FORM_VALID";
  default:
    return "NOLL_FORM_OTHER";
  }
}


x86 assembly (clang, -O0):
<getEnumFormKind>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <getEnumFormKind+0x3c>
jmp    111a <getEnumFormKind+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <getEnumFormKind+0x4c>
jmp    112b <getEnumFormKind+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     115c <getEnumFormKind+0x5c>
jmp    116c <getEnumFormKind+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <getEnumFormKind+0x77>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <getEnumFormKind+0x77>
lea    0xebb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <getEnumFormKind+0x77>
lea    0xebb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEnumFormKind>:
cmp    $0x2,%edi
ja     1117 <getEnumFormKind+0x17>
movslq %edi,%rax
lea    0xf31(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf10(%rip),%rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"NOLL_FORM_UNSAT\00"
@.str.1 = [14 x i8] c"NOLL_FORM_SAT\00"
@.str.2 = [16 x i8] c"NOLL_FORM_VALID\00"
@.str.3 = [16 x i8] c"NOLL_FORM_OTHER\00"
define i8* @getEnumFormKind(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [16 x i8] c"NOLL_FORM_UNSAT\00"
@.str.1 = [14 x i8] c"NOLL_FORM_SAT\00"
@.str.2 = [16 x i8] c"NOLL_FORM_VALID\00"
@.str.3 = [16 x i8] c"NOLL_FORM_OTHER\00"
@reltable.getEnumFormKind = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.getEnumFormKind to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.getEnumFormKind to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.getEnumFormKind to i64)) to i32)]
define i8* @getEnumFormKind(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.getEnumFormKind to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
int random();
int sio_writable(void) { return random() % 2; }


x86 assembly (clang, -O0):
<sio_writable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sio_writable>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sio_writable() {
%1 = call i32 (...) @random()
%2 = srem i32 %1, 2
ret i32 %2
}

LLVM IR (-O2):
define i32 @sio_writable() {
%1 = tail call i32 (...) @random()
%2 = srem i32 %1, 2
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
int /*<<< orphan*/ time(scalar_t__ *);
void initRand(void) {
  time_t SystemTime;
  time(&SystemTime);
  srand((unsigned int)SystemTime);
}


x86 assembly (clang, -O0):
<initRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1040 <time@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initRand>:
push   %rax
mov    %rsp,%rdi
call   1040 <time@plt>
mov    (%rsp),%edi
call   1030 <srand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @initRand() {
%1 = alloca i64
%2 = call i32 @time(i64* %1)
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
%5 = call i32 @srand(i32 %4)
ret void
}

LLVM IR (-O2):
define void @initRand() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @time(i64* %1)
%4 = load i64, i64* %1
%5 = trunc i64 %4 to i32
%6 = call i32 @srand(i32 %5)
ret void
}
int is_little_endian(void) {
  int i = 1;
  char *p = (char *)&i;
  return *p;
}


x86 assembly (clang, -O0):
<is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_little_endian>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_little_endian() {
%1 = alloca i32
%2 = alloca i8*
store i32 1, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_little_endian() {
ret i32 1
}
int test_imm_AEuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xAE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_AEuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 174
%6 = icmp ne i64 %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_AEuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 174
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
uint64_t _wyr8(const uint8_t *p) {
  uint64_t v;
  memcpy(&v, p, 8);
  return v;
}


x86 assembly (clang, -O0):
<_wyr8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wyr8>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_wyr8(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @memcpy(i32* %3, i32* %4, i32 8)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @_wyr8(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i32* %0, i32 8)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int openparen(char c) {
  if (c && strchr("(", c))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<openparen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
je     1151 <openparen+0x41>
lea    0xece(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1151 <openparen+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1158 <openparen+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openparen>:
test   %dil,%dil
je     1139 <openparen+0x29>
push   %rax
movsbl %dil,%esi
lea    0xedf(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
lea    0x8(%rsp),%rsp
je     1139 <openparen+0x29>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"(\00"
define i32 @openparen(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 ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = call i64 @strchr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = icmp ne i64 %9, 0
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):
@.str = [2 x i8] c"(\00"
define i32 @openparen(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @strchr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3, %1
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Variables and functions */
double powf(float, double);
float gamma_sRGB_f(float a) {
  return (a <= 0.0031308) ? 12.92 * a : 1.055 * powf(a, 1.0 / 2.4) - 0.055;
}


x86 assembly (clang, -O0):
<gamma_sRGB_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1157 <gamma_sRGB_f+0x47>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1186 <gamma_sRGB_f+0x76>
movss  -0x4(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
call   1030 <powf@plt>
movsd  0xe97(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma_sRGB_f>:
push   %rax
movaps %xmm0,%xmm2
cvtss2sd %xmm0,%xmm0
movsd  0xee0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1148 <gamma_sRGB_f+0x38>
movsd  0xee2(%rip),%xmm1
movaps %xmm2,%xmm0
call   1030 <powf@plt>
mulsd  0xeda(%rip),%xmm0
addsd  0xeda(%rip),%xmm0
jmp    1150 <gamma_sRGB_f+0x40>
mulsd  0xeb8(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @gamma_sRGB_f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp ole double %4, 3.130800e-03
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fmul double 1.292000e+01, %8
br label %14
10: ; preds = %1
%11 = load float, float* %2
%12 = call double @powf(float %11, double 0x3FDAAAAAAAAAAAAB)
%13 = call double @llvm.fmuladd.f64(double 1.055000e+00, double %12, double -5.500000e-02)
br label %14
14: ; preds = %10, %6
%15 = phi double [ %9, %6 ], [ %13, %10 ]
%16 = fptrunc double %15 to float
ret float %16
}

LLVM IR (-O2):
define float @gamma_sRGB_f(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ugt double %2, 3.130800e-03
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = fmul double %2, 1.292000e+01
br label %9
6: ; preds = %1
%7 = tail call double @powf(float %0, double 0x3FDAAAAAAAAAAAAB)
%8 = tail call double @llvm.fmuladd.f64(double %7, double 1.055000e+00, double -5.500000e-02)
br label %9
9: ; preds = %6, %4
%10 = phi double [ %5, %4 ], [ %8, %6 ]
%11 = fptrunc double %10 to float
ret float %11
}
void foo135() {}


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

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

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

LLVM IR (-O2):
define void @foo135() {
ret void
}
void clts(void) { __asm volatile("clts"); }


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

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

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

LLVM IR (-O2):
define void @clts() {
tail call void asm sideeffect "clts", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int _sapi_inet_tcp_transmit(int, void *, int);
int sapi_unix_tcp_transmit(int sock, void *data, int datalen) {
  return _sapi_inet_tcp_transmit(sock, data, datalen);
}


x86 assembly (clang, -O0):
<sapi_unix_tcp_transmit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <_sapi_inet_tcp_transmit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sapi_unix_tcp_transmit>:
jmp    1030 <_sapi_inet_tcp_transmit@plt>

LLVM IR (-O0):
define i32 @sapi_unix_tcp_transmit(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 i32 @_sapi_inet_tcp_transmit(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sapi_unix_tcp_transmit(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @_sapi_inet_tcp_transmit(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int *, int);
int main() {
  int i = 0;
  if (foo(&i, 1) != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <foo@plt>
cmp    $0x1,%eax
je     1154 <main+0x34>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1040 <foo@plt>
cmp    $0x1,%eax
jne    1141 <main+0x21>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @foo(i32* %2, i32 1)
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @foo(i32* %1, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ pc(char);
void ptarg(int count) {
  char a;
  a = 'a' + (count % 26);
  attron(COLOR_PAIR(3));
  pc(a);
  attroff(COLOR_PAIR(3));
}


x86 assembly (clang, -O0):
<ptarg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x61,%edx
mov    %dl,%al
mov    %al,-0x5(%rbp)
mov    $0x3,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
movsbl -0x5(%rbp),%edi
call   1060 <pc@plt>
mov    $0x3,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptarg>:
push   %rbx
movslq %edi,%rbx
imul   $0x4ec4ec4f,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x23,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
sub    %ecx,%ebx
add    $0x61,%bl
mov    $0x3,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
movsbl %bl,%edi
call   1060 <pc@plt>
mov    $0x3,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <attroff@plt>

LLVM IR (-O0):
define void @ptarg(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 26
%6 = add nsw i32 97, %5
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = call i32 @COLOR_PAIR(i32 3)
%9 = call i32 @attron(i32 %8)
%10 = load i8, i8* %3
%11 = call i32 @pc(i8 signext %10)
%12 = call i32 @COLOR_PAIR(i32 3)
%13 = call i32 @attroff(i32 %12)
ret void
}

LLVM IR (-O2):
define void @ptarg(i32 %0) {
%2 = srem i32 %0, 26
%3 = trunc i32 %2 to i8
%4 = add nsw i8 %3, 97
%5 = tail call i32 @COLOR_PAIR(i32 3)
%6 = tail call i32 @attron(i32 %5)
%7 = tail call i32 @pc(i8 signext %4)
%8 = tail call i32 @COLOR_PAIR(i32 3)
%9 = tail call i32 @attroff(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ err(int /*<<< orphan*/, char *);
void *xcalloc(size_t n, size_t size) {
  void *ptr;
  ptr = calloc(n, size);
  if (ptr == NULL)
    err(EXIT_FAILURE, "calloc");
  return ptr;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <xcalloc+0x41>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1040 <err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xcalloc+0x23>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1040 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [7 x i8] c"calloc\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @err(i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ M_MMAP_THRESHOLD;
int mallopt(int /*<<< orphan*/, int);
int main(void) { return mallopt(M_MMAP_THRESHOLD, 1024 * 1024); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    $0x100000,%esi
call   1030 <mallopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    $0x100000,%esi
jmp    1030 <mallopt@plt>

LLVM IR (-O0):
@M_MMAP_THRESHOLD = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @M_MMAP_THRESHOLD
%3 = call i32 @mallopt(i32 %2, i32 1048576)
ret i32 %3
}

LLVM IR (-O2):
@M_MMAP_THRESHOLD = global i32 0
define i32 @main() {
%1 = load i32, i32* @M_MMAP_THRESHOLD
%2 = tail call i32 @mallopt(i32 %1, i32 1048576)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ yogrt_set_remaining(int);
int iyogrt_set_remaining__(int *seconds) {
  yogrt_set_remaining(*seconds);
  return *seconds;
}


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

x86 assembly (clang, -O2):
<iyogrt_set_remaining__>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <yogrt_set_remaining@plt>
mov    (%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @iyogrt_set_remaining__(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @yogrt_set_remaining(i32 %2)
%4 = load i32, i32* %0
ret i32 %4
}
/* Variables and functions */
double fabs(double);
double user_func_1(double x) { return fabs(x); }


x86 assembly (clang, -O0):
<user_func_1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_func_1>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @user_func_1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @user_func_1(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
int clip(char value, int lower, int upper) {
  if (value >= upper) {
    return (int)upper - 1;
  } else if (value < lower) {
    return (int)lower;
  } else {
    return (int)value;
  }
}


x86 assembly (clang, -O0):
<clip>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsbl -0x5(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     112b <clip+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114a <clip+0x4a>
movsbl -0x5(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1143 <clip+0x43>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <clip+0x4a>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip>:
cmp    %esi,%edi
cmovge %edi,%esi
lea    -0x1(%rdx),%eax
cmp    %edx,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clip(i8 signext %0, i32 %1, i32 %2) {
%4 = sext i8 %0 to i32
%5 = icmp slt i32 %4, %2
%6 = add nsw i32 %2, -1
%7 = icmp slt i32 %4, %1
%8 = select i1 %7, i32 %1, i32 %4
%9 = select i1 %5, i32 %8, i32 %6
ret i32 %9
}
int fcntl(int fd, int cmd, long arg) { return 0; }


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

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

LLVM IR (-O0):
define i32 @fcntl(i32 %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @fcntl(i32 %0, i32 %1, i64 %2) {
ret i32 0
}
int isLeap(int y) { return !(y % 4) && y % 100 || !(y % 400); }


x86 assembly (clang, -O0):
<isLeap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <isLeap+0x34>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    114a <isLeap+0x4a>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeap>:
test   $0x3,%dil
jne    112c <isLeap+0x2c>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%eax
sub    %ecx,%edx
je     112c <isLeap+0x2c>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isLeap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ]
ret i32 %12
}
void BN_get_params(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_get_params() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glb_error(char *);
int glbSetFilter(double filter) {
  glb_error("Function glbSetFilter is deprecated.");
  return -10;
}


x86 assembly (clang, -O0):
<glbSetFilter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xedc(%rip),%rdi
call   1030 <glb_error@plt>
mov    $0xfffffff6,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glbSetFilter>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <glb_error@plt>
mov    $0xfffffff6,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Function glbSetFilter is deprecated.\00"
define i32 @glbSetFilter(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @glb_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 -10
}

LLVM IR (-O2):
@.str = [37 x i8] c"Function glbSetFilter is deprecated.\00"
define i32 @glbSetFilter(double %0) {
%2 = tail call i32 @glb_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 -10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, int);
void han_putc(int ucs, FILE *f) {
  fprintf(f, "%c%c%c", 0xE0 + (ucs >> 12), 0x80 + ((ucs >> 6) & 0x3F),
          0x80 + (ucs & 0x3F));
}


x86 assembly (clang, -O0):
<han_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
sar    $0xc,%edx
add    $0xe0,%edx
mov    -0x4(%rbp),%ecx
sar    $0x6,%ecx
and    $0x3f,%ecx
add    $0x80,%ecx
mov    -0x4(%rbp),%r8d
and    $0x3f,%r8d
add    $0x80,%r8d
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<han_putc>:
mov    %rsi,%rax
mov    %edi,%edx
sar    $0xc,%edx
add    $0xe0,%edx
mov    %edi,%ecx
shr    $0x6,%ecx
and    $0x3f,%ecx
or     $0x80,%ecx
and    $0x3f,%edi
lea    0x80(%rdi),%r8d
lea    0xec3(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%c%c%c\00"
define void @han_putc(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %3
%7 = ashr i32 %6, 12
%8 = add nsw i32 224, %7
%9 = load i32, i32* %3
%10 = ashr i32 %9, 6
%11 = and i32 %10, 63
%12 = add nsw i32 128, %11
%13 = load i32, i32* %3
%14 = and i32 %13, 63
%15 = add nsw i32 128, %14
%16 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %12, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c%c%c\00"
define void @han_putc(i32 %0, i32* nocapture %1) {
%3 = ashr i32 %0, 12
%4 = add nsw i32 %3, 224
%5 = lshr i32 %0, 6
%6 = and i32 %5, 63
%7 = or i32 %6, 128
%8 = and i32 %0, 63
%9 = or i32 %8, 128
%10 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %9)
ret void
}
void local_irq_enable(void) { __asm__ __volatile__("sti" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @local_irq_enable() {
tail call void asm sideeffect "sti", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int INT_MIN;
int test9(int x) {
  int y = INT_MIN;
  int z = 0x1234;
  return (x + y) ^ z;
}


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1234,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
add    (%rcx),%eax
xor    $0x1234,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @test9(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @INT_MIN
store i32 %5, i32* %3
store i32 4660, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = xor i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @test9(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = add nsw i32 %2, %0
%4 = xor i32 %3, 4660
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ flush_all();
void vdfs_reset() { flush_all(); }


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

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

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

LLVM IR (-O2):
define void @vdfs_reset() {
%1 = tail call i32 (...) @flush_all()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ dopr(char *, size_t, char const *, int /*<<< orphan*/);
int strlen(char *);
int mutt_vsnprintf(char *str, size_t count, const char *fmt, va_list args) {
  str[0] = 0;
  dopr(str, count, fmt, args);
  return (strlen(str));
}


x86 assembly (clang, -O0):
<mutt_vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <dopr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutt_vsnprintf>:
push   %rbx
mov    %rdi,%rbx
movb   $0x0,(%rdi)
call   1040 <dopr@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @mutt_vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 0, i8* %10
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @dopr(i8* %11, i64 %12, i8* %13, i32 %14)
%16 = load i8*, i8** %5
%17 = call i32 @strlen(i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @mutt_vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
store i8 0, i8* %0
%5 = tail call i32 @dopr(i8* %0, i64 %1, i8* %2, i32 %3)
%6 = tail call i32 @strlen(i8* %0)
ret i32 %6
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double get_native_time(void) {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return (double)ts.tv_sec + (double)ts.tv_nsec / 1e9;
}


x86 assembly (clang, -O0):
<get_native_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec2(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_native_time>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xec3(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define double @get_native_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+09
%11 = fadd double %6, %10
ret double %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define double @get_native_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+09
%12 = fadd double %11, %7
ret double %12
}
__attribute__((always_)) double brotli_min_double(double a, double b) {
  return a < b ? a : b;
}


x86 assembly (clang, -O0):
<brotli_min_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <brotli_min_double+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <brotli_min_double+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<brotli_min_double>:
minsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @brotli_min_double(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int write_unique_word_list_to_csv_file(char *file_name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @write_unique_word_list_to_csv_file(i8* nocapture readnone %0) {
ret i32 0
}
int xflush(void *fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xflush(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
void sudp_close_socket(int *fd) {
  assert(fd != NULL);
  close(*fd);
  *fd = -1;
}


x86 assembly (clang, -O0):
<sudp_close_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%rax
movl   $0xffffffff,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sudp_close_socket>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    (%rbx),%edi
call   1030 <close@plt>
movl   $0xffffffff,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sudp_close_socket(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 @close(i32 %8)
%10 = load i32*, i32** %2
store i32 -1, i32* %10
ret void
}

LLVM IR (-O2):
define void @sudp_close_socket(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* %0
%6 = tail call i32 @close(i32 %5)
store i32 -1, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ meat_time_align_range_to_month(long, long, long *const,
                                                  long *const);
void meat_time_single_month_range(signed long int i_now,
                                  signed long int *const pi_begin,
                                  signed long int *const pi_end) {
  meat_time_align_range_to_month(i_now, i_now, pi_begin, pi_end);
}


x86 assembly (clang, -O0):
<meat_time_single_month_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <meat_time_align_range_to_month@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meat_time_single_month_range>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <meat_time_align_range_to_month@plt>

LLVM IR (-O0):
define void @meat_time_single_month_range(i64 %0, i64* %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i64*
store i64 %0, i64* %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %4
%9 = load i64*, i64** %5
%10 = load i64*, i64** %6
%11 = call i32 @meat_time_align_range_to_month(i64 %7, i64 %8, i64* %9, i64* %10)
ret void
}

LLVM IR (-O2):
define void @meat_time_single_month_range(i64 %0, i64* %1, i64* %2) {
%4 = tail call i32 @meat_time_align_range_to_month(i64 %0, i64 %0, i64* %1, i64* %2)
ret void
}
void INT_Excep_PERIB_INTB147(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB147() {
ret void
}
void _falmbGenericDrawImageString() { return; }


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

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

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

LLVM IR (-O2):
define void @_falmbGenericDrawImageString() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ pthread_cancel(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void _thread_delete(void *thread) {
  pthread_cancel(*(pthread_t *)thread);
  pthread_join(*(pthread_t *)thread, NULL);
  free(thread);
}


x86 assembly (clang, -O0):
<_thread_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1050 <pthread_cancel@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_join@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_thread_delete>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1050 <pthread_cancel@plt>
mov    (%rbx),%edi
xor    %esi,%esi
call   1040 <pthread_join@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @_thread_delete(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @pthread_cancel(i32 %5)
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = call i32 @pthread_join(i32 %9, i32* null)
%11 = load i8*, i8** %2
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @_thread_delete(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @pthread_cancel(i32 %3)
%5 = load i32, i32* %2
%6 = tail call i32 @pthread_join(i32 %5, i32* null)
%7 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
__attribute__((__weak__, __always___)) int softboundmpx_strcmp(const char *s1,
                                                               const char *s2) {
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<softboundmpx_strcmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_strcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int str_len(char *str) {
  unsigned int i = 0;
  int strlen = 0;
  while (str[i] != '\0') {
    strlen++;
    i++;
  }
  return strlen;
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1141 <str_len+0x41>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <str_len+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
cmpb   $0x0,(%rdi)
je     111c <str_len+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <str_len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %6, %4 ]
ret i32 %12
}
long _doesntModifyGlobals() {
  long EV_a;
  long EV_b;
  EV_a = 1;
  EV_b = 2;
  return (EV_a + EV_b);
}


x86 assembly (clang, -O0):
<_doesntModifyGlobals>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
movq   $0x2,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_doesntModifyGlobals>:
mov    $0x3,%eax
ret

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

LLVM IR (-O2):
define i64 @_doesntModifyGlobals() {
ret i64 3
}
int fun100() { return 100; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x64,%eax
ret

LLVM IR (-O0):
define i32 @fun100() {
ret i32 100
}

LLVM IR (-O2):
define i32 @fun100() {
ret i32 100
}