xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *valloc(int);
int main(void) {
  char *x = NULL;
  printf("before valloc(): x = %p\n", x);
  x = valloc(123);
  printf("after valloc(): x = %p\n", x);
  free(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    $0x7b,%edi
call   1050 <valloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
xor    %esi,%esi
call   1040 <printf@plt>
mov    $0x7b,%edi
call   1050 <valloc@plt>
mov    %rax,%rbx
lea    0xec6(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"before valloc(): x = %p\0A\00"
@.str.1 = [24 x i8] c"after valloc(): x = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i8* @valloc(i32 123)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"before valloc(): x = %p\0A\00"
@.str.1 = [24 x i8] c"after valloc(): x = %p\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* null)
%2 = tail call dereferenceable_or_null(123) i8* @valloc(i32 123)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Variables and functions */
double log(double);
double ucs_log2(double x) { return log(x) / log(2.0); }


x86 assembly (clang, -O0):
<ucs_log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucs_log2>:
push   %rax
call   1030 <log@plt>
divsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ucs_log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = call double @log(double 2.000000e+00)
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @ucs_log2(double %0) {
%2 = tail call double @log(double %0)
%3 = fdiv double %2, 0x3FE62E42FEFA39EF
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ test_livecode_block_comment();
int /*<<< orphan*/ test_livecode_comment_entities();
int /*<<< orphan*/ test_livecode_comments();
int /*<<< orphan*/ test_livecode_empty_comments();
void all_livecode_tests() {
  test_livecode_comments();
  test_livecode_empty_comments();
  test_livecode_block_comment();
  test_livecode_comment_entities();
}


x86 assembly (clang, -O0):
<all_livecode_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_livecode_comments@plt>
mov    $0x0,%al
call   1060 <test_livecode_empty_comments@plt>
mov    $0x0,%al
call   1050 <test_livecode_block_comment@plt>
mov    $0x0,%al
call   1040 <test_livecode_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_livecode_tests>:
push   %rax
xor    %eax,%eax
call   1030 <test_livecode_comments@plt>
xor    %eax,%eax
call   1060 <test_livecode_empty_comments@plt>
xor    %eax,%eax
call   1050 <test_livecode_block_comment@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_livecode_comment_entities@plt>

LLVM IR (-O0):
define void @all_livecode_tests() {
%1 = call i32 (...) @test_livecode_comments()
%2 = call i32 (...) @test_livecode_empty_comments()
%3 = call i32 (...) @test_livecode_block_comment()
%4 = call i32 (...) @test_livecode_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_livecode_tests() {
%1 = tail call i32 (...) @test_livecode_comments()
%2 = tail call i32 (...) @test_livecode_empty_comments()
%3 = tail call i32 (...) @test_livecode_block_comment()
%4 = tail call i32 (...) @test_livecode_comment_entities()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xs2cp(int);
void xs2cp_(int *panelid) { xs2cp(*panelid); }


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

x86 assembly (clang, -O2):
<xs2cp_>:
mov    (%rdi),%edi
jmp    1030 <xs2cp@plt>

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

LLVM IR (-O2):
define void @xs2cp_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @xs2cp(i32 %2)
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IWUSR;
scalar_t__ stat(char const *, struct stat *);
int fsop_path_write_owner(const char *path) {
  struct stat st;
  if (stat(path, &st) < 0)
    return -1;
  return (st.st_mode & S_IWUSR);
}


x86 assembly (clang, -O0):
<fsop_path_write_owner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    113f <fsop_path_write_owner+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <fsop_path_write_owner+0x3e>
mov    -0x18(%rbp),%eax
mov    0x2e9f(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsop_path_write_owner>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    0x2ec8(%rip),%rcx
mov    (%rcx),%ecx
and    (%rsp),%ecx
test   %rax,%rax
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IWUSR = global i32 0
define i32 @fsop_path_write_owner(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %14
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_IWUSR
%13 = and i32 %11, %12
store i32 %13, i32* %2
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IWUSR = global i32 0
define i32 @fsop_path_write_owner(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @S_IWUSR
%9 = and i32 %8, %7
%10 = select i1 %5, i32 -1, i32 %9
ret i32 %10
}
float flt_cmp_lt(float a, float b, float c, float d) { return (a < b) ? c : d; }


x86 assembly (clang, -O0):
<flt_cmp_lt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    113a <flt_cmp_lt+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1144 <flt_cmp_lt+0x44>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt_cmp_lt>:
cmpltss %xmm1,%xmm0
andps  %xmm0,%xmm2
andnps %xmm3,%xmm0
orps   %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define float @flt_cmp_lt(float %0, float %1, float %2, float %3) {
%5 = fcmp olt float %0, %1
%6 = select i1 %5, float %2, float %3
ret float %6
}
void mdns_announce() {}


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

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

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

LLVM IR (-O2):
define void @mdns_announce() {
ret void
}
int sunxi_audio_start(int mode) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sunxi_audio_start(i32 %0) {
ret i32 0
}
int acpi_lid_notifier_register(struct notifier_block *notifier) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @acpi_lid_notifier_register(%struct.notifier_block* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_help(void) {
  printf("limit options:\n"
         "--limit avg                   : max average match rate: default "
         "3/hour"
         "\n"
         "                                [Packets per second unless followed "
         "by \n"
         "                                /sec /minute /hour /day postfixes]\n"
         "--limit-burst number          : number to match in a burst, -1 < "
         "number < 10001,\n"
         "                                default %u\n",
         5);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
lea    0xee9(%rip),%rdi
mov    $0x5,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [350 x i8] c"limit options:\0A--limit avg : max average match rate: default 3/hour\0A [Packets per second unless followed by \0A /sec /minute /hour /day postfixes]\0A--limit-burst number : number to match in a burst, -1 < number < 10001,\0A default %u\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([350 x i8], [350 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}

LLVM IR (-O2):
@.str = [350 x i8] c"limit options:\0A--limit avg : max average match rate: default 3/hour\0A [Packets per second unless followed by \0A /sec /minute /hour /day postfixes]\0A--limit-burst number : number to match in a burst, -1 < number < 10001,\0A default %u\0A\00"
define void @print_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([350 x i8], [350 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}
int test_imm_1Auint16_reg(unsigned short val) {
  return ((val) & (0x1A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Auint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x1a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_1Auint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 26
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_xmlschema_comments() {
  test_parser_verify_parse(
      test_parser_sourcefile("xmlschema", " <!--comment-->"), "xmlschema", "",
      "<!--comment-->", 0);
}


x86 assembly (clang, -O0):
<test_xmlschema_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xebd(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_xmlschema_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xedb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xedb(%rip),%rdx
lea    0xec6(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"xmlschema\00"
@.str.1 = [16 x i8] c" <!--comment-->\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [15 x i8] c"<!--comment-->\00"
define void @test_xmlschema_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"xmlschema\00"
@.str.1 = [16 x i8] c" <!--comment-->\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [15 x i8] c"<!--comment-->\00"
define void @test_xmlschema_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ printf(char *);
void apiDisconnect(int fdSock) {
  0 ? printf("Closing socket\n") : 0;
  close(fdSock);
}


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

x86 assembly (clang, -O2):
<apiDisconnect>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @apiDisconnect(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int open(const char *filename, int mode, ...) { return -1; }


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @open(i8* nocapture readnone %0, i32 %1, ...) {
ret i32 -1
}
int ft_islower(int c) {
  if ('a' <= c && c <= 'z')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     112b <ft_islower+0x2b>
cmpl   $0x7a,-0x8(%rbp)
jg     112b <ft_islower+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1132 <ft_islower+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_islower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 97, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void ft_add_test_case(char **data, char *str) { data[0] = str; }


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

x86 assembly (clang, -O2):
<ft_add_test_case>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @ft_add_test_case(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %3
%7 = getelementptr inbounds i8*, i8** %6, i64 0
store i8* %5, i8** %7
ret void
}

LLVM IR (-O2):
define void @ft_add_test_case(i8** nocapture writeonly %0, i8* %1) {
store i8* %1, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xc5() {
  Assert_real((iscntrl(197) == 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",
              990, ("iscntrl should be 0 for 0xc5"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xc5>:
push   %rax
mov    $0xc5,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3de,%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 = [29 x i8] c"iscntrl should be 0 for 0xc5\00"
define void @t_iscntrl_0xc5() {
%1 = call i64 @iscntrl(i32 197)
%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 990, i8* getelementptr inbounds ([29 x i8], [29 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 = [29 x i8] c"iscntrl should be 0 for 0xc5\00"
define void @t_iscntrl_0xc5() {
%1 = tail call i64 @iscntrl(i32 197)
%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 990, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int sra(int x, int k) {
  int xsrl = (unsigned)x >> k;
  int w = sizeof(int) * 8;
  unsigned tmp = 1 << (w - 1);
  unsigned sign = tmp == (x & tmp);
  int mask = (0 - sign) << (w - k);
  int result = xsrl | mask;
  return result;
}


x86 assembly (clang, -O0):
<sra>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0xc(%rbp)
movl   $0x20,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0x14(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
sub    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sra>:
mov    %esi,%ecx
mov    %edi,%eax
mov    %edi,%edx
sar    $0x1f,%edx
shrd   %cl,%edx,%eax
ret

LLVM IR (-O0):
define i32 @sra(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = lshr i32 %11, %12
store i32 %13, i32* %5
store i32 32, i32* %6
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
%16 = shl i32 1, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %3
%19 = load i32, i32* %7
%20 = and i32 %18, %19
%21 = icmp eq i32 %17, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %8
%23 = load i32, i32* %8
%24 = sub i32 0, %23
%25 = load i32, i32* %6
%26 = load i32, i32* %4
%27 = sub nsw i32 %25, %26
%28 = shl i32 %24, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = or i32 %29, %30
store i32 %31, i32* %10
%32 = load i32, i32* %10
ret i32 %32
}

LLVM IR (-O2):
define i32 @sra(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = ashr i32 %0, 31
%5 = sub nsw i32 32, %1
%6 = shl nsw i32 %4, %5
%7 = or i32 %6, %3
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ printaddr(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
void enumrange(in_addr_t lo, in_addr_t hi) {
  while (lo <= hi) {
    printaddr(lo++);
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<enumrange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1163 <enumrange+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    %eax,%edi
call   1040 <printaddr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1130 <enumrange+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enumrange>:
push   %r14
push   %rbx
push   %rax
cmp    %rsi,%rdi
jg     114b <enumrange+0x2b>
mov    %rsi,%r14
add    $0x1,%r14
lea    0x1(%rdi),%rbx
call   1040 <printaddr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
cmp    %rbx,%r14
jne    1130 <enumrange+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @enumrange(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %5
5: ; preds = %9, %2
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = icmp sle i64 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i64, i64* %3
%11 = add nsw i64 %10, 1
store i64 %11, i64* %3
%12 = trunc i64 %10 to i32
%13 = call i32 @printaddr(i32 %12)
%14 = call i32 @putchar(i8 signext 10)
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @enumrange(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %0, %2 ]
%6 = add i64 %5, 1
%7 = trunc i64 %5 to i32
%8 = tail call i32 @printaddr(i32 %7)
%9 = tail call i32 @putchar(i8 signext 10)
%10 = icmp eq i64 %5, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar_unlocked(int);
void putChar(int c) { putchar_unlocked(c); }


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

x86 assembly (clang, -O2):
<putChar>:
jmp    1030 <putchar_unlocked@plt>

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

LLVM IR (-O2):
define void @putChar(i32 %0) {
%2 = tail call i32 @putchar_unlocked(i32 %0)
ret void
}
int test_imm_99int32_mem(int *val) {
  return ((*val) & (0x99 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_99int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 153
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int create_socket() {
  int sockfd;
  if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    return (0);
  }
  return (sockfd);
}


x86 assembly (clang, -O0):
<create_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1149 <create_socket+0x39>
movl   $0x0,-0x4(%rbp)
jmp    114f <create_socket+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_socket>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <socket@plt>
test   %eax,%eax
cmovs  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @create_socket() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @AF_INET
%4 = load i32, i32* @SOCK_STREAM
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
store i32 %5, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %1
br label %10
8: ; preds = %0
%9 = load i32, i32* %2
store i32 %9, i32* %1
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @create_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
void foo_1_1_1_1_1_1_2_1_2() {}


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

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

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

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

/* Variables and functions */
ssize_t __getline(char **lineptr, size_t *n, FILE *s) {
  *lineptr = NULL;
  *n = 0;
  return 0;
}


x86 assembly (clang, -O0):
<__getline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getline>:
movq   $0x0,(%rdi)
movq   $0x0,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @__getline(i8** nocapture writeonly %0, i64* nocapture writeonly %1, i32* nocapture readnone %2) {
store i8* null, i8** %0
store i64 0, i64* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ leaf();
__attribute__((optimize("omit-frame-pointer"))) void non_leaf_2(void) {
  leaf();
}


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

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

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

LLVM IR (-O2):
define void @non_leaf_2() {
%1 = tail call i32 (...) @leaf()
ret void
}
int readinitdir(const char *dir, int strict) { return -1; }


x86 assembly (clang, -O0):
<readinitdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @readinitdir(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ O_RDWR;
int open(char const *, int /*<<< orphan*/);
int open_testfile(const char *testfile_name) {
  int testfile_descriptor;
  testfile_descriptor = open(testfile_name, O_RDWR);
  if (testfile_descriptor < 0)
    return EXIT_FAILURE;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<open_testfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    114c <open_testfile+0x3c>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <open_testfile+0x48>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_testfile>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
test   %eax,%eax
jns    112c <open_testfile+0x1c>
mov    0x2eae(%rip),%rax
jmp    1133 <open_testfile+0x23>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @open_testfile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDWR
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* @EXIT_SUCCESS
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @open_testfile(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @EXIT_SUCCESS
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int interestingFunc(int a) {
  printf("hai there!\n");
  return a * 2;
}


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

x86 assembly (clang, -O2):
<interestingFunc>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
add    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hai there!\0A\00"
define i32 @interestingFunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
@str = [11 x i8] c"hai there!\00"
define i32 @interestingFunc(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = shl nsw i32 %0, 1
ret i32 %3
}
int foo(unsigned long a) {
  int b = __builtin_clzl(a);
  int c = __builtin_clzl(a);
  if (b == c)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
bsr    %rax,%rax
xor    $0x3f,%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
bsr    %rax,%rax
xor    $0x3f,%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    113e <foo+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <foo+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
%6 = load i64, i64* %3
%7 = call i64 @llvm.ctlz.i64(i64 %6, i1 true)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %4
%9 = load i64, i64* %3
%10 = call i64 @llvm.ctlz.i64(i64 %9, i1 true)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %1
store i32 1, i32* %2
br label %17
16: ; preds = %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @foo(i64 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_205() {
  Assert_real((isqrt(205) == 14),
              "/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/stdlib/isqrt.c",
              1030, ("Integer square root of 205 should be 14"));
}


x86 assembly (clang, -O0):
<t_sqrt_205>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcd,%edi
call   1030 <isqrt@plt>
cmp    $0xe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x406,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_205>:
push   %rax
mov    $0xcd,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x406,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 205 should be 14\00"
define void @t_sqrt_205() {
%1 = call i32 @isqrt(i32 205)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1030, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 205 should be 14\00"
define void @t_sqrt_205() {
%1 = tail call i32 @isqrt(i32 205)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1030, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\c,\q,\y,\v,\z,\w,\e,\1,\2,\3,\4");
  printf("\n,\!,\@,\#");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"c,q,y,\0B,z,w,\1B,\01,\02,\03,\04\00"
@.str.1 = [8 x i8] c"\0A,!,@,#\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"c,q,y,\0B,z,w,\1B,\01,\02,\03,\04\00"
@.str.1 = [8 x i8] c"\0A,!,@,#\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int __syscall5(int call, unsigned long arg0, unsigned long arg1,
               unsigned long arg2, unsigned long arg3, unsigned long arg4) {
  int rc;
  __asm__ volatile(
      "movl %[call], %%eax	\n"
      "movl %[arg0], %%ebx	\n"
      "movl %[arg1], %%ecx	\n"
      "movl %[arg2], %%edx	\n"
      "movl %[arg3], %%edi	\n"
      "movl %[arg4], %%esi	\n"
      "int  %[xnum]		\n"
      "movl %%eax, %[rc]	\n"
      : [rc] "=g"(rc)
      : [call] "g"(call), [arg0] "g"(arg0), [arg1] "g"(arg1), [arg2] "g"(arg2),
        [arg3] "g"(arg3), [arg4] "g"(arg4), [xnum] "i"(0x80)
      : "%eax", "%ebx", "%ecx", "%edx", "%edi", "%esi", "memory");
  return rc;
}


x86 assembly (clang, -O0):
<__syscall5>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0xc(%rbp),%r8d
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    %r8d,-0x40(%rbp)
mov    %rdi,-0x48(%rbp)
mov    %rsi,-0x50(%rbp)
mov    %rdx,-0x58(%rbp)
mov    %rcx,-0x60(%rbp)
mov    %rax,-0x68(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x48(%rbp),%ebx
mov    -0x50(%rbp),%ecx
mov    -0x58(%rbp),%edx
mov    -0x60(%rbp),%edi
mov    -0x68(%rbp),%esi
int    $0x80
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @__syscall5(i32 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i32
store i32 %0, i32* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%14 = load i32, i32* %7
%15 = load i64, i64* %8
%16 = load i64, i64* %9
%17 = load i64, i64* %10
%18 = load i64, i64* %11
%19 = load i64, i64* %12
%20 = load i32, i32* %13
ret i32 %20
}

LLVM IR (-O2):
float f(x, y)
float x;
float y;
{ return x + y; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x10(%rbp)
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cvtsd2ss %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @f(double %0, double %1) {
%3 = alloca float
%4 = alloca float
%5 = fptrunc double %0 to float
%6 = fptrunc double %1 to float
store float %5, float* %3
store float %6, float* %4
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fadd float %7, %8
ret float %9
}

LLVM IR (-O2):
define float @f(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fptrunc double %1 to float
%5 = fadd float %3, %4
ret float %5
}
/* Variables and functions */
int strcmp(void *, void *);
int compareData(void *d1, void *d2) { return strcmp(d1, d2); }


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

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

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

LLVM IR (-O2):
define i32 @compareData(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void FREE(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @FREE(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_unsigned_int(unsigned int const k1,
                                           unsigned int const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_EQUALS_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_unsigned_int>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_EQUALS_unsigned_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_unsigned_int(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void nn_log_teardown() { closelog(); }


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

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

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

LLVM IR (-O2):
define void @nn_log_teardown() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
void pf(const char *fname, void *data, int len) {
  printf("'%s', size %d\n", fname, len);
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"'%s', size %d\0A\00"
define void @pf(i8* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret void
}
void UART_init(void) {
  (*((volatile unsigned long *)0xE002C000)) =
      ((*((volatile unsigned long *)0xE002C000)) & ~(0xf << 0)) | (0x5 << 0);
  (*((volatile unsigned char *)0xE000C008)) = 0x7;
  (*((volatile unsigned char *)0xE000C00C)) = 0x83;
  (*((volatile unsigned char *)0xE000C000)) =
      (unsigned char)(unsigned short)((60000000 / 9600) / 16);
  (*((volatile unsigned char *)0xE000C004)) =
      (unsigned short)((60000000 / 9600) / 16) >> 8;
  (*((volatile unsigned char *)0xE000C00C)) = 0x3;
  (*((volatile unsigned long *)0xE000C004)) = 0x00;
}


x86 assembly (clang, -O0):
<UART_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe002c000,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffff0,%rcx
or     $0x5,%rcx
mov    $0xe002c000,%eax
mov    %rcx,(%rax)
mov    $0xe000c008,%eax
movb   $0x7,(%rax)
mov    $0xe000c00c,%eax
movb   $0x83,(%rax)
mov    $0xe000c000,%eax
movb   $0x86,(%rax)
mov    $0xe000c004,%eax
movb   $0x1,(%rax)
mov    $0xe000c00c,%eax
movb   $0x3,(%rax)
mov    $0xe000c004,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART_init>:
mov    $0xe000c004,%eax
mov    0x1fffc(%rax),%rcx
and    $0xfffffffffffffff0,%rcx
or     $0x5,%rcx
mov    %rcx,0x1fffc(%rax)
movb   $0x7,0x4(%rax)
movb   $0x83,0x8(%rax)
movb   $0x86,-0x4(%rax)
movb   $0x1,(%rax)
movb   $0x3,0x8(%rax)
movq   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @UART_init() {
%1 = load volatile i64, i64* inttoptr (i64 3758276608 to i64*)
%2 = and i64 %1, -16
%3 = or i64 %2, 5
store volatile i64 %3, i64* inttoptr (i64 3758276608 to i64*)
store volatile i8 7, i8* inttoptr (i64 3758145544 to i8*)
store volatile i8 -125, i8* inttoptr (i64 3758145548 to i8*)
store volatile i8 -122, i8* inttoptr (i64 3758145536 to i8*)
store volatile i8 1, i8* inttoptr (i64 3758145540 to i8*)
store volatile i8 3, i8* inttoptr (i64 3758145548 to i8*)
store volatile i64 0, i64* inttoptr (i64 3758145540 to i64*)
ret void
}

LLVM IR (-O2):
define void @UART_init() {
%1 = load volatile i64, i64* inttoptr (i64 3758276608 to i64*)
%2 = and i64 %1, -16
%3 = or i64 %2, 5
store volatile i64 %3, i64* inttoptr (i64 3758276608 to i64*)
store volatile i8 7, i8* inttoptr (i64 3758145544 to i8*)
store volatile i8 -125, i8* inttoptr (i64 3758145548 to i8*)
store volatile i8 -122, i8* inttoptr (i64 3758145536 to i8*)
store volatile i8 1, i8* inttoptr (i64 3758145540 to i8*)
store volatile i8 3, i8* inttoptr (i64 3758145548 to i8*)
store volatile i64 0, i64* inttoptr (i64 3758145540 to i64*)
ret void
}
/* Type definitions */
struct diag_l0_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ diag_tty_break(struct diag_l0_device *, int);
int diag_l0_vwtool_fastinit(struct diag_l0_device *dl0d) {
  diag_tty_break(dl0d, 25);
  return 0;
}


x86 assembly (clang, -O0):
<diag_l0_vwtool_fastinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x19,%esi
call   1030 <diag_tty_break@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diag_l0_vwtool_fastinit>:
push   %rax
mov    $0x19,%esi
call   1030 <diag_tty_break@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.diag_l0_device = type { i32 }
define i32 @diag_l0_vwtool_fastinit(%struct.diag_l0_device* %0) {
%2 = alloca %struct.diag_l0_device*
store %struct.diag_l0_device* %0, %struct.diag_l0_device** %2
%3 = load %struct.diag_l0_device*, %struct.diag_l0_device** %2
%4 = call i32 @diag_tty_break(%struct.diag_l0_device* %3, i32 25)
ret i32 0
}

LLVM IR (-O2):
%struct.diag_l0_device = type { i32 }
define i32 @diag_l0_vwtool_fastinit(%struct.diag_l0_device* %0) {
%2 = tail call i32 @diag_tty_break(%struct.diag_l0_device* %0, i32 25)
ret i32 0
}