xunge/DecIR huggingface dataset:
/* Variables and functions */
int IndexOfChar_internal(char *, char const, char const, char const);
int IndexOfCharExceptWithin(char *input, const char target,
                            const char openSymbolWithin,
                            const char closeSymbolWithin) {
  return IndexOfChar_internal(input, target, openSymbolWithin,
                              closeSymbolWithin);
}


x86 assembly (clang, -O0):
<IndexOfCharExceptWithin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%cl
mov    -0xa(%rbp),%al
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0xb(%rbp),%ecx
call   1030 <IndexOfChar_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IndexOfCharExceptWithin>:
jmp    1030 <IndexOfChar_internal@plt>

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

LLVM IR (-O2):
define i32 @IndexOfCharExceptWithin(i8* %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = tail call i32 @IndexOfChar_internal(i8* %0, i8 signext %1, i8 signext %2, i8 signext %3)
ret i32 %5
}
/* Variables and functions */
size_t __simplePNG__final_deflate_block_size(size_t);
size_t __simplePNG__deflate_block_count(size_t size) {
  size_t num_deflate_blocks = size / 0xffff;
  size_t def_final_block_size = __simplePNG__final_deflate_block_size(size);
  if (def_final_block_size > 0)
    num_deflate_blocks++;
  return num_deflate_blocks;
}


