xunge/DecIR huggingface dataset:
char *buildString(string)
char *string;
{
  char *result;
  result = (char *)malloc(strlen(string) + 1);
  strcpy(result, string);
  return (result);
}


x86 assembly (clang, -O0):
<buildString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildString>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @buildString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @buildString(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dma_free_coherent(void *addr) { free(addr); }


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

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

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

LLVM IR (-O2):
define void @dma_free_coherent(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ sigdelset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigsuspend(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  sigset_t new_mask;
  sigfillset(&new_mask);
  sigdelset(&new_mask, SIGUSR1);
  sigsuspend(&new_mask);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <sigfillset@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
lea    -0x14(%rbp),%rdi
call   1050 <sigdelset@plt>
lea    -0x14(%rbp),%rdi
call   1040 <sigsuspend@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sigfillset@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    %rbx,%rdi
call   1040 <sigsuspend@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIGUSR1 = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @sigfillset(i32* %6)
%8 = load i32, i32* @SIGUSR1
%9 = call i32 @sigdelset(i32* %6, i32 %8)
%10 = call i32 @sigsuspend(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @sigfillset(i32* %3)
%6 = load i32, i32* @SIGUSR1
%7 = call i32 @sigdelset(i32* %3, i32 %6)
%8 = call i32 @sigsuspend(i32* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
unsigned int ftell(int /*<<< orphan*/ *);
unsigned int size_of_file(FILE *fileS1) {
  unsigned int size_file;
  fseek(fileS1, 0, SEEK_END);
  size_file = ftell(fileS1);
  fseek(fileS1, 0, SEEK_SET);
  return size_file;
}


x86 assembly (clang, -O0):
<size_of_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_of_file>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %eax,%ebp
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @size_of_file(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @ftell(i32* %7)
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i32 0, i32 %10)
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @size_of_file(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i32 @ftell(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 0, i32 %5)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ os_freakout();
int os_sleep(unsigned int, unsigned int *);
unsigned int sleep(unsigned int seconds) {
  unsigned int rc;
  if (os_sleep(seconds, &rc) == -1)
    os_freakout();
  return rc;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <os_sleep@plt>
cmp    $0xffffffff,%eax
jne    1147 <sleep+0x27>
mov    $0x0,%al
call   1040 <os_freakout@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <os_sleep@plt>
cmp    $0xffffffff,%eax
jne    1137 <sleep+0x17>
xor    %eax,%eax
call   1040 <os_freakout@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @os_sleep(i32 %4, i32* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @os_freakout()
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @sleep(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @os_sleep(i32 %0, i32* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @os_freakout()
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
ret i32 %9
}
double DecUnitFloat(c)
unsigned char c;
{
  double d;
  int i;
  i = 0xff & c;
  d = (((double)i) / 127.5) - 1.0;
  return d;
}


x86 assembly (clang, -O0):
<DecUnitFloat>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed1(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecUnitFloat>:
movzbl %dil,%eax
cvtsi2sd %eax,%xmm0
divsd  0xef0(%rip),%xmm0
addsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @DecUnitFloat(i32 %0) {
%2 = alloca i8
%3 = alloca double
%4 = alloca i32
%5 = trunc i32 %0 to i8
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = and i32 255, %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 1.275000e+02
%12 = fsub double %11, 1.000000e+00
store double %12, double* %3
%13 = load double, double* %3
ret double %13
}

LLVM IR (-O2):
define double @DecUnitFloat(i32 %0) {
%2 = and i32 %0, 255
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 1.275000e+02
%5 = fadd double %4, -1.000000e+00
ret double %5
}
int messageHasData(unsigned int command, unsigned int arg) {
  switch (command) {
  case 1:
  case 6:
    return 0;
  case 0:
  case 8:
  default:
    return -1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<messageHasData>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x8,%rax
ja     1140 <messageHasData+0x40>
mov    -0x18(%rbp),%rax
lea    0xeda(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1147 <messageHasData+0x47>
jmp    1140 <messageHasData+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<messageHasData>:
cmp    $0x1,%edi
setne  %al
cmp    $0x6,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @messageHasData(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 1
%4 = icmp ne i32 %0, 6
%5 = and i1 %3, %4
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ timedriver();
int main() {
  timedriver();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <timedriver@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @timedriver()
ret i32 0
}
/* Variables and functions */
int doubleToRawLongBits(double);
double const longBitsToDouble(int);
__attribute__((always_)) const double upper(double d) {
  return longBitsToDouble(doubleToRawLongBits(d) & 0xfffffffff8000000LL);
}


x86 assembly (clang, -O0):
<upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <doubleToRawLongBits@plt>
cltq
and    $0xfffffffff8000000,%rax
mov    %eax,%edi
call   1030 <longBitsToDouble@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upper>:
push   %rax
call   1040 <doubleToRawLongBits@plt>
and    $0xf8000000,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <longBitsToDouble@plt>

LLVM IR (-O0):
define double @upper(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @doubleToRawLongBits(double %3)
%5 = sext i32 %4 to i64
%6 = and i64 %5, -134217728
%7 = trunc i64 %6 to i32
%8 = call double @longBitsToDouble(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @upper(double %0) {
%2 = tail call i32 @doubleToRawLongBits(double %0)
%3 = and i32 %2, -134217728
%4 = tail call double @longBitsToDouble(i32 %3)
ret double %4
}
long _snp_round(double value) {
  long intpart;
  intpart = value;
  value = value - intpart;
  if (value >= 0.5)
    intpart++;
  return intpart;
}


x86 assembly (clang, -O0):
<_snp_round>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     114a <_snp_round+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_snp_round>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
ucomisd 0xeea(%rip),%xmm0
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @_snp_round(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
store i64 %5, i64* %3
%6 = load double, double* %2
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to double
%9 = fsub double %6, %8
store double %9, double* %2
%10 = load double, double* %2
%11 = fcmp oge double %10, 5.000000e-01
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
br label %15
15: ; preds = %12, %1
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @_snp_round(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fcmp oge double %4, 5.000000e-01
%6 = zext i1 %5 to i64
%7 = add nsw i64 %6, %2
ret i64 %7
}
void ble_evt_system_protocol_error(
    const struct ble_msg_system_protocol_error_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_system_protocol_error_evt_t = type opaque
define void @ble_evt_system_protocol_error(%struct.ble_msg_system_protocol_error_evt_t* nocapture %0) {
ret void
}
char to_char(int x) {
  char h = (char)(x + '0');
  if ((x >= 10) && (x <= 15)) {
    h += 39;
  }
  return h;
}


x86 assembly (clang, -O0):
<to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x5(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     112e <to_char+0x2e>
cmpl   $0xf,-0x4(%rbp)
jg     112e <to_char+0x2e>
movsbl -0x5(%rbp),%eax
add    $0x27,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_char>:
mov    %edi,%eax
add    $0xfffffff6,%eax
cmp    $0x6,%eax
mov    $0x57,%ecx
mov    $0x30,%eax
cmovb  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @to_char(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 48
%6 = trunc i32 %5 to i8
store i8 %6, i8* %3
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 10
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 15
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = add nsw i32 %14, 39
%16 = trunc i32 %15 to i8
store i8 %16, i8* %3
br label %17
17: ; preds = %12, %9, %1
%18 = load i8, i8* %3
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @to_char(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i32 %0, -10
%4 = icmp ult i32 %3, 6
%5 = select i1 %4, i8 87, i8 48
%6 = add i8 %5, %2
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS12_MAC_DATA;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS12_MAC_DATA_it;
PKCS12_MAC_DATA *PKCS12_MAC_DATA_new(void) {
  return (PKCS12_MAC_DATA *)ASN1_item_new(&PKCS12_MAC_DATA_it);
}


x86 assembly (clang, -O0):
<PKCS12_MAC_DATA_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PKCS12_MAC_DATA_new>:
mov    0x2ed1(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@PKCS12_MAC_DATA_it = global i32 0
define i32* @PKCS12_MAC_DATA_new() {
%1 = call i64 @ASN1_item_new(i32* @PKCS12_MAC_DATA_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@PKCS12_MAC_DATA_it = global i32 0
define i32* @PKCS12_MAC_DATA_new() {
%1 = tail call i64 @ASN1_item_new(i32* @PKCS12_MAC_DATA_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
int execute_timerfd_settime() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_timerfd_settime() {
ret i32 0
}
/* Variables and functions */
int unbase64mem_full(char const *, size_t, int, void **, size_t *);
int unbase64mem(const char *p, size_t l, void **mem, size_t *len) {
  return unbase64mem_full(p, l, false, mem, len);
}


x86 assembly (clang, -O0):
<unbase64mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
xor    %edx,%edx
call   1030 <unbase64mem_full@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unbase64mem>:
mov    %rcx,%r8
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <unbase64mem_full@plt>

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

LLVM IR (-O2):
define i32 @unbase64mem(i8* %0, i64 %1, i8** %2, i64* %3) {
%5 = tail call i32 @unbase64mem_full(i8* %0, i64 %1, i32 0, i8** %2, i64* %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void printDate(int taskid) {
  time_t t = time(NULL);
  printf("%s", ctime(&t));
}


x86 assembly (clang, -O0):
<printDate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDate>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
lea    0xeb3(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @printDate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @time(i32* null)
store i32 %4, i32* %3
%5 = call i8* @ctime(i32* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printDate(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call i8* @ctime(i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
/* Type definitions */
struct mat2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat2_negative(float *, float *);
__attribute__((always_)) struct mat2 *psmat2_negative(struct mat2 *result,
                                                      struct mat2 *m) {
  mat2_negative((float *)result, (float *)m);
  return result;
}


x86 assembly (clang, -O0):
<psmat2_negative>:
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 <mat2_negative@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psmat2_negative>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat2_negative@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_negative(%struct.mat2* %0, %struct.mat2* %1) {
%3 = alloca %struct.mat2*
%4 = alloca %struct.mat2*
store %struct.mat2* %0, %struct.mat2** %3
store %struct.mat2* %1, %struct.mat2** %4
%5 = load %struct.mat2*, %struct.mat2** %3
%6 = bitcast %struct.mat2* %5 to float*
%7 = load %struct.mat2*, %struct.mat2** %4
%8 = bitcast %struct.mat2* %7 to float*
%9 = call i32 @mat2_negative(float* %6, float* %8)
%10 = load %struct.mat2*, %struct.mat2** %3
ret %struct.mat2* %10
}

LLVM IR (-O2):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_negative(%struct.mat2* returned %0, %struct.mat2* %1) {
%3 = bitcast %struct.mat2* %0 to float*
%4 = bitcast %struct.mat2* %1 to float*
%5 = tail call i32 @mat2_negative(float* %3, float* %4)
ret %struct.mat2* %0
}
/* Variables and functions */
int /*<<< orphan*/ TextChar(int /*<<< orphan*/);
void TextString(const char *s) {
  while (*s)
    TextChar(*s++);
}


x86 assembly (clang, -O0):
<TextString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <TextString+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <TextChar@plt>
jmp    111c <TextString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TextString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <TextString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <TextChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <TextString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @TextString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @TextChar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
int /*<<< orphan*/ strrchr_foo(char *, char);
void f(void) {
  foo();
  bar();
  strrchr_foo("", '.');
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1030 <bar@plt>
lea    0xeb7(%rip),%rdi
mov    $0x2e,%esi
call   1050 <strrchr_foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
call   1030 <bar@plt>
lea    0xeba(%rip),%rdi
mov    $0x2e,%esi
pop    %rax
jmp    1050 <strrchr_foo@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @f() {
%1 = call i32 (...) @foo()
%2 = call i32 (...) @bar()
%3 = call i32 @strrchr_foo(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8 signext 46)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @f() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @bar()
%3 = tail call i32 @strrchr_foo(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8 signext 46)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void oom_die(void) {
  fputs("Out of memory!\n", stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<oom_die>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<oom_die>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory!\0A\00"
@stderr = global i32 0
define void @oom_die() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory!\0A\00"
@stderr = global i32 0
define void @oom_die() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void rop3_92_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S ^ *D;
  stk2 = T | stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_92_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_92_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
xor    %sil,%cl
or     %dl,%cl
xor    %r8b,%cl
mov    %edx,%eax
not    %al
or     %sil,%al
and    %cl,%al
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_92_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = xor i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = and i32 %31, %33
%35 = load i8, i8* %7
%36 = zext i8 %35 to i32
%37 = load i8, i8* %6
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = or i32 %34, %40
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = xor i32 %45, -1
%47 = and i32 %43, %46
%48 = load i8*, i8** %4
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = and i32 %47, %50
%52 = or i32 %41, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_92_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = or i8 %5, %2
%7 = xor i8 %6, %4
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %7, %9
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %4
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *);
void *malloc(size_t);
void *h2o_mem_alloc(size_t sz) {
  void *p = malloc(sz);
  if (p == NULL)
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/nkmideb/h2o-server/refs/"
               "heads/master/include/h2o/memory.h"
               ":"
               "310"
               ":"
               "no memory");
  return p;
}


x86 assembly (clang, -O0):
<h2o_mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <h2o_mem_alloc+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <h2o_mem_alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nkmideb/h2o-server/refs/heads/master/include/h2o/memory.h:310:no memory\00"
define i8* @h2o_mem_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @h2o__fatal(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nkmideb/h2o-server/refs/heads/master/include/h2o/memory.h:310:no memory\00"
define noalias i8* @h2o_mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
long double asinl(long double);
long double acosl(long double x) {
  long double pi;
  pi = 3.14159265358979;
  return (pi / 2) - asinl(x);
}


x86 assembly (clang, -O0):
<acosl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldl   0xedc(%rip)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
flds   0xed8(%rip)
fdivrp %st,%st(1)
fstpt  -0x2c(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <asinl@plt>
fldt   -0x2c(%rbp)
fsubp  %st,%st(1)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acosl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <asinl@plt>
fsubrl 0xeda(%rip)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @acosl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
store x86_fp80 0xK4000C90FDAA221688800, x86_fp80* %3
%4 = load x86_fp80, x86_fp80* %3
%5 = fdiv x86_fp80 %4, 0xK40008000000000000000
%6 = load x86_fp80, x86_fp80* %2
%7 = call x86_fp80 @asinl(x86_fp80 %6)
%8 = fsub x86_fp80 %5, %7
ret x86_fp80 %8
}

LLVM IR (-O2):
define x86_fp80 @acosl(x86_fp80 %0) {
%2 = tail call x86_fp80 @asinl(x86_fp80 %0)
%3 = fsub x86_fp80 0xK3FFFC90FDAA221688800, %2
ret x86_fp80 %3
}
/* Type definitions */
struct t_gui_lines {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct t_gui_lines *);
void gui_lines_free(struct t_gui_lines *lines) { free(lines); }


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

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

LLVM IR (-O0):
%struct.t_gui_lines = type { i32 }
define void @gui_lines_free(%struct.t_gui_lines* %0) {
%2 = alloca %struct.t_gui_lines*
store %struct.t_gui_lines* %0, %struct.t_gui_lines** %2
%3 = load %struct.t_gui_lines*, %struct.t_gui_lines** %2
%4 = call i32 @free(%struct.t_gui_lines* %3)
ret void
}

LLVM IR (-O2):
%struct.t_gui_lines = type { i32 }
define void @gui_lines_free(%struct.t_gui_lines* nocapture %0) {
%2 = tail call i32 @free(%struct.t_gui_lines* %0)
ret void
}
/* Variables and functions */
int foo(int);
int main() { return foo(0) + foo(1) + foo(2) + foo(3) + foo(4); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <foo@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
call   1030 <foo@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <foo@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x3,%edi
call   1030 <foo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <foo@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1030 <foo@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <foo@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x2,%edi
call   1030 <foo@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    $0x3,%edi
call   1030 <foo@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x4,%edi
call   1030 <foo@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 0)
%3 = call i32 @foo(i32 1)
%4 = add nsw i32 %2, %3
%5 = call i32 @foo(i32 2)
%6 = add nsw i32 %4, %5
%7 = call i32 @foo(i32 3)
%8 = add nsw i32 %6, %7
%9 = call i32 @foo(i32 4)
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = tail call i32 @foo(i32 1)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @foo(i32 2)
%5 = add nsw i32 %3, %4
%6 = tail call i32 @foo(i32 3)
%7 = add nsw i32 %5, %6
%8 = tail call i32 @foo(i32 4)
%9 = add nsw i32 %7, %8
ret i32 %9
}
/* Variables and functions */
long long intMultiply(long long, long long);
long long int intSqr(long long int x) { return intMultiply(x, x); }


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

x86 assembly (clang, -O2):
<intSqr>:
mov    %rdi,%rsi
jmp    1030 <intMultiply@plt>

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

LLVM IR (-O2):
define i64 @intSqr(i64 %0) {
%2 = tail call i64 @intMultiply(i64 %0, i64 %0)
ret i64 %2
}
void divisao(void *num1, void *num2) {
  int *pnum1 = (int *)num1;
  int *pnum2 = (int *)num2;
  *pnum2 = *pnum2 == 0 ? 0 : *pnum1 / *pnum2;
}


x86 assembly (clang, -O0):
<divisao>:
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    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1133 <divisao+0x33>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1143 <divisao+0x43>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cltd
idivl  (%rcx)
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<divisao>:
mov    (%rsi),%ecx
test   %ecx,%ecx
je     110e <divisao+0xe>
mov    (%rdi),%eax
cltd
idiv   %ecx
mov    %eax,(%rsi)
ret
xor    %eax,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @divisao(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** %6
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
br label %21
15: ; preds = %2
%16 = load i32*, i32** %5
%17 = load i32, i32* %16
%18 = load i32*, i32** %6
%19 = load i32, i32* %18
%20 = sdiv i32 %17, %19
br label %21
21: ; preds = %15, %14
%22 = phi i32 [ 0, %14 ], [ %20, %15 ]
%23 = load i32*, i32** %6
store i32 %22, i32* %23
ret void
}

LLVM IR (-O2):
define void @divisao(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = bitcast i8* %0 to i32*
%8 = load i32, i32* %7
%9 = sdiv i32 %8, %4
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
store i32 %11, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, int);
void copy_dcub(int nx, int ny, int nz, double ***dest, double ***p) {
  memcpy(**dest, **p, nx * ny * nz * sizeof(double));
}


x86 assembly (clang, -O0):
<copy_dcub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dcub>:
mov    (%rcx),%rax
mov    (%rax),%rax
mov    (%r8),%rcx
mov    (%rcx),%rcx
imul   %esi,%edi
imul   %edi,%edx
shl    $0x3,%edx
mov    %rax,%rdi
mov    %rcx,%rsi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy_dcub(i32 %0, i32 %1, i32 %2, double*** %3, double*** %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double***
%10 = alloca double***
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double*** %3, double**** %9
store double*** %4, double**** %10
%11 = load double***, double**** %9
%12 = load double**, double*** %11
%13 = load double*, double** %12
%14 = load double***, double**** %10
%15 = load double**, double*** %14
%16 = load double*, double** %15
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %8
%21 = mul nsw i32 %19, %20
%22 = sext i32 %21 to i64
%23 = mul i64 %22, 8
%24 = trunc i64 %23 to i32
%25 = call i32 @memcpy(double* %13, double* %16, i32 %24)
ret void
}

LLVM IR (-O2):
define void @copy_dcub(i32 %0, i32 %1, i32 %2, double*** nocapture %3, double*** nocapture %4) {
%6 = load double**, double*** %3
%7 = load double*, double** %6
%8 = load double**, double*** %4
%9 = load double*, double** %8
%10 = shl i32 %0, 3
%11 = mul i32 %10, %1
%12 = mul i32 %11, %2
%13 = tail call i32 @memcpy(double* %7, double* %9, i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *mem = strdup(s);
  if (mem == NULL) {
    perror("strdup");
    exit(69);
  }
  return mem;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <xstrdup+0x3a>
lea    0xea5(%rip),%rdi
call   1030 <perror@plt>
mov    $0x45,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     113d <xstrdup+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    $0x45,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"strdup\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 69)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"strdup\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 69)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int mount(char const *, char const *, char const *, unsigned long,
          void const *);
int xmount(const char *source, const char *target, const char *filesystemtype,
           unsigned long mountflags, const void *data) {
  int ret = mount(source, target, filesystemtype, mountflags, data);
  if (ret == -1) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xmount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <mount@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0xffffffff,-0x2c(%rbp)
jne    1157 <xmount+0x47>
jmp    1157 <xmount+0x47>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmount>:
jmp    1030 <mount@plt>

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

LLVM IR (-O2):
define i32 @xmount(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = tail call i32 @mount(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4)
ret i32 %6
}
/* Type definitions */
struct _tuple9 {
  int dummy;
};
struct Cyc_Sexp_Parser {
  int dummy;
};

/* Variables and functions */
double Cyc_Sexp_longlong2double(unsigned long long);
struct _tuple9 *Cyc_Sexp_mk_double(double);
unsigned long long Cyc_Sexp_parse_longlong(struct Cyc_Sexp_Parser *);
struct _tuple9 *Cyc_Sexp_parse_double(struct Cyc_Sexp_Parser *p) {
  unsigned long long _T0;
  double _T1;
  struct _tuple9 *_T2;
  _T0 = Cyc_Sexp_parse_longlong(p);
  _T1 = Cyc_Sexp_longlong2double(_T0);
  _T2 = Cyc_Sexp_mk_double(_T1);
  return _T2;
}


x86 assembly (clang, -O0):
<Cyc_Sexp_parse_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <Cyc_Sexp_parse_longlong@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <Cyc_Sexp_longlong2double@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <Cyc_Sexp_mk_double@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Sexp_parse_double>:
push   %rax
call   1050 <Cyc_Sexp_parse_longlong@plt>
mov    %rax,%rdi
call   1040 <Cyc_Sexp_longlong2double@plt>
pop    %rax
jmp    1030 <Cyc_Sexp_mk_double@plt>

LLVM IR (-O0):
%struct._tuple9 = type { i32 }
%struct.Cyc_Sexp_Parser = type { i32 }
define %struct._tuple9* @Cyc_Sexp_parse_double(%struct.Cyc_Sexp_Parser* %0) {
%2 = alloca %struct.Cyc_Sexp_Parser*
%3 = alloca i64
%4 = alloca double
%5 = alloca %struct._tuple9*
store %struct.Cyc_Sexp_Parser* %0, %struct.Cyc_Sexp_Parser** %2
%6 = load %struct.Cyc_Sexp_Parser*, %struct.Cyc_Sexp_Parser** %2
%7 = call i64 @Cyc_Sexp_parse_longlong(%struct.Cyc_Sexp_Parser* %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = call double @Cyc_Sexp_longlong2double(i64 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call %struct._tuple9* @Cyc_Sexp_mk_double(double %10)
store %struct._tuple9* %11, %struct._tuple9** %5
%12 = load %struct._tuple9*, %struct._tuple9** %5
ret %struct._tuple9* %12
}

LLVM IR (-O2):
%struct._tuple9 = type { i32 }
%struct.Cyc_Sexp_Parser = type { i32 }
define %struct._tuple9* @Cyc_Sexp_parse_double(%struct.Cyc_Sexp_Parser* %0) {
%2 = tail call i64 @Cyc_Sexp_parse_longlong(%struct.Cyc_Sexp_Parser* %0)
%3 = tail call double @Cyc_Sexp_longlong2double(i64 %2)
%4 = tail call %struct._tuple9* @Cyc_Sexp_mk_double(double %3)
ret %struct._tuple9* %4
}
/* Variables and functions */
int f2(char *, char);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int q = 1;
  char s[8] = "Gorazde";
  q = f2(s, 's');
  printf("%d\n", q);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x73,%esi
call   1030 <f2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x65647a61726f47,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x73,%esi
call   1030 <f2@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s = [8 x i8] c"Gorazde\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [8 x i8]
store i32 0, i32* %1
store i32 1, i32* %2
%4 = bitcast [8 x i8]* %3 to i8*
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%6 = call i32 @f2(i8* %5, i8 signext 115)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 28539449431453511, i64* %1
%3 = call i32 @f2(i8* %2, i8 signext 115)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int cos(double);
int sin(double);
double p_inclinacion(double x) { return 2 * cos(x) * sin(x); }


x86 assembly (clang, -O0):
<p_inclinacion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_inclinacion>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
imul   %ebx,%eax
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @p_inclinacion(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @cos(double %3)
%5 = mul nsw i32 2, %4
%6 = load double, double* %2
%7 = call i32 @sin(double %6)
%8 = mul nsw i32 %5, %7
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @p_inclinacion(double %0) {
%2 = tail call i32 @cos(double %0)
%3 = shl nsw i32 %2, 1
%4 = tail call i32 @sin(double %0)
%5 = mul nsw i32 %3, %4
%6 = sitofp i32 %5 to double
ret double %6
}