xunge/DecIR huggingface dataset:
int test_imm_08uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x08 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_08uint64_lowword_reg>:
test   $0x8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_08uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 8
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int __toupper_impl(int);
int toupper(int c) { return __toupper_impl(c); }


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

x86 assembly (clang, -O2):
<toupper>:
jmp    1030 <__toupper_impl@plt>

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i32 @__toupper_impl(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
int /*<<< orphan*/ tests_delete_file(char *);
void tests_delete_fragment_file(unsigned file_number) {
  char file_name[256];
  sprintf(file_name, "fragment_%u", file_number);
  tests_delete_file(file_name);
}


x86 assembly (clang, -O0):
<tests_delete_fragment_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec1(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <tests_delete_file@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tests_delete_fragment_file>:
push   %rbx
sub    $0x100,%rsp
mov    %edi,%edx
lea    0xecf(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <tests_delete_file@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"fragment_%u\00"
define void @tests_delete_fragment_file(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i32 @tests_delete_file(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"fragment_%u\00"
define void @tests_delete_fragment_file(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @tests_delete_file(i8* %3)
ret void
}
/* Variables and functions */
bool __dbg_hw_info(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @__dbg_hw_info() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *, char);
void epilog(char name) { emitln("EPILOG %c", name); }


x86 assembly (clang, -O0):
<epilog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <emitln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epilog>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <emitln@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"EPILOG %c\00"
define void @epilog(i8 signext %0) {
%2 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_sym_num(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int i;
  for (i = 95859 + 1; !is_sym_num(i); i++) {
  }
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x17674,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <is_sym_num@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115a <main+0x3a>
jmp    116d <main+0x4d>
jmp    115f <main+0x3f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    -0x14(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x17673,%ebx
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <is_sym_num@plt>
test   %eax,%eax
je     1130 <main+0x10>
lea    0xebb(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 95860, i32* %6
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %6
%9 = call i32 @is_sym_num(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %16
12: ; preds = %7
br label %13
13: ; preds = %12
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
br label %7
16: ; preds = %7
%17 = load i32, i32* %6
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 95860, %2 ], [ %7, %3 ]
%5 = tail call i32 @is_sym_num(i32 %4)
%6 = icmp eq i32 %5, 0
%7 = add nuw nsw i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void errmess(const char *message) {
  printf("%s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<errmess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errmess>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @errmess(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int qsortDoubleComp(const void *lhs, const void *rhs) {
  double lhsNum, rhsNum;
  lhsNum = *((double *)lhs);
  rhsNum = *((double *)rhs);
  if (lhsNum < rhsNum) {
    return -1;
  } else if (lhsNum > rhsNum) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<qsortDoubleComp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <qsortDoubleComp+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <qsortDoubleComp+0x69>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1162 <qsortDoubleComp+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <qsortDoubleComp+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsortDoubleComp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @qsortDoubleComp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void GC_with_callee_saves_pushed(void) {}


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

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

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

LLVM IR (-O2):
define void @GC_with_callee_saves_pushed() {
ret void
}
float fahrenheit_to_celsius(float celsius) {
  return 32 + (celsius * 180.0) / 100.0;
}


x86 assembly (clang, -O0):
<fahrenheit_to_celsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xef6(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrenheit_to_celsius>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahrenheit_to_celsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 1.800000e+02
%6 = fdiv double %5, 1.000000e+02
%7 = fadd double 3.200000e+01, %6
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @fahrenheit_to_celsius(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 1.800000e+02
%4 = fdiv double %3, 1.000000e+02
%5 = fadd double %4, 3.200000e+01
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
double ceil(double);
double ssceil(double a) { return ceil(a); }


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

x86 assembly (clang, -O2):
<ssceil>:
jmp    1030 <ceil@plt>

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

LLVM IR (-O2):
define double @ssceil(double %0) {
%2 = tail call double @llvm.ceil.f64(double %0)
ret double %2
}
void gdk_window_unmaximize() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_unmaximize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void ndpi_regerror(char *s) { printf("<3>Regexp: %s\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"<3>Regexp: %s\0A\00"
define void @ndpi_regerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int isatty(int _fd) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
ret i32 1
}
/* Type definitions */
struct sockaddr_storage {
  int ss_family;
};
struct sockaddr_in {
  int dummy;
};
typedef int socklen_t;

/* Variables and functions */
#define AF_INET 128
int /*<<< orphan*/ EAFNOSUPPORT;
int /*<<< orphan*/ errno;
socklen_t kcn_sockaddr_len(const struct sockaddr_storage *ss) {
  switch (ss->ss_family) {
  case AF_INET:
    return sizeof(struct sockaddr_in);
  default:
    errno = EAFNOSUPPORT;
    return -1;
  }
}


x86 assembly (clang, -O0):
<kcn_sockaddr_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sub    $0x80,%eax
jne    112a <kcn_sockaddr_len+0x2a>
jmp    111e <kcn_sockaddr_len+0x1e>
movl   $0x4,-0x4(%rbp)
jmp    1143 <kcn_sockaddr_len+0x43>
mov    0x2ea7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea6(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcn_sockaddr_len>:
mov    $0x4,%eax
cmpl   $0x80,(%rdi)
je     1124 <kcn_sockaddr_len+0x24>
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
mov    0x2ec3(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.sockaddr_storage = type { i32 }
@EAFNOSUPPORT = global i32 0
@errno = global i32 0
define i32 @kcn_sockaddr_len(%struct.sockaddr_storage* %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_storage*
store %struct.sockaddr_storage* %0, %struct.sockaddr_storage** %3
%4 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %3
%5 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %4, i32 0, i32 0
%6 = load i32, i32* %5
switch i32 %6, label %8 [
i32 128, label %7
]
7: ; preds = %1
store i32 4, i32* %2
br label %10
8: ; preds = %1
%9 = load i32, i32* @EAFNOSUPPORT
store i32 %9, i32* @errno
store i32 -1, i32* %2
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr_storage = type { i32 }
@EAFNOSUPPORT = global i32 0
@errno = global i32 0
define i32 @kcn_sockaddr_len(%struct.sockaddr_storage* nocapture %0) {
%2 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 128
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = load i32, i32* @EAFNOSUPPORT
store i32 %6, i32* @errno
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 4, %1 ]
ret i32 %8
}
void mmc_pwrseq_power_off(struct mmc_host *host) {}


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

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

LLVM IR (-O0):
%struct.mmc_host = type opaque
define void @mmc_pwrseq_power_off(%struct.mmc_host* %0) {
%2 = alloca %struct.mmc_host*
store %struct.mmc_host* %0, %struct.mmc_host** %2
ret void
}

LLVM IR (-O2):
%struct.mmc_host = type opaque
define void @mmc_pwrseq_power_off(%struct.mmc_host* nocapture %0) {
ret void
}
void log_error(const char *message) {
  (void)message;
  return;
}


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

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

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

LLVM IR (-O2):
define void @log_error(i8* nocapture %0) {
ret void
}
char *Salloc(str)
char *str;
{
  char *strcpy();
  if (str == 0)
    str = "";
  return strcpy(Malloc((unsigned)strlen(str) + 1), str);
}


x86 assembly (clang, -O0):
<Salloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1152 <Salloc+0x22>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
add    $0x1,%edi
mov    $0x0,%al
call   1030 <Malloc@plt>
movslq %eax,%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Salloc>:
push   %rbx
test   %rdi,%rdi
lea    0xec5(%rip),%rbx
cmovne %rdi,%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%edi
xor    %eax,%eax
call   1030 <Malloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <strcpy@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @Salloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %1
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = trunc i64 %8 to i32
%10 = add i32 %9, 1
%11 = call i32 (i32, ...) bitcast (i32 (...)* @Malloc to i32 (i32, ...)*)(i32 %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = load i8*, i8** %2
%15 = call i8* @strcpy(i8* %13, i8* %14)
ret i8* %15
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @Salloc(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%5 = trunc i64 %4 to i32
%6 = add i32 %5, 1
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @Malloc to i32 (i32, ...)*)(i32 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i8* @strcpy(i8* dereferenceable(1) %9, i8* dereferenceable(1) %3)
ret i8* %9
}
void CompilerWriteFence() { __asm__ volatile("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @CompilerWriteFence() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ zamijeni(char *);
int main() {
  char *recenica;
  while (1) {
    recenica = (char *)malloc((200 + 1) * sizeof(char));
    scanf(" %[^\n]", recenica);
    zamijeni(recenica);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xc9,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <zamijeni@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    $0xc9,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <zamijeni@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
@.str = [7 x i8] c" %[^\0A]\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i64 @malloc(i32 201)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @zamijeni(i8* %8)
br label %3
}

LLVM IR (-O2):
@.str = [7 x i8] c" %[^\0A]\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 @malloc(i32 201)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @zamijeni(i8* %3)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void I2SIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  DEBUG_ASSERT((ulIntFlags & (0x00000020 | 0x00000010 | 0x00000002 |
                              0x00000001)) == ulIntFlags);
  (*((volatile unsigned long *)(ulBase + 0x00000C10))) &= ~ulIntFlags;
}


x86 assembly (clang, -O0):
<I2SIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0x33,%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0xc10(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0xc10(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SIntDisable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x40054000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xffffffffffffffcc,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
not    %rbx
and    %rbx,0xc10(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @I2SIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074085888
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = and i64 %9, 51
%11 = load i64, i64* %4
%12 = icmp eq i64 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @DEBUG_ASSERT(i32 %13)
%15 = load i64, i64* %4
%16 = xor i64 %15, -1
%17 = load i64, i64* %3
%18 = add i64 %17, 3088
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = and i64 %20, %16
store volatile i64 %21, i64* %19
ret void
}

LLVM IR (-O2):
define void @I2SIntDisable(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074085888
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = and i64 %1, 51
%7 = icmp eq i64 %6, %1
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = xor i64 %1, -1
%11 = add i64 %0, 3088
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %10
store volatile i64 %14, i64* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int strlen1(char *);
int main(void) {
  int tamanho = 0;
  char string[30];
  printf("Insira uma String:\n");
  scanf("%[^\n]s", string);
  tamanho = strlen1(string);
  printf("O tamanho da String é:%d\n", tamanho);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <strlen1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
lea    0xea8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen1@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Insira uma String:\0A\00"
@.str.1 = [7 x i8] c"%[^\0A]s\00"
@.str.2 = [27 x i8] c"O tamanho da String \C3\A9:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%7 = call i32 @strlen1(i8* %6)
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%[^\0A]s\00"
@.str.2 = [27 x i8] c"O tamanho da String \C3\A9:%d\0A\00"
@str = [19 x i8] c"Insira uma String:\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @strlen1(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
int /*<<< orphan*/ VibrationAnalysisOutputHandle();
void VibrationAnalysisOutputRequestUpdate() {
  UAVObjRequestUpdate(VibrationAnalysisOutputHandle());
}


x86 assembly (clang, -O0):
<VibrationAnalysisOutputRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VibrationAnalysisOutputHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VibrationAnalysisOutputRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <VibrationAnalysisOutputHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @VibrationAnalysisOutputRequestUpdate() {
%1 = call i32 (...) @VibrationAnalysisOutputHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @VibrationAnalysisOutputRequestUpdate() {
%1 = tail call i32 (...) @VibrationAnalysisOutputHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
char *baseFilename(char const *const);
char *strrchr(char const *const, char);
extern const char *fileExtension(const char *const fileName) {
  const char *extension;
  const char *pDelimiter = NULL;
  const char *const base = baseFilename(fileName);
  if (pDelimiter == NULL)
    pDelimiter = strrchr(base, '.');
  if (pDelimiter == NULL)
    extension = "";
  else
    extension = pDelimiter + 1;
  return extension;
}


x86 assembly (clang, -O0):
<fileExtension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <baseFilename@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <fileExtension+0x3e>
mov    -0x20(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1179 <fileExtension+0x59>
lea    0xe90(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1185 <fileExtension+0x65>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExtension>:
push   %rax
call   1030 <baseFilename@plt>
mov    %rax,%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
lea    0xebf(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @fileExtension(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %4
%6 = load i8*, i8** %2
%7 = call i8* @baseFilename(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %5
%12 = call i8* @strrchr(i8* %11, i8 signext 46)
store i8* %12, i8** %4
br label %13
13: ; preds = %10, %1
%14 = load i8*, i8** %4
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %17
16: ; preds = %13
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %20
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8* %19, i8** %3
br label %20
20: ; preds = %17, %16
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @fileExtension(i8* %0) {
%2 = tail call i8* @baseFilename(i8* %0)
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %2, i8 signext 46)
%4 = icmp eq i8* %3, null
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %5
ret i8* %6
}
int MaxFindCopyLength(int len) { return (len < 4096) ? len : 4096; }


x86 assembly (clang, -O0):
<MaxFindCopyLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1000,-0x4(%rbp)
jge    111f <MaxFindCopyLength+0x1f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112c <MaxFindCopyLength+0x2c>
mov    $0x1000,%eax
mov    %eax,-0x8(%rbp)
jmp    112c <MaxFindCopyLength+0x2c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MaxFindCopyLength>:
cmp    $0x1000,%edi
mov    $0x1000,%eax
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @MaxFindCopyLength(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 4096
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i32 [ %6, %5 ], [ 4096, %7 ]
ret i32 %9
}

LLVM IR (-O2):
define i32 @MaxFindCopyLength(i32 %0) {
%2 = icmp slt i32 %0, 4096
%3 = select i1 %2, i32 %0, i32 4096
ret i32 %3
}
/* Variables and functions */
char i2hc10(unsigned char);
char i2hc(unsigned char i) { return i2hc10(i); }


x86 assembly (clang, -O0):
<i2hc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <i2hc10@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2hc>:
jmp    1030 <i2hc10@plt>

LLVM IR (-O0):
define signext i8 @i2hc(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i8 @i2hc10(i8 zeroext %3)
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @i2hc(i8 zeroext %0) {
%2 = tail call signext i8 @i2hc10(i8 zeroext %0)
ret i8 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t evpd_peripheral_qualifier(uint8_t *data) { return data[0] >> 5; }


x86 assembly (clang, -O0):
<evpd_peripheral_qualifier>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<evpd_peripheral_qualifier>:
mov    (%rdi),%eax
sar    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @evpd_peripheral_qualifier(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 5
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ one;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int sockutil_set_tcp_nodelay(int sockfd) {
  int one = 1;
  return setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one));
}


x86 assembly (clang, -O0):
<sockutil_set_tcp_nodelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockutil_set_tcp_nodelay>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @sockutil_set_tcp_nodelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @IPPROTO_TCP
%6 = load i32, i32* @TCP_NODELAY
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret i32 %7
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @sockutil_set_tcp_nodelay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @IPPROTO_TCP
%5 = load i32, i32* @TCP_NODELAY
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}
float reduce(float *input) {
  int i;
  float v = 0;
  for (i = 0; i < 16 * 16 * 16; ++i) {
    v += input[i];
  }
  return v;
}


x86 assembly (clang, -O0):
<reduce>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1000,-0xc(%rbp)
jge    1149 <reduce+0x49>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <reduce+0x17>
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduce>:
xorps  %xmm0,%xmm0
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
addss  (%rdi,%rax,4),%xmm0
addss  0x4(%rdi,%rax,4),%xmm0
addss  0x8(%rdi,%rax,4),%xmm0
addss  0xc(%rdi,%rax,4),%xmm0
addss  0x10(%rdi,%rax,4),%xmm0
addss  0x14(%rdi,%rax,4),%xmm0
addss  0x18(%rdi,%rax,4),%xmm0
addss  0x1c(%rdi,%rax,4),%xmm0
add    $0x8,%rax
cmp    $0x1000,%rax
jne    1110 <reduce+0x10>
ret

LLVM IR (-O0):
define float @reduce(float* %0) {
%2 = alloca float*
%3 = alloca i32
%4 = alloca float
store float* %0, float** %2
store float 0.000000e+00, float* %4
store i32 0, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4096
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load float*, float** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds float, float* %9, i64 %11
%13 = load float, float* %12
%14 = load float, float* %4
%15 = fadd float %14, %13
store float %15, float* %4
br label %16
16: ; preds = %8
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
%20 = load float, float* %4
ret float %20
}

LLVM IR (-O2):
define float @reduce(float* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %36, %2 ]
%4 = phi float [ 0.000000e+00, %1 ], [ %35, %2 ]
%5 = getelementptr inbounds float, float* %0, i64 %3
%6 = load float, float* %5
%7 = fadd float %4, %6
%8 = or i64 %3, 1
%9 = getelementptr inbounds float, float* %0, i64 %8
%10 = load float, float* %9
%11 = fadd float %7, %10
%12 = or i64 %3, 2
%13 = getelementptr inbounds float, float* %0, i64 %12
%14 = load float, float* %13
%15 = fadd float %11, %14
%16 = or i64 %3, 3
%17 = getelementptr inbounds float, float* %0, i64 %16
%18 = load float, float* %17
%19 = fadd float %15, %18
%20 = or i64 %3, 4
%21 = getelementptr inbounds float, float* %0, i64 %20
%22 = load float, float* %21
%23 = fadd float %19, %22
%24 = or i64 %3, 5
%25 = getelementptr inbounds float, float* %0, i64 %24
%26 = load float, float* %25
%27 = fadd float %23, %26
%28 = or i64 %3, 6
%29 = getelementptr inbounds float, float* %0, i64 %28
%30 = load float, float* %29
%31 = fadd float %27, %30
%32 = or i64 %3, 7
%33 = getelementptr inbounds float, float* %0, i64 %32
%34 = load float, float* %33
%35 = fadd float %31, %34
%36 = add nuw nsw i64 %3, 8
%37 = icmp eq i64 %36, 4096
br i1 %37, label %38, label %2
38: ; preds = %2
ret float %35
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x26() {
  Assert_real((iscntrl(38) == 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_iscntrl.c",
              195, ("iscntrl should be 0 for &"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x26>:
push   %rax
mov    $0x26,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xc3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for &\00"
define void @t_iscntrl_0x26() {
%1 = call i64 @iscntrl(i32 38)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 195, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for &\00"
define void @t_iscntrl_0x26() {
%1 = tail call i64 @iscntrl(i32 38)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 195, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void whileLoop(int n) {
  int flag = 0;
  while (!flag) {
    printf("%d\n", (n));
    n++;
    if (n >= 10)
      break;
  }
}


x86 assembly (clang, -O0):
<whileLoop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <whileLoop+0x28>
jmp    1164 <whileLoop+0x54>
mov    -0x4(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     115f <whileLoop+0x4f>
jmp    1164 <whileLoop+0x54>
jmp    1122 <whileLoop+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whileLoop>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
mov    $0x9,%ebp
cmovge %edi,%ebp
add    $0x1,%ebp
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1130 <whileLoop+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @whileLoop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = icmp sge i32 %13, 10
br i1 %14, label %15, label %16
15: ; preds = %8
br label %17
16: ; preds = %8
br label %4
17: ; preds = %15, %4
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @whileLoop(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 9)
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ %0, %1 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add i32 %4, 1
%7 = icmp eq i32 %4, %2
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ backing_planes;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
unsigned long get_XWindowAttributes_backing_planes(void *_p) {
  return (unsigned long)((XWindowAttributes *)_p)->backing_planes;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XWindowAttributes_backing_planes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XWindowAttributes_backing_planes(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int my_strlen(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char s[10000];
  scanf("%s", s);
  printf("%d", my_strlen(s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x2720(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x2720(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x2710,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <my_strlen@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x2710,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10000 x i8]
%2 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @my_strlen(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
int get_window_size() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_window_size() {
ret i32 0
}
int main() {
  int a = 1, b = 2;
  if (a == b) {
    return 1;
  }
  if (a > b) {
    return 2;
  }
  if (a < b) {
    return 3;
  }
  return 0xdefea7;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1131 <main+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1168 <main+0x68>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1149 <main+0x49>
movl   $0x2,-0x4(%rbp)
jmp    1168 <main+0x68>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <main+0x61>
movl   $0x3,-0x4(%rbp)
jmp    1168 <main+0x68>
movl   $0xdefea7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %1
br label %19
8: ; preds = %0
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 2, i32* %1
br label %19
13: ; preds = %8
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 3, i32* %1
br label %19
18: ; preds = %13
store i32 14614183, i32* %1
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog_name) {
  printf("Usage: %s -i <phone_ip> -p <phone_password>\n", prog_name);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"Usage: %s -i <phone_ip> -p <phone_password>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [45 x i8] c"Usage: %s -i <phone_ip> -p <phone_password>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}