xunge/DecIR huggingface dataset:
/* Type definitions */
struct notifier_block {
  int dummy;
};
struct iommu_group {
  int dummy;
};

/* Variables and functions */
int ENODEV;
int iommu_group_register_notifier(struct iommu_group *group,
                                  struct notifier_block *nb) {
  return -ENODEV;
}


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

x86 assembly (clang, -O2):
<iommu_group_register_notifier>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.iommu_group = type { i32 }
%struct.notifier_block = type { i32 }
@ENODEV = global i32 0
define i32 @iommu_group_register_notifier(%struct.iommu_group* %0, %struct.notifier_block* %1) {
%3 = alloca %struct.iommu_group*
%4 = alloca %struct.notifier_block*
store %struct.iommu_group* %0, %struct.iommu_group** %3
store %struct.notifier_block* %1, %struct.notifier_block** %4
%5 = load i32, i32* @ENODEV
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.iommu_group = type { i32 }
%struct.notifier_block = type { i32 }
@ENODEV = global i32 0
define i32 @iommu_group_register_notifier(%struct.iommu_group* nocapture readnone %0, %struct.notifier_block* nocapture readnone %1) {
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  switch (2) {
  case 0:
  case 1:
    printf("ERRO");
    break;
  case 2:
    printf("OK");
    break;
  case 3:
  case 4:
  case 5:
  case 6:
  case 7:
  case 8:
  case 9:
  case 10:
  case 11:
  case 12:
  case 13:
  case 14:
  case 15:
  case 16:
  case 17:
  case 18:
  case 19:
  case 20:
  case 21:
  case 22:
  case 23:
  case 24:
  case 25:
  case 26:
  case 27:
  case 28:
  case 29:
  case 30:
  case 31:
  case 32:
  case 33:
  case 34:
  case 35:
  case 36:
  case 37:
  case 38:
  case 39:
  case 40:
  case 41:
  case 42:
  case 43:
  case 44:
  case 45:
  case 46:
  case 47:
  case 48:
  case 49:
  case 50:
  case 51:
  case 52:
  case 53:
  case 54:
  case 55:
  case 56:
  case 57:
  case 58:
  case 59:
  case 60:
  case 61:
  case 62:
  case 63:
  case 64:
  case 65:
  case 66:
  case 67:
  case 68:
  case 69:
  case 70:
  case 71:
  case 72:
  case 73:
  case 74:
  case 75:
  case 76:
  case 77:
  case 78:
  case 79:
  case 80:
  case 81:
  case 82:
  case 83:
  case 84:
  case 85:
  case 86:
  case 87:
  case 88:
  case 89:
  case 90:
  case 91:
  case 92:
  case 93:
  case 94:
  case 95:
  case 96:
  case 97:
  case 98:
  case 99:
  case 100:
    printf("ERRO");
    break;
  default:
    printf("ERRO");
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int bar_dummy_func();
int dummy_func();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Hello world %d\n", bar_dummy_func() + dummy_func());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <bar_dummy_func@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dummy_func@plt>
add    %eax,%ebx
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Hello world %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @bar_dummy_func()
%3 = call i32 (...) @dummy_func()
%4 = add nsw i32 %2, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello world %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @bar_dummy_func()
%2 = tail call i32 (...) @dummy_func()
%3 = add nsw i32 %2, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int icosd(int);
int isind(int d) { return icosd(1024 - d); }


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

x86 assembly (clang, -O2):
<isind>:
mov    $0x400,%eax
sub    %edi,%eax
mov    %eax,%edi
jmp    1030 <icosd@plt>

LLVM IR (-O0):
define i32 @isind(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 1024, %3
%5 = call i32 @icosd(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @isind(i32 %0) {
%2 = sub nsw i32 1024, %0
%3 = tail call i32 @icosd(i32 %2)
ret i32 %3
}
void gtk_about_dialog_get_website_label() {}


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

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

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

LLVM IR (-O2):
define void @gtk_about_dialog_get_website_label() {
ret void
}
double fma(double x, double y, double z) { return x * y + z; }


x86 assembly (clang, -O0):
<fma>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fma>:
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @fma(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @llvm.fmuladd.f64(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @fma(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ fakeSystemHeaderCallIntPtr(int **);
int /*<<< orphan*/ free(int *);
int *malloc(int);
void testPassToSystemHeaderFunctionIndirectlyArrayFree() {
  int *p[1];
  p[0] = malloc(sizeof(int));
  fakeSystemHeaderCallIntPtr(p);
  free(p[0]);
}


x86 assembly (clang, -O0):
<testPassToSystemHeaderFunctionIndirectlyArrayFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <fakeSystemHeaderCallIntPtr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testPassToSystemHeaderFunctionIndirectlyArrayFree>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1050 <fakeSystemHeaderCallIntPtr@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @testPassToSystemHeaderFunctionIndirectlyArrayFree() {
%1 = alloca [1 x i32*]
%2 = call i32* @malloc(i32 4)
%3 = getelementptr inbounds [1 x i32*], [1 x i32*]* %1, i64 0, i64 0
store i32* %2, i32** %3
%4 = getelementptr inbounds [1 x i32*], [1 x i32*]* %1, i64 0, i64 0
%5 = call i32 @fakeSystemHeaderCallIntPtr(i32** %4)
%6 = getelementptr inbounds [1 x i32*], [1 x i32*]* %1, i64 0, i64 0
%7 = load i32*, i32** %6
%8 = call i32 @free(i32* %7)
ret void
}

LLVM IR (-O2):
define void @testPassToSystemHeaderFunctionIndirectlyArrayFree() {
%1 = alloca [1 x i32*]
%2 = bitcast [1 x i32*]* %1 to i8*
%3 = tail call i32* @malloc(i32 4)
%4 = getelementptr inbounds [1 x i32*], [1 x i32*]* %1, i64 0, i64 0
store i32* %3, i32** %4
%5 = call i32 @fakeSystemHeaderCallIntPtr(i32** %4)
%6 = load i32*, i32** %4
%7 = call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getxattr;
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  (void)getxattr;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@getxattr = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = load i32, i32* @getxattr
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@getxattr = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_6Dint8_reg(signed char val) {
  return ((val) & (-0x6D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Dint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff93,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_6Dint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -109
%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_6Dint8_reg(i8 signext %0) {
%2 = and i8 %0, -109
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage:\n");
  printf("  ./t8.2 <sleep_time> int value like 2.\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [41 x i8] c" ./t8.2 <sleep_time> int value like 2.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"usage:\00"
@str.2 = [40 x i8] c" ./t8.2 <sleep_time> int value like 2.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ system(char *);
void exec_via_powershell(const char *command, int command_size) {
  0;
  char *powershell_call = "powershell.exe ";
  char *system_arg = (char *)malloc(strlen(powershell_call) + command_size + 1);
  strcpy(system_arg, powershell_call);
  strcat(system_arg, command);
  0;
  system(system_arg);
}


x86 assembly (clang, -O0):
<exec_via_powershell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xe9a(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1070 <strcat@plt>
mov    -0x20(%rbp),%rdi
call   1050 <system@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_via_powershell>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rdi
add    $0x10,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xea3(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"powershell.exe \00"
define void @exec_via_powershell(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %5
%7 = load i8*, i8** %5
%8 = call i64 @strlen(i8* %7)
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = add nsw i64 %8, %10
%12 = add nsw i64 %11, 1
%13 = call i64 @malloc(i64 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = load i8*, i8** %5
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %6
%19 = load i8*, i8** %3
%20 = call i32 @strcat(i8* %18, i8* %19)
%21 = load i8*, i8** %6
%22 = call i32 @system(i8* %21)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"powershell.exe \00"
define void @exec_via_powershell(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = add nsw i64 %3, 16
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @strcat(i8* %6, i8* %0)
%9 = tail call i32 @system(i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ report(int /*<<< orphan*/, char *, int, char const *,
                          char const *, unsigned int);
void log_watchtab_invalid_events(const char *filename, unsigned line_no,
                                 const char *field, size_t len) {
  report(LOG_ERR, "Invalid event set \"%.*s\" at %s:%u", (int)len, field,
         filename, line_no);
}


x86 assembly (clang, -O0):
<log_watchtab_invalid_events>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0xc(%rbp),%r9d
lea    0xeb7(%rip),%rsi
call   1030 <report@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_watchtab_invalid_events>:
mov    %rdx,%rax
mov    %esi,%r9d
mov    %rdi,%r8
mov    0x2eb8(%rip),%rdx
mov    (%rdx),%edi
lea    0xed7(%rip),%rsi
mov    %ecx,%edx
mov    %rax,%rcx
jmp    1030 <report@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [34 x i8] c"Invalid event set \22%.*s\22 at %s:%u\00"
define void @log_watchtab_invalid_events(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* @LOG_ERR
%10 = load i64, i64* %8
%11 = trunc i64 %10 to i32
%12 = load i8*, i8** %7
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i32 @report(i32 %9, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %12, i8* %13, i32 %14)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [34 x i8] c"Invalid event set \22%.*s\22 at %s:%u\00"
define void @log_watchtab_invalid_events(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = load i32, i32* @LOG_ERR
%6 = trunc i64 %3 to i32
%7 = tail call i32 @report(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %2, i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_DETACH;
scalar_t__ ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
                  int /*<<< orphan*/);
int ptrace_detach(pid_t pid) {
  if (ptrace(PTRACE_DETACH, pid, NULL, 0) < 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ptrace_detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
cmp    $0x0,%rax
jge    1148 <ptrace_detach+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <ptrace_detach+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_detach>:
push   %rax
mov    %edi,%esi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
sar    $0x3f,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@PTRACE_DETACH = global i32 0
define i32 @ptrace_detach(i32 %0) {
%2 = load i32, i32* @PTRACE_DETACH
%3 = tail call i64 @ptrace(i32 %2, i32 %0, i32* null, i32 0)
%4 = ashr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_d2u64(double);
int /*<<< orphan*/ rgph_u32x4_murmur32v_u64(int /*<<< orphan*/, uintptr_t,
                                            int /*<<< orphan*/ *);
void rgph_u32x4_murmur32v_f64(double value, uintptr_t seed, uint32_t *h) {
  rgph_u32x4_murmur32v_u64(rgph_d2u64(value), seed, h);
}


x86 assembly (clang, -O0):
<rgph_u32x4_murmur32v_f64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <rgph_d2u64@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <rgph_u32x4_murmur32v_u64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u32x4_murmur32v_f64>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <rgph_d2u64@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <rgph_u32x4_murmur32v_u64@plt>

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

LLVM IR (-O2):
define void @rgph_u32x4_murmur32v_f64(double %0, i64 %1, i32* %2) {
%4 = tail call i32 @rgph_d2u64(double %0)
%5 = tail call i32 @rgph_u32x4_murmur32v_u64(i32 %4, i64 %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ls(char *);
int main(void) {
  ls("/etc/*");
  ls("./*");
  ls("../*");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"/etc/*\00"
@.str.1 = [4 x i8] c"./*\00"
@.str.2 = [5 x i8] c"../*\00"
define i32 @main() {
%1 = tail call i32 @ls(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ls(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @ls(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double mkPosNan();
double mkNegNan(void) { return -mkPosNan(); }


x86 assembly (clang, -O0):
<mkNegNan>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mkPosNan@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkNegNan>:
push   %rax
xor    %eax,%eax
call   1030 <mkPosNan@plt>
xorps  0xee1(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mkNegNan() {
%1 = call double (...) @mkPosNan()
%2 = fneg double %1
ret double %2
}

LLVM IR (-O2):
define double @mkNegNan() {
%1 = tail call double (...) @mkPosNan()
%2 = fneg double %1
ret double %2
}
void ff_hevc_put_hevc_bi_epel_h48_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_h48_12_sse4() {
ret void
}
/* Type definitions */
struct em8051 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
int disasm_mul_ab(struct em8051 *aCPU, int aPosition, char *aBuffer) {
  sprintf(aBuffer, "MUL   AB");
  return 1;
}


x86 assembly (clang, -O0):
<disasm_mul_ab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_mul_ab>:
movabs $0x42412020204c554d,%rax
20 41 42
mov    %rax,(%rdx)
movb   $0x0,0x8(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.em8051 = type { i32 }
@.str = [9 x i8] c"MUL AB\00"
define i32 @disasm_mul_ab(%struct.em8051* %0, i32 %1, i8* %2) {
%4 = alloca %struct.em8051*
%5 = alloca i32
%6 = alloca i8*
store %struct.em8051* %0, %struct.em8051** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.em8051 = type { i32 }
@.str = [9 x i8] c"MUL AB\00"
define i32 @disasm_mul_ab(%struct.em8051* nocapture readnone %0, i32 %1, i8* nocapture writeonly %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(9) %2, i8* align 1 dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 9, i1 false)
ret i32 1
}
/* Variables and functions */
unsigned int f21(unsigned int);
unsigned int f22(unsigned int a) { return f21(f21(a)); }


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

x86 assembly (clang, -O2):
<f22>:
push   %rax
call   1030 <f21@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f21@plt>

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

LLVM IR (-O2):
define i32 @f22(i32 %0) {
%2 = tail call i32 @f21(i32 %0)
%3 = tail call i32 @f21(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *strrchr(char const *, char);
char *fnbase(const char *fname) {
  char *base;
  assert(fname != NULL);
  base = strrchr(fname, '/');
  if (base == NULL)
    return (char *)fname;
  return base + 1;
}


x86 assembly (clang, -O0):
<fnbase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <fnbase+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <fnbase+0x54>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnbase>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @fnbase(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%6 = icmp eq i8* %5, null
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = select i1 %6, i8* %0, i8* %7
ret i8* %8
}
void poly2s_(n, parray) int *n;
short parray[][2];
{ poly2s((long)*n, parray); }


x86 assembly (clang, -O0):
<poly2s_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <poly2s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly2s_>:
movslq (%rdi),%rdi
xor    %eax,%eax
jmp    1030 <poly2s@plt>

LLVM IR (-O0):
define void @poly2s_(i32* %0, [2 x i16]* %1) {
%3 = alloca i32*
%4 = alloca [2 x i16]*
store i32* %0, i32** %3
store [2 x i16]* %1, [2 x i16]** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = load [2 x i16]*, [2 x i16]** %4
%9 = call i32 (i64, [2 x i16]*, ...) bitcast (i32 (...)* @poly2s to i32 (i64, [2 x i16]*, ...)*)(i64 %7, [2 x i16]* %8)
ret void
}

LLVM IR (-O2):
define void @poly2s_(i32* nocapture %0, [2 x i16]* %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = tail call i32 (i64, [2 x i16]*, ...) bitcast (i32 (...)* @poly2s to i32 (i64, [2 x i16]*, ...)*)(i64 %4, [2 x i16]* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void invalidFunctionArg() {
  usleep(-1);
  usleep(0);
  usleep(999999);
  usleep(1000000);
}


x86 assembly (clang, -O0):
<invalidFunctionArg>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <usleep@plt>
xor    %edi,%edi
call   1030 <usleep@plt>
mov    $0xf423f,%edi
call   1030 <usleep@plt>
mov    $0xf4240,%edi
call   1030 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalidFunctionArg>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <usleep@plt>
xor    %edi,%edi
call   1030 <usleep@plt>
mov    $0xf423f,%edi
call   1030 <usleep@plt>
mov    $0xf4240,%edi
pop    %rax
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @invalidFunctionArg() {
%1 = call i32 @usleep(i32 -1)
%2 = call i32 @usleep(i32 0)
%3 = call i32 @usleep(i32 999999)
%4 = call i32 @usleep(i32 1000000)
ret void
}

LLVM IR (-O2):
define void @invalidFunctionArg() {
%1 = tail call i32 @usleep(i32 -1)
%2 = tail call i32 @usleep(i32 0)
%3 = tail call i32 @usleep(i32 999999)
%4 = tail call i32 @usleep(i32 1000000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void SampleSpecial(int nSpecial, int nMouseX, int nMouseY) {
  printf("SampleSpecial(): special keypress %i at (%i,%i)\n", nSpecial, nMouseX,
         nMouseY);
}


x86 assembly (clang, -O0):
<SampleSpecial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SampleSpecial>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"SampleSpecial(): special keypress %i at (%i,%i)\0A\00"
define void @SampleSpecial(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"SampleSpecial(): special keypress %i at (%i,%i)\0A\00"
define void @SampleSpecial(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void stringRelease(char *src) {
  if (src)
    free((void *)src);
}


x86 assembly (clang, -O0):
<stringRelease>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <stringRelease+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringRelease>:
test   %rdi,%rdi
je     111a <stringRelease+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @stringRelease(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @stringRelease(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
unsigned long load_SRAM(const char *file_path, unsigned char *data,
                        unsigned long size) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @load_SRAM(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i64 0
}
int my_strlen(const char *s) {
  int size_t = 0;
  while (s[size_t] != '\0') {
    size_t++;
  }
  return (size_t);
}


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

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

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int mpz_cmp(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int CompareSquare(mpz_t Nbr1, mpz_t Nbr2) {
  mpz_t tmp;
  int cmp = 0;
  mpz_init(tmp);
  mpz_mul(tmp, Nbr1, Nbr1);
  cmp = mpz_cmp(tmp, Nbr2);
  mpz_clear(tmp);
  return cmp;
}


x86 assembly (clang, -O0):
<CompareSquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <mpz_init@plt>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1040 <mpz_mul@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <mpz_cmp@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <mpz_clear@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompareSquare>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <mpz_init@plt>
mov    %ebp,%esi
mov    %ebp,%edx
call   1040 <mpz_mul@plt>
mov    %ebx,%esi
call   1050 <mpz_cmp@plt>
mov    %eax,%ebx
call   1060 <mpz_clear@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @CompareSquare(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %6
%7 = load i32, i32* %5
%8 = call i32 @mpz_init(i32 %7)
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @mpz_mul(i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @mpz_cmp(i32 %13, i32 %14)
store i32 %15, i32* %6
%16 = load i32, i32* %5
%17 = call i32 @mpz_clear(i32 %16)
%18 = load i32, i32* %6
ret i32 %18
}

LLVM IR (-O2):
define i32 @CompareSquare(i32 %0, i32 %1) {
%3 = tail call i32 @mpz_init(i32 undef)
%4 = tail call i32 @mpz_mul(i32 undef, i32 %0, i32 %0)
%5 = tail call i32 @mpz_cmp(i32 undef, i32 %1)
%6 = tail call i32 @mpz_clear(i32 undef)
ret i32 %5
}
int bar() { return 6; }


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

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

LLVM IR (-O0):
define i32 @bar() {
ret i32 6
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 6
}
/* Type definitions */
typedef int /*<<< orphan*/ AUTH;

/* Variables and functions */
void authnone_verf(AUTH *x) {}


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

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

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

LLVM IR (-O2):
define void @authnone_verf(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t uint32ToInt8(uint32_t x) {
  int8_t y = x;
  return y;
}


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

x86 assembly (clang, -O2):
<uint32ToInt8>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @uint32ToInt8(i32 returned %0) {
ret i32 %0
}
void _timer_init_ISR(int timer, int prescaler, int period) {}


x86 assembly (clang, -O0):
<_timer_init_ISR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_timer_init_ISR(i32 %0, i32 %1, i32 %2) {
ret void
}
void x86_64_cpuid_ffi() {
  asm("movq %%rdi, %%rax\n\t"
      "movq %%rbx, %%r8\n\t"
      "cpuid\n\t"
      "mov %%eax, (%%rsi)\n\t"
      "mov %%ebx, 0x04(%%rsi)\n\t"
      "mov %%edx, 0x0c(%%rsi)\n\t"
      "mov %%ecx, 0x08(%%rsi)\n\t"
      "movq %%r8, %%rbx\n\t" ::
          :);
}


x86 assembly (clang, -O0):
<x86_64_cpuid_ffi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,%rax
mov    %rbx,%r8
cpuid
mov    %eax,(%rsi)
mov    %ebx,0x4(%rsi)
mov    %edx,0xc(%rsi)
mov    %ecx,0x8(%rsi)
mov    %r8,%rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_64_cpuid_ffi>:
mov    %rdi,%rax
mov    %rbx,%r8
cpuid
mov    %eax,(%rsi)
mov    %ebx,0x4(%rsi)
mov    %edx,0xc(%rsi)
mov    %ecx,0x8(%rsi)
mov    %r8,%rbx
ret

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

LLVM IR (-O2):
define void @x86_64_cpuid_ffi() {
tail call void asm sideeffect "movq %rdi, %rax\0A\09movq %rbx, %r8\0A\09cpuid\0A\09mov %eax, (%rsi)\0A\09mov %ebx, 0x04(%rsi)\0A\09mov %edx, 0x0c(%rsi)\0A\09mov %ecx, 0x08(%rsi)\0A\09movq %r8, %rbx\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EI();
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_0xfb(void) {
  EI();
  T_WAIT_UNTIL(4);
  return;
}


x86 assembly (clang, -O0):
<op_0xfb>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <EI@plt>
mov    $0x4,%edi
call   1030 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_0xfb>:
push   %rax
xor    %eax,%eax
call   1040 <EI@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_0xfb() {
%1 = call i32 (...) @EI()
%2 = call i32 @T_WAIT_UNTIL(i32 4)
ret void
}

LLVM IR (-O2):
define void @op_0xfb() {
%1 = tail call i32 (...) @EI()
%2 = tail call i32 @T_WAIT_UNTIL(i32 4)
ret void
}
/* Variables and functions */
unsigned long long __builtin_cntlzdm(unsigned long long, unsigned long long);
unsigned long long int do_cntlzdm(unsigned long long int source,
                                  unsigned long long int mask) {
  return __builtin_cntlzdm(source, mask);
}


x86 assembly (clang, -O0):
<do_cntlzdm>:
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 <__builtin_cntlzdm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cntlzdm>:
jmp    1030 <__builtin_cntlzdm@plt>

LLVM IR (-O0):
define i64 @do_cntlzdm(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 = load i64, i64* %4
%7 = call i64 @__builtin_cntlzdm(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @do_cntlzdm(i64 %0, i64 %1) {
%3 = tail call i64 @__builtin_cntlzdm(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isdigit(int);
void t_isdigit_0x33() {
  Assert_real((isdigit(51)),
              "/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_isdigit.c",
              260, ("isdigit should be 1 for 3"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x33>:
push   %rbp
mov    %rsp,%rbp
mov    $0x33,%edi
call   1030 <isdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x104,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x33>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x104,%edx
jmp    1030 <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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 1 for 3\00"
define void @t_isdigit_0x33() {
%1 = call i32 @isdigit(i32 51)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 260, 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 1 for 3\00"
define void @t_isdigit_0x33() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 260, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ be16toh(int /*<<< orphan*/);
void unaligned_write_be16(void *_u, uint16_t a) {
  struct __attribute__((__packed__, __may_alias__)) {
    uint16_t x;
  } *u = _u;
  u->x = be16toh(a);
}


x86 assembly (clang, -O0):
<unaligned_write_be16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <be16toh@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32 }
define void @unaligned_write_be16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.anon*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.anon*
store %struct.anon* %7, %struct.anon** %5
%8 = load i32, i32* %4
%9 = call i32 @be16toh(i32 %8)
%10 = load %struct.anon*, %struct.anon** %5
%11 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @unaligned_write_be16(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @be16toh(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
void CG_LoadHud_f(void) {}


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

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

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

LLVM IR (-O2):
define void @CG_LoadHud_f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello cross-compiling world!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [29 x i8] c"Hello cross-compiling world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int intc(void *int1, void *int2) {
  int *inti1 = (int *)int1;
  int *inti2 = (int *)int2;
  return *inti1 - *inti2;
}


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

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

LLVM IR (-O0):
define i32 @intc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @intc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
char *mt_tolower(int /*<<< orphan*/);
int strcmp(char *, char *);
int /*<<< orphan*/ xfree(char *);
int /*<<< orphan*/ xstrdup(char *);
int mt_strcmp_cap(char *log, char *opt) {
  int rc;
  char *tmp;
  tmp = mt_tolower(xstrdup(log));
  rc = strcmp(tmp, opt);
  xfree(tmp);
  return (rc);
}


x86 assembly (clang, -O0):
<mt_strcmp_cap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xstrdup@plt>
mov    %eax,%edi
call   1050 <mt_tolower@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <xfree@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_strcmp_cap>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
call   1040 <xstrdup@plt>
mov    %eax,%edi
call   1050 <mt_tolower@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <xfree@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mt_strcmp_cap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @xstrdup(i8* %7)
%9 = call i8* @mt_tolower(i32 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = load i8*, i8** %4
%12 = call i32 @strcmp(i8* %10, i8* %11)
store i32 %12, i32* %5
%13 = load i8*, i8** %6
%14 = call i32 @xfree(i8* %13)
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @mt_strcmp_cap(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @xstrdup(i8* %0)
%4 = tail call i8* @mt_tolower(i32 %3)
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %1)
%6 = tail call i32 @xfree(i8* %4)
ret i32 %5
}