xunge/DecIR huggingface dataset:
int ptr_cmp(const void *a, const void *b) {
  if (a < b) {
    return -1;
  } else if (a == b) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<ptr_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1126 <ptr_cmp+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <ptr_cmp+0x4c>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1140 <ptr_cmp+0x40>
movl   $0x0,-0x4(%rbp)
jmp    114c <ptr_cmp+0x4c>
jmp    1145 <ptr_cmp+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_cmp>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ptr_cmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ne i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
int Abs(int x) { return ((x > 0) ? x : -x); }


x86 assembly (clang, -O0):
<Abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111c <Abs+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <Abs+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int parse_on_off(char *value) {
  int result = 0;
  if (!strcmp(value, "on"))
    result = 1;
  return result;
}


x86 assembly (clang, -O0):
<parse_on_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1143 <parse_on_off+0x33>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_on_off>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"on\00"
define i32 @parse_on_off(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 1, i32* %3
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"on\00"
define i32 @parse_on_off(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct mxt_platform_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ enable_irq_wake(unsigned int);
void board_enable_irq_wake(const struct mxt_platform_data *pdata,
                           unsigned int irq) {
  enable_irq_wake(irq);
}


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

x86 assembly (clang, -O2):
<board_enable_irq_wake>:
mov    %esi,%edi
jmp    1030 <enable_irq_wake@plt>

LLVM IR (-O0):
%struct.mxt_platform_data = type { i32 }
define void @board_enable_irq_wake(%struct.mxt_platform_data* %0, i32 %1) {
%3 = alloca %struct.mxt_platform_data*
%4 = alloca i32
store %struct.mxt_platform_data* %0, %struct.mxt_platform_data** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @enable_irq_wake(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.mxt_platform_data = type { i32 }
define void @board_enable_irq_wake(%struct.mxt_platform_data* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @enable_irq_wake(i32 %1)
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
struct list *list_create();
int main(void) {
  struct list *list = NULL;
  list = list_create();
  return (list == NULL) ? EXIT_FAILURE : EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <list_create@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <main+0x3e>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    115a <main+0x4a>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <list_create@plt>
test   %rax,%rax
jne    1126 <main+0x16>
mov    0x2ebc(%rip),%rax
jmp    112d <main+0x1d>
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.list*
store i32 0, i32* %1
store %struct.list* null, %struct.list** %2
%3 = call %struct.list* (...) @list_create()
store %struct.list* %3, %struct.list** %2
%4 = load %struct.list*, %struct.list** %2
%5 = icmp eq %struct.list* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* @EXIT_FAILURE
br label %10
8: ; preds = %0
%9 = load i32, i32* @EXIT_SUCCESS
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
%struct.list = type { i32 }
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call %struct.list* (...) @list_create()
%2 = icmp eq %struct.list* %1, null
%3 = load i32, i32* @EXIT_FAILURE
%4 = load i32, i32* @EXIT_SUCCESS
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
void dhcpc_unconfigured() {}


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

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

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

LLVM IR (-O2):
define void @dhcpc_unconfigured() {
ret void
}
/* Variables and functions */
unsigned long long __blcmsk_u64(unsigned long long);
unsigned long long func_blcmsk64(unsigned long long X) {
  return __blcmsk_u64(X);
}


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

x86 assembly (clang, -O2):
<func_blcmsk64>:
jmp    1030 <__blcmsk_u64@plt>

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

LLVM IR (-O2):
define i64 @func_blcmsk64(i64 %0) {
%2 = tail call i64 @__blcmsk_u64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_bfin_csync();
void csync(void) { __builtin_bfin_csync(); }


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

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

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

LLVM IR (-O2):
define void @csync() {
%1 = tail call i32 (...) @__builtin_bfin_csync()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void errorDirective(void) {
  error("Invalid or unsupported preprocessor directive\n");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"Invalid or unsupported preprocessor directive\0A\00"
define void @errorDirective() {
%1 = call i32 @error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"Invalid or unsupported preprocessor directive\0A\00"
define void @errorDirective() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}
void I422ToRGB24Row_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @I422ToRGB24Row_AVX2() {
ret void
}
double mydiv(double a, double b) { return a / b; }


x86 assembly (clang, -O0):
<mydiv>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mydiv>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mydiv(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @mydiv(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *ptr) {
  if (ptr != ((void *)0))
    free(ptr);
}


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

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

LLVM IR (-O0):
define void @xfree(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 @xfree(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
}
/* Variables and functions */
scalar_t__ rng_uint64();
unsigned int rng_uint32(void) { return (unsigned int)rng_uint64(); }


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

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

LLVM IR (-O0):
define i32 @rng_uint32() {
%1 = call i64 (...) @rng_uint64()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @rng_uint32() {
%1 = tail call i64 (...) @rng_uint64()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int reg_read_8(void *);
void ls1c_spi_wait_txrx_done(void *spi_base) {
  int timeout = (20000);
  while (timeout--) {
    if ((0x01 << (7)) & reg_read_8(spi_base + (1)))
      break;
  }
  return;
}


x86 assembly (clang, -O0):
<ls1c_spi_wait_txrx_done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x4e20,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     115c <ls1c_spi_wait_txrx_done+0x4c>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <reg_read_8@plt>
and    $0x80,%eax
cmp    $0x0,%eax
je     1157 <ls1c_spi_wait_txrx_done+0x47>
jmp    115c <ls1c_spi_wait_txrx_done+0x4c>
jmp    1123 <ls1c_spi_wait_txrx_done+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls1c_spi_wait_txrx_done>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x1,%rbx
mov    $0xffffb1df,%ebp
nop
inc    %ebp
je     1130 <ls1c_spi_wait_txrx_done+0x20>
mov    %rbx,%rdi
call   1030 <reg_read_8@plt>
test   $0x80,%al
je     1120 <ls1c_spi_wait_txrx_done+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ls1c_spi_wait_txrx_done(i8* %0) {
%2 = getelementptr i8, i8* %0, i64 1
br label %3
3: ; preds = %6, %1
%4 = phi i32 [ 20000, %1 ], [ %7, %6 ]
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = add nsw i32 %4, -1
%8 = tail call i32 @reg_read_8(i8* %2)
%9 = and i32 %8, 128
%10 = icmp eq i32 %9, 0
br i1 %10, label %3, label %11
11: ; preds = %6, %3
ret void
}
char *RCSid() {
  return RCSid("$Id: pm3d.c,v 1.85.2.3 2013/09/10 20:39:37 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [55 x i8] c"$Id: pm3d.c,v 1.85.2.3 2013/09/10 20:39:37 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
void openlog_r(const char *id, int logopt, int facility,
               struct syslog_data *data) {}


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

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

LLVM IR (-O0):
%struct.syslog_data = type opaque
define void @openlog_r(i8* %0, i32 %1, i32 %2, %struct.syslog_data* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.syslog_data*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.syslog_data* %3, %struct.syslog_data** %8
ret void
}

LLVM IR (-O2):
%struct.syslog_data = type opaque
define void @openlog_r(i8* nocapture %0, i32 %1, i32 %2, %struct.syslog_data* nocapture %3) {
ret void
}
/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int semget(int, int, int);
int nuevo_semaforo(int llave, int num) {
  int s = semget(llave, num, IPC_CREAT | 0600);
  if (s < 0) {
    printf("Error creando semáforo \n");
    exit(0);
  }
  return (s);
}


x86 assembly (clang, -O0):
<nuevo_semaforo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
or     $0x180,%edx
call   1030 <semget@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1178 <nuevo_semaforo+0x48>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nuevo_semaforo>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    $0x180,%edx
or     (%rax),%edx
call   1030 <semget@plt>
test   %eax,%eax
js     114a <nuevo_semaforo+0x1a>
pop    %rcx
ret
lea    0xeaf(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@.str = [26 x i8] c"Error creando sem\C3\A1foro \0A\00"
define i32 @nuevo_semaforo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = load i32, i32* @IPC_CREAT
%9 = or i32 %8, 384
%10 = call i32 @semget(i32 %6, i32 %7, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 0)
unreachable
16: ; preds = %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@str = [25 x i8] c"Error creando sem\C3\A1foro \00"
define i32 @nuevo_semaforo(i32 %0, i32 %1) {
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 384
%5 = tail call i32 @semget(i32 %0, i32 %1, i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void da(int x) {
  bar(x);
  bar(x + 1);
}


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

x86 assembly (clang, -O2):
<da>:
push   %rbx
mov    %edi,%ebx
call   1030 <bar@plt>
add    $0x1,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @da(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bar(i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = call i32 @bar(i32 %6)
ret void
}

LLVM IR (-O2):
define void @da(i32 %0) {
%2 = tail call i32 @bar(i32 %0)
%3 = add nsw i32 %0, 1
%4 = tail call i32 @bar(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xc1() {
  Assert_real((isxdigit(193) == 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_isxdigit.c",
              970, ("isxdigit should be 0 for 0xc1"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xc1\00"
define void @t_isxdigit_0xc1() {
%1 = tail call i64 @isxdigit(i32 193)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 970, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t smax(size_t a, size_t b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<smax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <smax+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <smax+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smax>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @smax(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 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @smax(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int main() {
  int i = 10;
  { int i = 20; }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sw_beep_off();
int /*<<< orphan*/ sw_beep_on();
int sw_uartdbg_rc();
int /*<<< orphan*/ sw_uartdbg_tc(int);
int /*<<< orphan*/ sw_usleep(int);
int uartdbgtest_input() {
  int c;
  for (;;) {
    c = sw_uartdbg_rc();
    sw_beep_on();
    sw_usleep(40 * 1000);
    sw_beep_off();
    sw_uartdbg_tc(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<uartdbgtest_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <sw_uartdbg_rc@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <sw_beep_on@plt>
mov    $0x9c40,%edi
call   1070 <sw_usleep@plt>
mov    $0x0,%al
call   1060 <sw_beep_off@plt>
mov    -0x4(%rbp),%edi
call   1030 <sw_uartdbg_tc@plt>
jmp    1158 <uartdbgtest_input+0x8>

x86 assembly (clang, -O2):
<uartdbgtest_input>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <sw_uartdbg_rc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <sw_beep_on@plt>
mov    $0x9c40,%edi
call   1070 <sw_usleep@plt>
xor    %eax,%eax
call   1060 <sw_beep_off@plt>
mov    %ebx,%edi
call   1030 <sw_uartdbg_tc@plt>
jmp    1160 <uartdbgtest_input+0x10>

LLVM IR (-O0):
define i32 @uartdbgtest_input() {
%1 = alloca i32
br label %2
2: ; preds = %2, %0
%3 = call i32 (...) @sw_uartdbg_rc()
store i32 %3, i32* %1
%4 = call i32 (...) @sw_beep_on()
%5 = call i32 @sw_usleep(i32 40000)
%6 = call i32 (...) @sw_beep_off()
%7 = load i32, i32* %1
%8 = call i32 @sw_uartdbg_tc(i32 %7)
br label %2
}

LLVM IR (-O2):
define i32 @uartdbgtest_input() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @sw_uartdbg_rc()
%3 = tail call i32 (...) @sw_beep_on()
%4 = tail call i32 @sw_usleep(i32 40000)
%5 = tail call i32 (...) @sw_beep_off()
%6 = tail call i32 @sw_uartdbg_tc(i32 %2)
br label %1
}
int add2(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<add2>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int my_atoi(const char *name) {
  int val = 0;
  for (;; name++) {
    switch (*name) {
    case '0' ... '9':
      val = 10 * val + (*name - '0');
      break;
    default:
      return val;
    }
  }
}


x86 assembly (clang, -O0):
<my_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffd0,%eax
sub    $0x9,%eax
ja     113f <my_atoi+0x3f>
jmp    1127 <my_atoi+0x27>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <my_atoi+0x44>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
jmp    1149 <my_atoi+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <my_atoi+0xf>

x86 assembly (clang, -O2):
<my_atoi>:
movsbl (%rdi),%ecx
add    $0xffffffd0,%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
ja     1135 <my_atoi+0x35>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
movsbl (%rdi),%ecx
add    $0xffffffd0,%ecx
add    $0x1,%rdi
cmp    $0xa,%ecx
jb     1120 <my_atoi+0x20>
ret

LLVM IR (-O0):
define i32 @my_atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %19, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %16 [
i32 48, label %8
i32 49, label %8
i32 50, label %8
i32 51, label %8
i32 52, label %8
i32 53, label %8
i32 54, label %8
i32 55, label %8
i32 56, label %8
i32 57, label %8
]
8: ; preds = %4, %4, %4, %4, %4, %4, %4, %4, %4, %4
%9 = load i32, i32* %3
%10 = mul nsw i32 10, %9
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
%15 = add nsw i32 %10, %14
store i32 %15, i32* %3
br label %18
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
18: ; preds = %8
br label %19
19: ; preds = %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
br label %4
}

LLVM IR (-O2):
define i32 @my_atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, -48
%5 = icmp ult i32 %4, 10
br i1 %5, label %6, label %17
6: ; preds = %1, %6
%7 = phi i32 [ %15, %6 ], [ %4, %1 ]
%8 = phi i32 [ %11, %6 ], [ 0, %1 ]
%9 = phi i8* [ %12, %6 ], [ %0, %1 ]
%10 = mul nsw i32 %8, 10
%11 = add nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = add nsw i32 %14, -48
%16 = icmp ult i32 %15, 10
br i1 %16, label %6, label %17
17: ; preds = %6, %1
%18 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %18
}
void motion_result6(int *data) {
  int j = data[1];
  int k = data[2];
  int i = data[0];
  int n = data[3];
  int m = j + k;
  do
    i = m + i;
  while (i < n);
  data[4] = i;
}


x86 assembly (clang, -O0):
<motion_result6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     1138 <motion_result6+0x38>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<motion_result6>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
mov    0xc(%rdi),%edx
add    0x4(%rdi),%ecx
nopl   0x0(%rax,%rax,1)
add    %ecx,%eax
cmp    %edx,%eax
jl     1110 <motion_result6+0x10>
mov    %eax,0x10(%rdi)
ret

LLVM IR (-O0):
define void @motion_result6(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %2
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
store i32 %10, i32* %3
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
store i32 %13, i32* %4
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
store i32 %16, i32* %5
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
store i32 %19, i32* %6
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = add nsw i32 %20, %21
store i32 %22, i32* %7
br label %23
23: ; preds = %27, %1
%24 = load i32, i32* %7
%25 = load i32, i32* %5
%26 = add nsw i32 %24, %25
store i32 %26, i32* %5
br label %27
27: ; preds = %23
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = icmp slt i32 %28, %29
br i1 %30, label %23, label %31
31: ; preds = %27
%32 = load i32, i32* %5
%33 = load i32*, i32** %2
%34 = getelementptr inbounds i32, i32* %33, i64 4
store i32 %32, i32* %34
ret void
}

LLVM IR (-O2):
define void @motion_result6(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = load i32, i32* %4
%6 = load i32, i32* %0
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = load i32, i32* %7
%9 = add nsw i32 %5, %3
br label %10
10: ; preds = %10, %1
%11 = phi i32 [ %6, %1 ], [ %12, %10 ]
%12 = add nsw i32 %9, %11
%13 = icmp slt i32 %12, %8
br i1 %13, label %10, label %14
14: ; preds = %10
%15 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %12, i32* %15
ret void
}
void FP_prune_alias_exp_Ok(int *x) {
  int a[1];
  if (*x + 1 != 1 + *x) {
    a[1] = 0;
  }
}


x86 assembly (clang, -O0):
<FP_prune_alias_exp_Ok>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
je     1129 <FP_prune_alias_exp_Ok+0x29>
movl   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @FP_prune_alias_exp_Ok(i32* %0) {
%2 = alloca i32*
%3 = alloca [1 x i32]
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = add nsw i32 1, %8
%10 = icmp ne i32 %6, %9
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 1
store i32 0, i32* %12
br label %13
13: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
define void @FP_prune_alias_exp_Ok(i32* nocapture %0) {
ret void
}
unsigned int distorm_version() { return 0x030300; }


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

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

LLVM IR (-O0):
define i32 @distorm_version() {
ret i32 197376
}

LLVM IR (-O2):
define i32 @distorm_version() {
ret i32 197376
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ test_inotify_support();
int main(void) { return test_inotify_support() ? EXIT_SUCCESS : EXIT_FAILURE; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_inotify_support@plt>
cmp    $0x0,%rax
je     1141 <main+0x31>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x3d>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_inotify_support@plt>
test   %rax,%rax
jne    1126 <main+0x16>
mov    0x2ebc(%rip),%rax
jmp    112d <main+0x1d>
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @test_inotify_support()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* @EXIT_SUCCESS
br label %8
6: ; preds = %0
%7 = load i32, i32* @EXIT_FAILURE
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @test_inotify_support()
%2 = icmp eq i64 %1, 0
%3 = load i32, i32* @EXIT_SUCCESS
%4 = load i32, i32* @EXIT_FAILURE
%5 = select i1 %2, i32 %4, i32 %3
ret i32 %5
}
long nside2npix(const long nside) { return 12 * nside * nside; }


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

x86 assembly (clang, -O2):
<nside2npix>:
imul   %rdi,%rdi
shl    $0x2,%rdi
lea    (%rdi,%rdi,2),%rax
ret

LLVM IR (-O0):
define i64 @nside2npix(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 12, %3
%5 = load i64, i64* %2
%6 = mul nsw i64 %4, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @nside2npix(i64 %0) {
%2 = mul nsw i64 %0, 12
%3 = mul nsw i64 %2, %0
ret i64 %3
}
f(i) { i = f() + f(); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) bitcast (i32 (i32)* @f to i32 (...)*)()
%5 = call i32 (...) bitcast (i32 (i32)* @f to i32 (...)*)()
%6 = add nsw i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void foo27() {}


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

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

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

LLVM IR (-O2):
define void @foo27() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ geteuid();
int /*<<< orphan*/ setresuid(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main() {
  setresuid(geteuid(), geteuid(), geteuid());
  system("/bin/bash");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    %eax,%edx
call   1030 <setresuid@plt>
lea    0xe99(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <setresuid@plt>
lea    0xea2(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/bin/bash\00"
define i32 @main() {
%1 = call i32 (...) @geteuid()
%2 = call i32 (...) @geteuid()
%3 = call i32 (...) @geteuid()
%4 = call i32 @setresuid(i32 %1, i32 %2, i32 %3)
%5 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/bin/bash\00"
define i32 @main() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call i32 (...) @geteuid()
%3 = tail call i32 (...) @geteuid()
%4 = tail call i32 @setresuid(i32 %1, i32 %2, i32 %3)
%5 = tail call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void av_write_trailer() {}


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

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

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

LLVM IR (-O2):
define void @av_write_trailer() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
struct event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ event_add(struct event *, struct timeval *);
int /*<<< orphan*/ printf(char *);
void onTime(int sock, short event, void *arg) {
  printf("Hello world!\n");
  struct timeval tv;
  tv.tv_sec = 1;
  tv.tv_usec = 0;
  event_add((struct event *)arg, &tv);
}


x86 assembly (clang, -O0):
<onTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <event_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onTime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <event_add@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
%struct.event = type { i32 }
@.str = [14 x i8] c"Hello world!\0A\00"
define void @onTime(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.timeval
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i32 1, i32* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
store i64 0, i64* %10
%11 = load i8*, i8** %6
%12 = bitcast i8* %11 to %struct.event*
%13 = call i32 @event_add(%struct.event* %12, %struct.timeval* %7)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
%struct.event = type { i32 }
@str = [13 x i8] c"Hello world!\00"
define void @onTime(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca %struct.timeval
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = bitcast %struct.timeval* %4 to i8*
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
store i32 1, i32* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
store i64 0, i64* %8
%9 = bitcast i8* %2 to %struct.event*
%10 = call i32 @event_add(%struct.event* %9, %struct.timeval* %4)
ret void
}
/* Variables and functions */
unsigned long get_hsb_clk_rate();
unsigned long get_macb_hclk_rate(unsigned int dev_id) {
  return get_hsb_clk_rate();
}


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

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

LLVM IR (-O0):
define i64 @get_macb_hclk_rate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @get_hsb_clk_rate()
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_macb_hclk_rate(i32 %0) {
%2 = tail call i64 (...) @get_hsb_clk_rate()
ret i64 %2
}
int pos_bloc(int num_bloque) { return (num_bloque / 1024); }


x86 assembly (clang, -O0):
<pos_bloc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos_bloc>:
lea    0x3ff(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0xa,%eax
ret

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

LLVM IR (-O2):
define i32 @pos_bloc(i32 %0) {
%2 = sdiv i32 %0, 1024
ret i32 %2
}
/* Variables and functions */
int execvp(char const *, char **);
int execlp(const char *file, const char *arg0, ...) {
  return execvp(file, (char **)&arg0);
}


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

x86 assembly (clang, -O2):
<execlp>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
call   1030 <execvp@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @execlp(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 = call i32 @execvp(i8* %5, i8** %4)
ret i32 %6
}

LLVM IR (-O2):
define i32 @execlp(i8* %0, i8* %1, ...) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32 @execvp(i8* %0, i8** %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
char *pack_u32(char *buf, uint32_t val) {
  *(uint32_t *)buf = val;
  return buf + sizeof(uint32_t);
}


x86 assembly (clang, -O0):
<pack_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_u32>:
mov    %esi,(%rdi)
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @pack_u32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 4
ret i8* %9
}

LLVM IR (-O2):
define i8* @pack_u32(i8* writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
%4 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %4
}
/* Variables and functions */
int rnd();
int unifd(int i, int j) {
  j = (j - i + 1) * rnd();
  return (i + j);
}


x86 assembly (clang, -O0):
<unifd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rnd@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unifd>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
sub    %edi,%esi
lea    0x1(%rsi),%ebp
xor    %eax,%eax
call   1030 <rnd@plt>
imul   %ebp,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @unifd(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = tail call i32 (...) @rnd()
%6 = mul nsw i32 %5, %4
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
const char *skip_prefix(const char *sample, const char *prefix) {
  size_t len = strlen(prefix);
  if (strncmp(sample, prefix, len))
    return NULL;
  return sample + len;
}


x86 assembly (clang, -O0):
<skip_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1165 <skip_prefix+0x45>
movq   $0x0,-0x8(%rbp)
jmp    1171 <skip_prefix+0x51>
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_prefix>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
add    %r15,%rbx
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @skip_prefix(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i64 %3)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds i8, i8* %0, i64 %3
%7 = select i1 %5, i8* %6, i8* null
ret i8* %7
}
int Comparacao(int x, int y) { return x < y ? -1 : x != y; }


x86 assembly (clang, -O0):
<Comparacao>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1123 <Comparacao+0x23>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <Comparacao+0x34>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Comparacao>:
xor    %ecx,%ecx
cmp    %esi,%edi
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Comparacao(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 slt i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %14
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp ne i32 %10, %11
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %9, %8
%15 = phi i32 [ -1, %8 ], [ %13, %9 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @Comparacao(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = icmp ne i32 %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Content-Type: text/html\r\n\r\n");
  printf("<center><h1>Hello!\n</h1></center>");
  exit(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Content-Type: text/html\0D\0A\0D\0A\00"
@.str.1 = [34 x i8] c"<center><h1>Hello!\0A</h1></center>\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"<center><h1>Hello!\0A</h1></center>\00"
@str = [27 x i8] c"Content-Type: text/html\0D\0A\0D\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}