x86 assembly (clang, -O0):
<__simplePNG__deflate_block_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xffff,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__simplePNG__final_deflate_block_size@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    1152 <__simplePNG__deflate_block_count+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__simplePNG__deflate_block_count>:
push   %rbx
movabs $0x8000800080008001,%rcx
mov    %rdi,%rax
mul    %rcx
mov    %rdx,%rbx
shr    $0xf,%rbx
call   1030 <__simplePNG__final_deflate_block_size@plt>
cmp    $0x1,%rax
sbb    $0xffffffffffffffff,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__simplePNG__deflate_block_count(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = udiv i64 %5, 65535
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = call i64 @__simplePNG__final_deflate_block_size(i64 %7)
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = icmp ugt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i64, i64* %3
%13 = add i64 %12, 1
store i64 %13, i64* %3
br label %14
14: ; preds = %11, %1
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
define i64 @__simplePNG__deflate_block_count(i64 %0) {
%2 = udiv i64 %0, 65535
%3 = tail call i64 @__simplePNG__final_deflate_block_size(i64 %0)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i64
%6 = add nuw nsw i64 %2, %5
ret i64 %6
}
void Load_SFX(unsigned char i, const char *directory) {}


x86 assembly (clang, -O0):
<Load_SFX>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @Load_SFX(i8 zeroext %0, i8* nocapture %1) {
ret void
}
void Dummy_isr(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Dummy_isr>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Dummy_isr+0x9>
jmp    1109 <Dummy_isr+0x9>

x86 assembly (clang, -O2):
<Dummy_isr>:
jmp    1100 <Dummy_isr>

LLVM IR (-O0):
define void @Dummy_isr() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Dummy_isr() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
main() {
  float y;
  int x;
  y = 10.8;
  x = y;
  fprintf(stdout, "%d\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0xa,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
store float 0x40259999A0000000, float* %1
%3 = load float, float* %1
%4 = fptosi float %3 to i32
store i32 %4, i32* %2
%5 = load i32, i32* @stdout
%6 = load i32, i32* %2
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int f235(int *);
int f236(int *p) { return f235(p); }


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

x86 assembly (clang, -O2):
<f236>:
jmp    1030 <f235@plt>

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

LLVM IR (-O2):
define i32 @f236(i32* %0) {
%2 = tail call i32 @f235(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void show_version() { fprintf(stderr, "dl version 0.0.1\n"); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"dl version 0.0.1\0A\00"
define void @show_version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"dl version 0.0.1\0A\00"
define void @show_version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("你好，我叫柴田望洋！\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\E4\BD\A0\E5\A5\BD\EF\BC\8C\E6\88\91\E5\8F\AB\E6\9F\B4\E7\94\B0\E6\9C\9B\E6\B4\8B\EF\BC\81\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"\E4\BD\A0\E5\A5\BD\EF\BC\8C\E6\88\91\E5\8F\AB\E6\9F\B4\E7\94\B0\E6\9C\9B\E6\B4\8B\EF\BC\81\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _WXFree(void *original, int line, char *file) { free(original); }


x86 assembly (clang, -O0):
<_WXFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_WXFree(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @_WXFree(i8* nocapture %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @free(i8* %0)
ret void
}
int req_riva_power_on_lock(char *driver_name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @req_riva_power_on_lock(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *dlink_get_first();
void *peek() { return dlink_get_first(); }


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

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

LLVM IR (-O0):
define i8* @peek() {
%1 = call i8* (...) @dlink_get_first()
ret i8* %1
}

LLVM IR (-O2):
define i8* @peek() {
%1 = tail call i8* (...) @dlink_get_first()
ret i8* %1
}
void gtk_tree_drag_source_drag_data_delete() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_drag_source_drag_data_delete() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(unsigned int);
void test9(unsigned a) {
  switch (a) {
    if (a)
      foo(a + 5);
    else
      foo(a);
  case 1:
  case 2:
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x1,%eax
ja     1120 <test9+0x20>
jmp    111b <test9+0x1b>
jmp    1125 <test9+0x25>
jmp    1125 <test9+0x25>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test9(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 1, label %4
i32 2, label %4
]
4: ; preds = %1, %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
define void @test9(i32 %0) {
ret void
}
void hal_adc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @hal_adc_init() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_read_quaddobl_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(560, a, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<syscon_read_quaddobl_Laurent_system>:
mov    $0x230,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @syscon_read_quaddobl_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 560, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
double sqrt(double);
double _user_func_3(double x, double y, double z) {
  return sqrt(x * x + y * y + z * z);
}


x86 assembly (clang, -O0):
<_user_func_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_user_func_3>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1136 <_user_func_3+0x26>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
ret
movapd %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @_user_func_3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = load double, double* %6
%14 = load double, double* %6
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double %12)
%16 = call double @sqrt(double %15)
ret double %16
}

LLVM IR (-O2):
define double @_user_func_3(double %0, double %1, double %2) {
%4 = fmul double %1, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = tail call double @sqrt(double %6)
ret double %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void QEIDisable(uint32_t ui32Base) {
  ASSERT((ui32Base == 0x4002C000) || (ui32Base == 0x4002D000));
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) &= ~(0x00000001);
}


x86 assembly (clang, -O0):
<QEIDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x4002c000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113a <QEIDisable+0x2a>
cmpl   $0x4002d000,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIDisable>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x4002c000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
andl   $0xfffffffe,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @QEIDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073922048
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1073926144
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @ASSERT(i32 %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 0
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = and i32 %16, -2
store volatile i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @QEIDisable(i32 %0) {
%2 = and i32 %0, -4097
%3 = icmp eq i32 %2, 1073922048
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = sext i32 %0 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, -2
store volatile i32 %9, i32* %7
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(scalar_t__ const *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
char *timetostr(const time_t time) {
  static char s[29];
  if (time != 0)
    strftime(s, 29, "%a %b %d %T %Y %Z", localtime(&time));
  else
    s[0] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<timetostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115f <timetostr+0x3f>
lea    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%ecx
lea    0x2ef7(%rip),%rdi
mov    $0x1d,%esi
lea    0xeab(%rip),%rdx
call   1040 <strftime@plt>
jmp    1166 <timetostr+0x46>
movb   $0x0,0x2eda(%rip)
lea    0x2ed3(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timetostr>:
push   %rax
mov    %rdi,(%rsp)
test   %rdi,%rdi
je     114e <timetostr+0x2e>
mov    %rsp,%rdi
call   1030 <localtime@plt>
lea    0x2f07(%rip),%rdi
lea    0xec0(%rip),%rdx
mov    $0x1d,%esi
mov    %eax,%ecx
call   1040 <strftime@plt>
jmp    1155 <timetostr+0x35>
movb   $0x0,0x2eeb(%rip)
lea    0x2ee4(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@timetostr.s = internal global [29 x i8] zeroinitializer
@.str = [18 x i8] c"%a %b %d %T %Y %Z\00"
define i8* @timetostr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @localtime(i64* %2)
%7 = call i32 @strftime(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @timetostr.s, i64 0, i64 0), i32 29, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %9
8: ; preds = %1
store i8 0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @timetostr.s, i64 0, i64 0)
br label %9
9: ; preds = %8, %5
ret i8* getelementptr inbounds ([29 x i8], [29 x i8]* @timetostr.s, i64 0, i64 0)
}

LLVM IR (-O2):
@timetostr.s = internal global [29 x i8] zeroinitializer
@.str = [18 x i8] c"%a %b %d %T %Y %Z\00"
define i8* @timetostr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = icmp eq i64 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = call i32 @localtime(i64* %2)
%6 = call i32 @strftime(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @timetostr.s, i64 0, i64 0), i32 29, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %8
7: ; preds = %1
store i8 0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @timetostr.s, i64 0, i64 0)
br label %8
8: ; preds = %7, %4
ret i8* getelementptr inbounds ([29 x i8], [29 x i8]* @timetostr.s, i64 0, i64 0)
}
int test_07(unsigned char x, int y, int z) { return (x << 3) & 111 ? y : z; }


x86 assembly (clang, -O0):
<test_07>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x3,%eax
and    $0x6f,%eax
cmp    $0x0,%eax
je     112e <test_07+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <test_07+0x34>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_07>:
mov    %esi,%eax
test   $0xd,%dil
cmove  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_07(i8 zeroext %0, i32 %1, i32 %2) {
%4 = and i8 %0, 13
%5 = icmp eq i8 %4, 0
%6 = select i1 %5, i32 %2, i32 %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ VDP_drawText(char *, int, int);
int /*<<< orphan*/ VDP_init();
int /*<<< orphan*/ showBusAddressErrorDump(int);
void _addresserror_callback() {
  VDP_init();
  VDP_drawText("ADDRESS ERROR !", 10, 3);
  showBusAddressErrorDump(5);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_addresserror_callback>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VDP_init@plt>
lea    0xebe(%rip),%rdi
mov    $0xa,%esi
mov    $0x3,%edx
call   1040 <VDP_drawText@plt>
mov    $0x5,%edi
call   1050 <showBusAddressErrorDump@plt>
jmp    115b <_addresserror_callback+0x2b>

x86 assembly (clang, -O2):
<_addresserror_callback>:
push   %rax
xor    %eax,%eax
call   1030 <VDP_init@plt>
lea    0xec1(%rip),%rdi
mov    $0xa,%esi
mov    $0x3,%edx
call   1040 <VDP_drawText@plt>
mov    $0x5,%edi
call   1050 <showBusAddressErrorDump@plt>
nopl   0x0(%rax,%rax,1)
jmp    1160 <_addresserror_callback+0x30>

LLVM IR (-O0):
@.str = [16 x i8] c"ADDRESS ERROR !\00"
define void @_addresserror_callback() {
%1 = call i32 (...) @VDP_init()
%2 = call i32 @VDP_drawText(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10, i32 3)
%3 = call i32 @showBusAddressErrorDump(i32 5)
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
@.str = [16 x i8] c"ADDRESS ERROR !\00"
define void @_addresserror_callback() {
%1 = tail call i32 (...) @VDP_init()
%2 = tail call i32 @VDP_drawText(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10, i32 3)
%3 = tail call i32 @showBusAddressErrorDump(i32 5)
br label %4
4: ; preds = %0, %4
br label %4
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
struct __uportsys_sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int __uportsys_bind(int, struct __uportsys_sockaddr const *, int /*<<< orphan*/,
                    int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
int bind(int sd, const struct sockaddr *addr, socklen_t addr_len) {
  return __uportsys_bind(sd, (const struct __uportsys_sockaddr *)addr, addr_len,
                         &errno);
}


x86 assembly (clang, -O0):
<bind>:
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
mov    0x2ead(%rip),%rcx
call   1030 <__uportsys_bind@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <__uportsys_bind@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
%struct.__uportsys_sockaddr = type { i32 }
@errno = global i32 0
define i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = bitcast %struct.sockaddr* %8 to %struct.__uportsys_sockaddr*
%10 = load i32, i32* %6
%11 = call i32 @__uportsys_bind(i32 %7, %struct.__uportsys_sockaddr* %9, i32 %10, i32* @errno)
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
%struct.__uportsys_sockaddr = type { i32 }
@errno = global i32 0
define i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = bitcast %struct.sockaddr* %1 to %struct.__uportsys_sockaddr*
%5 = tail call i32 @__uportsys_bind(i32 %0, %struct.__uportsys_sockaddr* %4, i32 %2, i32* @errno)
ret i32 %5
}
int leapyear(int cent, int year) {
  cent *= 100;
  year += cent;
  if ((year % 4 == 0) && (year % 100 != 0))
    return 1;
  else if (year % 400 == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<leapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
imul   $0x64,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114e <leapyear+0x4e>
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114e <leapyear+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <leapyear+0x75>
mov    -0xc(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116e <leapyear+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <leapyear+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapyear>:
imul   $0x64,%edi,%ecx
add    %esi,%ecx
test   $0x3,%cl
jne    1130 <leapyear+0x30>
movslq %ecx,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%edx
mov    %ecx,%esi
mov    $0x1,%eax
sub    %edx,%esi
je     1130 <leapyear+0x30>
ret
imul   $0xc28f5c29,%ecx,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @leapyear(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 100
%4 = add nsw i32 %3, %1
%5 = and i32 %4, 3
%6 = icmp ne i32 %5, 0
%7 = srem i32 %4, 100
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = srem i32 %4, 400
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %10, %2
%15 = phi i32 [ 1, %2 ], [ %13, %10 ]
ret i32 %15
}
char *langRomTypeDram() { return "Panasonic DRAM"; }


x86 assembly (clang, -O0):
<langRomTypeDram>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeDram>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Panasonic DRAM\00"
define i8* @langRomTypeDram() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"Panasonic DRAM\00"
define i8* @langRomTypeDram() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
int iGetAMDTempK10(struct pci_dev **devs, int numDevs, int average) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define i32 @iGetAMDTempK10(%struct.pci_dev** %0, i32 %1, i32 %2) {
%4 = alloca %struct.pci_dev**
%5 = alloca i32
%6 = alloca i32
store %struct.pci_dev** %0, %struct.pci_dev*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @iGetAMDTempK10(%struct.pci_dev** nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int stat(const char *__restrict filename, struct stat *__restrict buf) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @stat(i8* noalias %0, %struct.stat* noalias %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @stat(i8* noalias nocapture readnone %0, %struct.stat* noalias nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
struct fiemap_extent {
  int dummy;
};
struct fiemap {
  int dummy;
};

/* Variables and functions */
unsigned fiemap_size_to_count(size_t array_size) {
  return (array_size - sizeof(struct fiemap)) / sizeof(struct fiemap_extent);
}


x86 assembly (clang, -O0):
<fiemap_size_to_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x4,%rax
shr    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiemap_size_to_count>:
movabs $0x3fffffffc,%rax
add    %rdi,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i32 @fiemap_size_to_count(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 4
%5 = udiv i64 %4, 4
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @fiemap_size_to_count(i64 %0) {
%2 = add i64 %0, 17179869180
%3 = lshr i64 %2, 2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct Main {
  int dummy;
};

/* Variables and functions */
struct Main *Main_alloc();
int Main_init(struct Main *, int, char const **);
int /*<<< orphan*/ Main_release(struct Main *);
int main(int theCount, const char *theTokens[]) {
  struct Main *main = Main_alloc();
  int result = Main_init(main, theCount, theTokens);
  Main_release(main);
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <Main_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <Main_init@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <Main_release@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <Main_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <Main_init@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <Main_release@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.Main = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.Main*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call %struct.Main* (...) @Main_alloc()
store %struct.Main* %8, %struct.Main** %6
%9 = load %struct.Main*, %struct.Main** %6
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @Main_init(%struct.Main* %9, i32 %10, i8** %11)
store i32 %12, i32* %7
%13 = load %struct.Main*, %struct.Main** %6
%14 = call i32 @Main_release(%struct.Main* %13)
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
%struct.Main = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = tail call %struct.Main* (...) @Main_alloc()
%4 = tail call i32 @Main_init(%struct.Main* %3, i32 %0, i8** %1)
%5 = tail call i32 @Main_release(%struct.Main* %3)
ret i32 %4
}
/* Variables and functions */
int strlen(char str[]) {
  int i;
  for (i = 0; str[i] != 0; i++) {
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <strlen+0x37>
jmp    1129 <strlen+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int test_imm_6Dint8_mem(signed char *val) {
  return ((*val) & (-0x6D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Dint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -109
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello bha!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello bha!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Hello bha!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void WBINVD() {}


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

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

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

LLVM IR (-O2):
define void @WBINVD() {
ret void
}
/* Variables and functions */
int foo6();
int main() { return foo6(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo6()
ret i32 %1
}
__attribute__((always_)) int ffs(int x) {
  int r;
  asm("bsfl %1,%0\n\t"
      "cmovzl %2,%0"
      : "=r"(r)
      : "rm"(x), "r"(-1));
  return r + 1;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xffffffff,%eax
bsf    -0xc(%rbp),%eax
cmove  %eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
mov    %edi,-0x4(%rsp)
mov    $0xffffffff,%eax
bsf    -0x4(%rsp),%eax
cmove  %eax,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ffs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "bsfl $1,$0\0A\09cmovzl $2,$0", "=r,rm,r,~{dirflag},~{fpsr},~{flags}"(i32 %4, i32 -1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = tail call i32 asm "bsfl $1,$0\0A\09cmovzl $2,$0", "=r,rm,r,~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 -1)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *const, char *);
int mmalloc_set_output_fd(int /*<<< orphan*/ *);
int mmalloc_set_output_file(const char *const filename) {
  FILE *f;
  f = fopen(filename, "a");
  if (f != NULL) {
    return mmalloc_set_output_fd(f);
  }
  return 0;
}


x86 assembly (clang, -O0):
<mmalloc_set_output_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115c <mmalloc_set_output_file+0x3c>
mov    -0x18(%rbp),%rdi
call   1030 <mmalloc_set_output_fd@plt>
mov    %eax,-0x4(%rbp)
jmp    1163 <mmalloc_set_output_file+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmalloc_set_output_file>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     113b <mmalloc_set_output_file+0x1b>
mov    %rax,%rdi
pop    %rax
jmp    1030 <mmalloc_set_output_fd@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define i32 @mmalloc_set_output_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @mmalloc_set_output_fd(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ O_NONBLOCK;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fcntl(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void set_block(int n) {
  if (fcntl(0, F_SETFL, O_NONBLOCK) < 0) {
    perror("Fcntl F_SETFL");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<set_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   1030 <fcntl@plt>
cmp    $0x0,%rax
jge    1178 <set_block+0x48>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_block>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   1030 <fcntl@plt>
test   %rax,%rax
js     1151 <set_block+0x21>
pop    %rax
ret
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@.str = [14 x i8] c"Fcntl F_SETFL\00"
@EXIT_FAILURE = global i32 0
define void @set_block(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @F_SETFL
%4 = load i32, i32* @O_NONBLOCK
%5 = call i64 @fcntl(i32 0, i32 %3, i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@.str = [14 x i8] c"Fcntl F_SETFL\00"
@EXIT_FAILURE = global i32 0
define void @set_block(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @O_NONBLOCK
%4 = tail call i64 @fcntl(i32 0, i32 %2, i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int f3(int i) {
  assert(i % 3 == 0);
  assert(i % 5 == 0);
  return i;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rbx
mov    %edi,%ebx
imul   $0xaaaaaaab,%edi,%eax
add    $0x2aaaaaaa,%eax
xor    %edi,%edi
cmp    $0x55555555,%eax
setb   %dil
call   1030 <assert@plt>
imul   $0xcccccccd,%ebx,%eax
add    $0x19999999,%eax
xor    %edi,%edi
cmp    $0x33333333,%eax
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 3
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = srem i32 %8, 5
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @f3(i32 returned %0) {
%2 = srem i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = srem i32 %0, 5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret i32 %0
}
/* Variables and functions */
char *pack4(char *, char *);
char *pack8(char *dst, char *src) { return pack4(pack4(dst, src), src + 4); }


x86 assembly (clang, -O0):
<pack8>:
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 <pack4@plt>
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
call   1030 <pack4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack8>:
push   %rbx
mov    %rsi,%rbx
call   1030 <pack4@plt>
add    $0x4,%rbx
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <pack4@plt>

LLVM IR (-O0):
define i8* @pack8(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 i8* @pack4(i8* %5, i8* %6)
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 4
%10 = call i8* @pack4(i8* %7, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @pack8(i8* %0, i8* %1) {
%3 = tail call i8* @pack4(i8* %0, i8* %1)
%4 = getelementptr inbounds i8, i8* %1, i64 4
%5 = tail call i8* @pack4(i8* %3, i8* %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, char const *);
void yyerror(const char *str) { error("%s", str); }


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 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *shmat(int, void *, int /*<<< orphan*/);
char *shareContentInMemoryId(int memoryId) {
  return shmat(memoryId, (void *)0, 0);
}


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

x86 assembly (clang, -O2):
<shareContentInMemoryId>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <shmat@plt>

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

LLVM IR (-O2):
define i8* @shareContentInMemoryId(i32 %0) {
%2 = tail call i8* @shmat(i32 %0, i8* null, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x8d() {
  Assert_real((isodigit(141) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              710, ("isodigit should be 0 for 0x8d"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x8d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8d,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2c6,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x8d>:
push   %rax
mov    $0x8d,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2c6,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x8d\00"
define void @t_isodigit_0x8d() {
%1 = call i64 @isodigit(i32 141)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 710, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x8d\00"
define void @t_isodigit_0x8d() {
%1 = tail call i64 @isodigit(i32 141)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 710, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}