xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 7, 10);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0xa,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0xa,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 10)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 10)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ swap(int *, int *);
void sort2(int *x, int *y) {
  if (*x > *y) {
    swap(x, y);
  }
}


x86 assembly (clang, -O0):
<sort2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    113f <sort2+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort2>:
mov    (%rdi),%eax
cmp    (%rsi),%eax
jle    111b <sort2+0xb>
jmp    1030 <swap@plt>
ret

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

LLVM IR (-O2):
define void @sort2(i32* %0, i32* %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @swap(i32* %0, i32* %1)
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
struct nouveau_channel {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ OUT_RING(struct nouveau_channel *, int);
void BEGIN_NI04(struct nouveau_channel *chan, int subc, int mthd, int size) {
  OUT_RING(chan, 0x40000000 | (subc << 13) | (size << 18) | mthd);
}


x86 assembly (clang, -O0):
<BEGIN_NI04>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0xd,%esi
or     $0x40000000,%esi
mov    -0x14(%rbp),%eax
shl    $0x12,%eax
or     %eax,%esi
or     -0x10(%rbp),%esi
call   1030 <OUT_RING@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BEGIN_NI04>:
shl    $0xd,%esi
shl    $0x12,%ecx
or     %edx,%esi
or     %ecx,%esi
or     $0x40000000,%esi
jmp    1030 <OUT_RING@plt>

LLVM IR (-O0):
%struct.nouveau_channel = type { i32 }
define void @BEGIN_NI04(%struct.nouveau_channel* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.nouveau_channel*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.nouveau_channel* %0, %struct.nouveau_channel** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.nouveau_channel*, %struct.nouveau_channel** %5
%10 = load i32, i32* %6
%11 = shl i32 %10, 13
%12 = or i32 1073741824, %11
%13 = load i32, i32* %8
%14 = shl i32 %13, 18
%15 = or i32 %12, %14
%16 = load i32, i32* %7
%17 = or i32 %15, %16
%18 = call i32 @OUT_RING(%struct.nouveau_channel* %9, i32 %17)
ret void
}

LLVM IR (-O2):
%struct.nouveau_channel = type { i32 }
define void @BEGIN_NI04(%struct.nouveau_channel* %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %1, 13
%6 = shl i32 %3, 18
%7 = or i32 %5, %2
%8 = or i32 %7, %6
%9 = or i32 %8, 1073741824
%10 = tail call i32 @OUT_RING(%struct.nouveau_channel* %0, i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size) {
  return (errno = ENOSYS, -1);
}


x86 assembly (clang, -O0):
<fgetxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb5(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetxattr>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fgetxattr(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* @ENOSYS
store i32 %9, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fgetxattr(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}
/* Type definitions */
struct timeb {
  long time;
  long millitm;
};

/* Variables and functions */
int /*<<< orphan*/ ftime(struct timeb *);
long ms_elapsed(struct timeb before) {
  struct timeb now;
  ftime(&now);
  long before_ms = 1000L * before.time + before.millitm;
  long now_ms = 1000L * now.time + now.millitm;
  return now_ms - before_ms;
}


x86 assembly (clang, -O0):
<ms_elapsed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <ftime@plt>
imul   $0x3e8,-0x10(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
imul   $0x3e8,-0x20(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
sub    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_elapsed>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
call   1030 <ftime@plt>
mov    0x8(%rsp),%rcx
mov    0x10(%rsp),%rax
sub    %rbx,%rcx
imul   $0x3e8,%rcx,%rcx
sub    %r14,%rax
add    %rcx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeb = type { i64, i64 }
define i64 @ms_elapsed(i64 %0, i64 %1) {
%3 = alloca %struct.timeb
%4 = alloca %struct.timeb
%5 = alloca i64
%6 = alloca i64
%7 = bitcast %struct.timeb* %3 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = call i32 @ftime(%struct.timeb* %4)
%11 = getelementptr inbounds %struct.timeb, %struct.timeb* %3, i32 0, i32 0
%12 = load i64, i64* %11
%13 = mul nsw i64 1000, %12
%14 = getelementptr inbounds %struct.timeb, %struct.timeb* %3, i32 0, i32 1
%15 = load i64, i64* %14
%16 = add nsw i64 %13, %15
store i64 %16, i64* %5
%17 = getelementptr inbounds %struct.timeb, %struct.timeb* %4, i32 0, i32 0
%18 = load i64, i64* %17
%19 = mul nsw i64 1000, %18
%20 = getelementptr inbounds %struct.timeb, %struct.timeb* %4, i32 0, i32 1
%21 = load i64, i64* %20
%22 = add nsw i64 %19, %21
store i64 %22, i64* %6
%23 = load i64, i64* %6
%24 = load i64, i64* %5
%25 = sub nsw i64 %23, %24
ret i64 %25
}

LLVM IR (-O2):
%struct.timeb = type { i64, i64 }
define i64 @ms_elapsed(i64 %0, i64 %1) {
%3 = alloca %struct.timeb
%4 = bitcast %struct.timeb* %3 to i8*
%5 = call i32 @ftime(%struct.timeb* %3)
%6 = getelementptr inbounds %struct.timeb, %struct.timeb* %3, i64 0, i32 0
%7 = load i64, i64* %6
%8 = getelementptr inbounds %struct.timeb, %struct.timeb* %3, i64 0, i32 1
%9 = load i64, i64* %8
%10 = sub i64 %7, %0
%11 = mul i64 %10, 1000
%12 = sub i64 %9, %1
%13 = add i64 %12, %11
ret i64 %13
}
char *strCat(char *dest, char *source) {
  char *ptr = dest;
  while (*ptr++ != '\0')
    ;
  ptr--;
  while ((*ptr++ = *source++) != '\0')
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strCat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1134 <strCat+0x34>
jmp    1114 <strCat+0x14>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1173 <strCat+0x73>
jmp    1140 <strCat+0x40>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strCat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strCat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strCat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strCat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
char *_Locale_monetary_name(const void *__DUMMY_PAR1, char *__DUMMY_PAR) {
  return 0;
}


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

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

LLVM IR (-O0):
define i8* @_Locale_monetary_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_Locale_monetary_name(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int /*<<< orphan*/);
void TOSH_CLR_YELLOW_LED_PIN() { clear_io_bit(0x34, 0); }


x86 assembly (clang, -O0):
<TOSH_CLR_YELLOW_LED_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
xor    %esi,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_YELLOW_LED_PIN>:
mov    $0x34,%edi
xor    %esi,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_YELLOW_LED_PIN() {
%1 = call i32 @clear_io_bit(i32 52, i32 0)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_YELLOW_LED_PIN() {
%1 = tail call i32 @clear_io_bit(i32 52, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ al_sun(double);
double sin(int /*<<< orphan*/);
double sin_al(double t) { return sin(al_sun(t)); }


x86 assembly (clang, -O0):
<sin_al>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <al_sun@plt>
mov    %eax,%edi
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin_al>:
push   %rax
call   1040 <al_sun@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @sin_al(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @al_sun(double %3)
%5 = call double @sin(i32 %4)
ret double %5
}

LLVM IR (-O2):
define double @sin_al(double %0) {
%2 = tail call i32 @al_sun(double %0)
%3 = tail call double @sin(i32 %2)
ret double %3
}
void collect_vertex(void *curvert, double x, double y, double z) {
  (*(float **)curvert)[0] = x;
  (*(float **)curvert)[1] = y;
  (*(float **)curvert)[2] = z;
  (*(float **)curvert) += 3;
}


x86 assembly (clang, -O0):
<collect_vertex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movss  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movss  %xmm0,0x4(%rax)
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0xc,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<collect_vertex>:
cvtsd2ss %xmm0,%xmm0
mov    (%rdi),%rax
movss  %xmm0,(%rax)
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
movss  %xmm0,0x4(%rax)
movss  %xmm1,0x8(%rax)
add    $0xc,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @collect_vertex(i8* %0, double %1, double %2, double %3) {
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i8* %0, i8** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %6
%10 = fptrunc double %9 to float
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to float**
%13 = load float*, float** %12
%14 = getelementptr inbounds float, float* %13, i64 0
store float %10, float* %14
%15 = load double, double* %7
%16 = fptrunc double %15 to float
%17 = load i8*, i8** %5
%18 = bitcast i8* %17 to float**
%19 = load float*, float** %18
%20 = getelementptr inbounds float, float* %19, i64 1
store float %16, float* %20
%21 = load double, double* %8
%22 = fptrunc double %21 to float
%23 = load i8*, i8** %5
%24 = bitcast i8* %23 to float**
%25 = load float*, float** %24
%26 = getelementptr inbounds float, float* %25, i64 2
store float %22, float* %26
%27 = load i8*, i8** %5
%28 = bitcast i8* %27 to float**
%29 = load float*, float** %28
%30 = getelementptr inbounds float, float* %29, i64 3
store float* %30, float** %28
ret void
}

LLVM IR (-O2):
define void @collect_vertex(i8* nocapture %0, double %1, double %2, double %3) {
%5 = fptrunc double %1 to float
%6 = bitcast i8* %0 to float**
%7 = load float*, float** %6
store float %5, float* %7
%8 = fptrunc double %2 to float
%9 = getelementptr inbounds float, float* %7, i64 1
store float %8, float* %9
%10 = fptrunc double %3 to float
%11 = getelementptr inbounds float, float* %7, i64 2
store float %10, float* %11
%12 = getelementptr inbounds float, float* %7, i64 3
store float* %12, float** %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rate(long long, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, long long *);
void migrate_query1() {
  long long t;
  scanf("%lld", &t);
  printf("%d\n", rate(t, 0));
}


x86 assembly (clang, -O0):
<migrate_query1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <rate@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<migrate_query1>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rdi
xor    %esi,%esi
call   1030 <rate@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @migrate_query1() {
%1 = alloca i64
%2 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%3 = load i64, i64* %1
%4 = call i32 @rate(i64 %3, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @migrate_query1() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @rate(i64 %4, i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
char *flu_rtrim(int /*<<< orphan*/);
int /*<<< orphan*/ strdup(char const *);
char *flu_strrtrim(const char *s) { return flu_rtrim(strdup(s)); }


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

x86 assembly (clang, -O2):
<flu_strrtrim>:
push   %rax
call   1040 <strdup@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <flu_rtrim@plt>

LLVM IR (-O0):
define i8* @flu_strrtrim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strdup(i8* %3)
%5 = call i8* @flu_rtrim(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @flu_strrtrim(i8* %0) {
%2 = tail call i32 @strdup(i8* %0)
%3 = tail call i8* @flu_rtrim(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
void showVersion() {
  printf("%s %s\n", "watchman", "0.1.0");
  exit(0);
}


x86 assembly (clang, -O0):
<showVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
lea    0xed7(%rip),%rdx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<showVersion>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
lea    0xeda(%rip),%rdx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [9 x i8] c"watchman\00"
@.str.2 = [6 x i8] c"0.1.0\00"
define void @showVersion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [9 x i8] c"watchman\00"
@.str.2 = [6 x i8] c"0.1.0\00"
define void @showVersion() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__21__IO__selectIOFunc();
void HplMsp430Usart0P__URXD__selectIOFunc(void) {
  HplMsp430GeneralIOP__21__IO__selectIOFunc();
}


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

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

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

LLVM IR (-O2):
define void @HplMsp430Usart0P__URXD__selectIOFunc() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__21__IO__selectIOFunc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void alarm_handler(int signum) { printf("Five seconds passed!\n"); }


x86 assembly (clang, -O0):
<alarm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"Five seconds passed!\0A\00"
define void @alarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Five seconds passed!\00"
define void @alarm_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
int special(int ch) {
  switch (ch) {
  case 0x22:
  case 0x2E:
  case 0x3B:
  case 0x5C:
  case 0x40:
  case 0x24:
    return (1);
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<special>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x22,%eax
je     1170 <special+0x70>
jmp    111b <special+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x24,%eax
je     1170 <special+0x70>
jmp    112c <special+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x2e,%eax
je     1170 <special+0x70>
jmp    113d <special+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x3b,%eax
je     1170 <special+0x70>
jmp    114e <special+0x4e>
mov    -0xc(%rbp),%eax
sub    $0x40,%eax
je     1170 <special+0x70>
jmp    115f <special+0x5f>
mov    -0xc(%rbp),%eax
sub    $0x5c,%eax
jne    117c <special+0x7c>
jmp    1170 <special+0x70>
movl   $0x1,-0x4(%rbp)
jmp    1183 <special+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<special>:
add    $0xffffffde,%edi
cmp    $0x3a,%edi
ja     111e <special+0x1e>
mov    $0x1,%eax
movabs $0x400000042001005,%rcx
bt     %rdi,%rcx
jae    111e <special+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @special(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 34, label %5
i32 46, label %5
i32 59, label %5
i32 92, label %5
i32 64, label %5
i32 36, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @special(i32 %0) {
switch i32 %0, label %2 [
i32 34, label %3
i32 46, label %3
i32 59, label %3
i32 92, label %3
i32 64, label %3
i32 36, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
char *EatSpaceTillEOL(char *in) {
  while (*in && strchr(" \t", *in))
    in++;
  return in;
}


x86 assembly (clang, -O0):
<EatSpaceTillEOL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     114e <EatSpaceTillEOL+0x3e>
mov    -0x8(%rbp),%rax
lea    0xec4(%rip),%rdi
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115e <EatSpaceTillEOL+0x4e>
jmp    116f <EatSpaceTillEOL+0x5f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <EatSpaceTillEOL+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EatSpaceTillEOL>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     114c <EatSpaceTillEOL+0x3c>
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
je     114c <EatSpaceTillEOL+0x3c>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <EatSpaceTillEOL+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \09\00"
define i8* @EatSpaceTillEOL(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
define i8* @EatSpaceTillEOL(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, int);
void test_additive_operators(int lhs, int rhs) {
  __emit_expression_range(0, lhs + rhs);
  __emit_expression_range(0, lhs - rhs);
}


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

x86 assembly (clang, -O2):
<test_additive_operators>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
lea    (%r14,%rbx,1),%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
sub    %r14d,%ebx
xor    %edi,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_additive_operators(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = call i32 @__emit_expression_range(i32 0, i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = call i32 @__emit_expression_range(i32 0, i32 %11)
ret void
}

LLVM IR (-O2):
define void @test_additive_operators(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @__emit_expression_range(i32 0, i32 %3)
%5 = sub nsw i32 %0, %1
%6 = tail call i32 @__emit_expression_range(i32 0, i32 %5)
ret void
}
int track_get_frame() {}


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

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

LLVM IR (-O0):
define i32 @track_get_frame() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @track_get_frame() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256d;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm256_cvtpd_ps(int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm256_cvtps_pd(int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_rcp_ps(int /*<<< orphan*/ const);
__m256d RCP(const __m256d d) {
  const __m128 b = _mm256_cvtpd_ps(d);
  const __m128 rcp = _mm_rcp_ps(b);
  __m256d x0 = _mm256_cvtps_pd(rcp);
  return x0;
}


x86 assembly (clang, -O0):
<RCP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <_mm256_cvtpd_ps@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_mm_rcp_ps@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <_mm256_cvtps_pd@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RCP>:
push   %rax
call   1050 <_mm256_cvtpd_ps@plt>
mov    %eax,%edi
call   1030 <_mm_rcp_ps@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <_mm256_cvtps_pd@plt>

LLVM IR (-O0):
define i32 @RCP(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @_mm256_cvtpd_ps(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @_mm_rcp_ps(i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 @_mm256_cvtps_pd(i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @RCP(i32 %0) {
%2 = tail call i32 @_mm256_cvtpd_ps(i32 %0)
%3 = tail call i32 @_mm_rcp_ps(i32 %2)
%4 = tail call i32 @_mm256_cvtps_pd(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ hal_io_set_amp(int /*<<< orphan*/);
void hal_cc25xx_enter_rxmode(void) { hal_io_set_amp(0); }


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

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

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

LLVM IR (-O2):
define void @hal_cc25xx_enter_rxmode() {
%1 = tail call i32 @hal_io_set_amp(i32 0)
ret void
}
int rtl930x_mac_port_ctrl(int p) { return (0x3268) + (p << 6); }


x86 assembly (clang, -O0):
<rtl930x_mac_port_ctrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x6,%eax
add    $0x3268,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl930x_mac_port_ctrl>:
shl    $0x6,%edi
lea    0x3268(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rtl930x_mac_port_ctrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 6
%5 = add nsw i32 12904, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rtl930x_mac_port_ctrl(i32 %0) {
%2 = shl i32 %0, 6
%3 = add nsw i32 %2, 12904
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int mp3_check_header(uint32_t header) {
  if ((header & 0xffe00000) != 0xffe00000)
    return -1;
  if ((header & (3 << 17)) != (1 << 17))
    return -1;
  if ((header & (0xf << 12)) == 0xf << 12)
    return -1;
  if ((header & (3 << 10)) == 3 << 10)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<mp3_check_header>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffe00000,%eax
cmp    $0xffe00000,%eax
je     1126 <mp3_check_header+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <mp3_check_header+0x8a>
mov    -0x8(%rbp),%eax
and    $0x60000,%eax
cmp    $0x20000,%eax
je     1145 <mp3_check_header+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <mp3_check_header+0x8a>
mov    -0x8(%rbp),%eax
and    $0xf000,%eax
cmp    $0xf000,%eax
jne    1164 <mp3_check_header+0x64>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <mp3_check_header+0x8a>
mov    -0x8(%rbp),%eax
and    $0xc00,%eax
cmp    $0xc00,%eax
jne    1183 <mp3_check_header+0x83>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <mp3_check_header+0x8a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp3_check_header>:
cmp    $0xffe00000,%edi
setb   %al
mov    %edi,%ecx
and    $0x60000,%ecx
cmp    $0x20000,%ecx
setne  %cl
or     %al,%cl
not    %edi
test   $0xf000,%edi
sete   %al
test   $0xc00,%edi
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
neg    %eax
ret

LLVM IR (-O0):
define i32 @mp3_check_header(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, -2097152
%6 = icmp ne i32 %5, -2097152
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %24
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, 393216
%11 = icmp ne i32 %10, 131072
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %2
br label %24
13: ; preds = %8
%14 = load i32, i32* %3
%15 = and i32 %14, 61440
%16 = icmp eq i32 %15, 61440
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 -1, i32* %2
br label %24
18: ; preds = %13
%19 = load i32, i32* %3
%20 = and i32 %19, 3072
%21 = icmp eq i32 %20, 3072
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -1, i32* %2
br label %24
23: ; preds = %18
store i32 0, i32* %2
br label %24
24: ; preds = %23, %22, %17, %12, %7
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @mp3_check_header(i32 %0) {
%2 = icmp ult i32 %0, -2097152
%3 = and i32 %0, 393216
%4 = icmp ne i32 %3, 131072
%5 = or i1 %2, %4
%6 = and i32 %0, 61440
%7 = icmp eq i32 %6, 61440
%8 = or i1 %7, %5
%9 = and i32 %0, 3072
%10 = icmp eq i32 %9, 3072
%11 = or i1 %10, %8
%12 = sext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ test_spell_hash_add_multi();
int /*<<< orphan*/ test_spell_hash_add_one();
int /*<<< orphan*/ test_spell_hash_dump();
int /*<<< orphan*/ test_spell_hash_get();
int /*<<< orphan*/ test_spell_hash_init();
int /*<<< orphan*/ test_spell_hash_remove();
int /*<<< orphan*/ test_spell_hash_resize();
int /*<<< orphan*/ test_spell_hash_update();
int main(int argc, char **argv) {
  test_spell_hash_init();
  test_spell_hash_add_one();
  test_spell_hash_add_multi();
  test_spell_hash_get();
  test_spell_hash_resize();
  test_spell_hash_update();
  test_spell_hash_dump();
  test_spell_hash_remove();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1080 <test_spell_hash_init@plt>
mov    $0x0,%al
call   1060 <test_spell_hash_add_one@plt>
mov    $0x0,%al
call   1040 <test_spell_hash_add_multi@plt>
mov    $0x0,%al
call   10a0 <test_spell_hash_get@plt>
mov    $0x0,%al
call   1070 <test_spell_hash_resize@plt>
mov    $0x0,%al
call   1090 <test_spell_hash_update@plt>
mov    $0x0,%al
call   1030 <test_spell_hash_dump@plt>
mov    $0x0,%al
call   1050 <test_spell_hash_remove@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <test_spell_hash_init@plt>
xor    %eax,%eax
call   1060 <test_spell_hash_add_one@plt>
xor    %eax,%eax
call   1040 <test_spell_hash_add_multi@plt>
xor    %eax,%eax
call   10a0 <test_spell_hash_get@plt>
xor    %eax,%eax
call   1070 <test_spell_hash_resize@plt>
xor    %eax,%eax
call   1090 <test_spell_hash_update@plt>
xor    %eax,%eax
call   1030 <test_spell_hash_dump@plt>
xor    %eax,%eax
call   1050 <test_spell_hash_remove@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @test_spell_hash_init()
%6 = call i32 (...) @test_spell_hash_add_one()
%7 = call i32 (...) @test_spell_hash_add_multi()
%8 = call i32 (...) @test_spell_hash_get()
%9 = call i32 (...) @test_spell_hash_resize()
%10 = call i32 (...) @test_spell_hash_update()
%11 = call i32 (...) @test_spell_hash_dump()
%12 = call i32 (...) @test_spell_hash_remove()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_spell_hash_init()
%4 = tail call i32 (...) @test_spell_hash_add_one()
%5 = tail call i32 (...) @test_spell_hash_add_multi()
%6 = tail call i32 (...) @test_spell_hash_get()
%7 = tail call i32 (...) @test_spell_hash_resize()
%8 = tail call i32 (...) @test_spell_hash_update()
%9 = tail call i32 (...) @test_spell_hash_dump()
%10 = tail call i32 (...) @test_spell_hash_remove()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _assert_string_equal(char *, int, char *, char *);
void identical_string_copies_should_match() {
  _assert_string_equal(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/jedediah/gospel/refs/heads/master/cgreen/"
      "tests/assertion_tests.c",
      22, "Hello", "Hello");
}


x86 assembly (clang, -O0):
<identical_string_copies_should_match>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x16,%esi
lea    0xf74(%rip),%rcx
mov    %rcx,%rdx
call   1030 <_assert_string_equal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<identical_string_copies_should_match>:
lea    0xee9(%rip),%rdi
lea    0xf7d(%rip),%rcx
mov    $0x16,%esi
mov    %rcx,%rdx
jmp    1030 <_assert_string_equal@plt>

LLVM IR (-O0):
@.str = [155 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jedediah/gospel/refs/heads/master/cgreen/tests/assertion_tests.c\00"
@.str.1 = [6 x i8] c"Hello\00"
define void @identical_string_copies_should_match() {
%1 = call i32 @_assert_string_equal(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [155 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jedediah/gospel/refs/heads/master/cgreen/tests/assertion_tests.c\00"
@.str.1 = [6 x i8] c"Hello\00"
define void @identical_string_copies_should_match() {
%1 = tail call i32 @_assert_string_equal(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int Real2Int(double val) { return (int)val; }


x86 assembly (clang, -O0):
<Real2Int>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Real2Int>:
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @Real2Int(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @Real2Int(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
adrreg0adr1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[10000000]) = (*((int *)11111111)); }


x86 assembly (clang, -O0):
<adrreg0adr1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0xa98ac7,%eax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x2625a00(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0adr1_set>:
mov    0xa98ac7,%eax
mov    %eax,0x2625a00(%r8)
ret

LLVM IR (-O0):
define i32 @adrreg0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* inttoptr (i64 11111111 to i32*)
%15 = load i32*, i32** %12
%16 = getelementptr inbounds i32, i32* %15, i64 10000000
store i32 %14, i32* %16
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @adrreg0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture readnone %5) {
%7 = load i32, i32* inttoptr (i64 11111111 to i32*)
%8 = getelementptr inbounds i32, i32* %4, i64 10000000
store i32 %7, i32* %8
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int square(int x) {
  fprintf(stderr, "I, square, was called!\n");
  return x * x;
}


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
push   %rbx
mov    %edi,%ebx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
call   1030 <fprintf@plt>
imul   %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"I, square, was called!\0A\00"
define i32 @square(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"I, square, was called!\0A\00"
define i32 @square(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = mul nsw i32 %0, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_thread_set_data() {
  printf("NOT IMPLEMENTED:"
         "pa_thread_set_data"
         "\n");
}


x86 assembly (clang, -O0):
<pa_thread_set_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"NOT IMPLEMENTED:pa_thread_set_data\0A\00"
define i32 @pa_thread_set_data() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_thread_set_data\00"
define i32 @pa_thread_set_data() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int yyerror(const char *s) {
  printf("Error: %s\n", s);
  return 1;
}


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

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define i32 @yyerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void wbxml_free(void *memblock) { free(memblock); }


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

x86 assembly (clang, -O2):
<wbxml_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @wbxml_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @wbxml_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct chmessage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void recv_handler(const struct chmessage *message, const void *user_data) {
  const int *fd = (const int *)user_data;
  printf("recv socket fd: %d\n", *fd);
}


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

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

LLVM IR (-O0):
%struct.chmessage = type { i32 }
@.str = [20 x i8] c"recv socket fd: %d\0A\00"
define void @recv_handler(%struct.chmessage* %0, i8* %1) {
%3 = alloca %struct.chmessage*
%4 = alloca i8*
%5 = alloca i32*
store %struct.chmessage* %0, %struct.chmessage** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
%struct.chmessage = type { i32 }
@.str = [20 x i8] c"recv socket fd: %d\0A\00"
define void @recv_handler(%struct.chmessage* nocapture readnone %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int baz(int);
int /*<<< orphan*/ puts(char *);
int bar(int x) {
  puts("in bar");
  return baz(x + 1) + 2;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <baz@plt>
add    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <baz@plt>
add    $0x2,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"in bar\00"
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = call i32 @baz(i32 %5)
%7 = add nsw i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"in bar\00"
define i32 @bar(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = add nsw i32 %0, 1
%4 = tail call i32 @baz(i32 %3)
%5 = add nsw i32 %4, 2
ret i32 %5
}