xunge/DecIR huggingface dataset:
double dot_product(const double *v1, const double *v2) {
  double dp = 0.0;
  for (int i = 0; i < 3; i++)
    dp += v1[i] * v2[i];
  return dp;
}


x86 assembly (clang, -O0):
<dot_product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    115f <dot_product+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <dot_product+0x1b>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_product>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  (%rsi),%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
mulsd  0x8(%rsi),%xmm1
addsd  %xmm2,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dot_product(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store double 0.000000e+00, double* %5
store i32 0, i32* %6
br label %7
7: ; preds = %23, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load double*, double** %3
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
%20 = load double, double* %19
%21 = load double, double* %5
%22 = call double @llvm.fmuladd.f64(double %15, double %20, double %21)
store double %22, double* %5
br label %23
23: ; preds = %10
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %7
26: ; preds = %7
%27 = load double, double* %5
ret double %27
}

LLVM IR (-O2):
define double @dot_product(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double 0.000000e+00)
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %9, double %5)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ p18_tmr0();
int /*<<< orphan*/ serial(int /*<<< orphan*/);
void PIC18F67J94_periferic(void) {
  p18_tmr0();
  serial(0);
  ;
}


x86 assembly (clang, -O0):
<PIC18F67J94_periferic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <p18_tmr0@plt>
xor    %edi,%edi
call   1040 <serial@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC18F67J94_periferic>:
push   %rax
xor    %eax,%eax
call   1030 <p18_tmr0@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <serial@plt>

LLVM IR (-O0):
define void @PIC18F67J94_periferic() {
%1 = call i32 (...) @p18_tmr0()
%2 = call i32 @serial(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC18F67J94_periferic() {
%1 = tail call i32 (...) @p18_tmr0()
%2 = tail call i32 @serial(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  if (islower(c)) {
    return (c & 0x5F);
  }
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x8(%rbp),%eax
and    $0x5f,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
mov    %ebx,%ecx
and    $0x5f,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @islower(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = and i32 %8, 95
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = and i32 %0, 95
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlockattr_t;
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int pthread_rwlock_init(pthread_rwlock_t *rwlock,
                        const pthread_rwlockattr_t *attr) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_rwlock_init(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dll_fgetc(int /*<<< orphan*/ *);
int __wrap_fgetc(FILE *stream) { return dll_fgetc(stream); }


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

x86 assembly (clang, -O2):
<__wrap_fgetc>:
jmp    1030 <dll_fgetc@plt>

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

LLVM IR (-O2):
define i32 @__wrap_fgetc(i32* %0) {
%2 = tail call i32 @dll_fgetc(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int listen(int, int);
int /*<<< orphan*/ printf(char *);
void example_listen(int sock, int queueSize) {
  if (listen(sock, queueSize) == -1) {
    printf("server: listen() failed: ");
    close(sock);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<example_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <listen@plt>
cmp    $0xffffffff,%eax
jne    1184 <example_listen+0x44>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example_listen>:
push   %rbx
mov    %edi,%ebx
call   1050 <listen@plt>
cmp    $0xffffffff,%eax
je     114f <example_listen+0xf>
pop    %rbx
ret
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"server: listen() failed: \00"
@EXIT_FAILURE = global i32 0
define void @example_listen(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 = call i32 @listen(i32 %5, i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = call i32 @close(i32 %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"server: listen() failed: \00"
@EXIT_FAILURE = global i32 0
define void @example_listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @close(i32 %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret void
}
/* Variables and functions */
int IPC_CREAT;
int IPC_EXCL;
int /*<<< orphan*/ printf(char *, int);
int shmget(int, int, int);
void mainac() {
  int shmid = shmget(0XA, 26, IPC_CREAT | IPC_EXCL | 0666);
  printf("shmid %d\n", shmid);
}


x86 assembly (clang, -O0):
<mainac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    0x2eb8(%rip),%rax
or     (%rax),%edx
or     $0x1b6,%edx
mov    $0xa,%edi
mov    $0x1a,%esi
call   1040 <shmget@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mainac>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
mov    0x2ebf(%rip),%rax
or     (%rax),%edx
or     $0x1b6,%edx
mov    $0xa,%edi
mov    $0x1a,%esi
call   1040 <shmget@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@IPC_EXCL = global i32 0
@.str = [10 x i8] c"shmid %d\0A\00"
define void @mainac() {
%1 = alloca i32
%2 = load i32, i32* @IPC_CREAT
%3 = load i32, i32* @IPC_EXCL
%4 = or i32 %2, %3
%5 = or i32 %4, 438
%6 = call i32 @shmget(i32 10, i32 26, i32 %5)
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@IPC_EXCL = global i32 0
@.str = [10 x i8] c"shmid %d\0A\00"
define void @mainac() {
%1 = load i32, i32* @IPC_CREAT
%2 = load i32, i32* @IPC_EXCL
%3 = or i32 %1, %2
%4 = or i32 %3, 438
%5 = tail call i32 @shmget(i32 10, i32 26, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_wait(pthread_cond_t *__restrict __cond,
                      pthread_mutex_t *__restrict __mutex) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_cond_wait(i32* noalias nocapture readnone %0, i32* noalias nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
char *realloc(char *, int);
char *touch_realloc(char *ptr, int size) {
  char *result;
  int i;
  result = realloc(ptr, size);
  for (i = 0; i < size; i++)
    *(result + i) = 'a';
  return result;
}


x86 assembly (clang, -O0):
<touch_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <touch_realloc+0x4c>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x61,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1136 <touch_realloc+0x26>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<touch_realloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
jle    1140 <touch_realloc+0x20>
mov    %ebp,%edx
mov    %rbx,%rdi
mov    $0x61,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @touch_realloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i8* @realloc(i8* %7, i32 %8)
store i8* %9, i8** %5
store i32 0, i32* %6
br label %10
10: ; preds = %19, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 97, i8* %18
br label %19
19: ; preds = %14
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %10
22: ; preds = %10
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
define i8* @touch_realloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex16(int, unsigned short);
void print_spew_hex16(unsigned short value) { __console_tx_hex16(8, value); }


x86 assembly (clang, -O0):
<print_spew_hex16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x8,%edi
movzwl -0x2(%rbp),%esi
call   1030 <__console_tx_hex16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_spew_hex16>:
mov    %edi,%esi
mov    $0x8,%edi
jmp    1030 <__console_tx_hex16@plt>

LLVM IR (-O0):
define void @print_spew_hex16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @__console_tx_hex16(i32 8, i16 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @print_spew_hex16(i16 zeroext %0) {
%2 = tail call i32 @__console_tx_hex16(i32 8, i16 zeroext %0)
ret void
}
/* Variables and functions */
size_t div_round_up(size_t n, size_t d) { return (n + d - 1) / d; }


x86 assembly (clang, -O0):
<div_round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_round_up>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     111a <div_round_up+0x1a>
xor    %edx,%edx
div    %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i64 @div_round_up(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 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %4
%10 = udiv i64 %8, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @div_round_up(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = udiv i64 %4, %1
ret i64 %5
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
void clear_bit_val(unsigned int *src, int16_t seq) {
  int x, y;
  x = src[seq / 32];
  y = ~(1 << (seq % 32));
  x &= y;
  src[seq / 32] = x;
}


x86 assembly (clang, -O0):
<clear_bit_val>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    -0x24(%rbp),%edx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit_val>:
mov    %esi,%ecx
lea    0x1f(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x5,%eax
mov    $0xfffffffe,%edx
rol    %cl,%edx
cltq
and    %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @clear_bit_val(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = sdiv i32 %8, 32
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %7, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = srem i32 %13, 32
%15 = shl i32 1, %14
%16 = xor i32 %15, -1
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = load i32, i32* %5
%19 = and i32 %18, %17
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = load i32*, i32** %3
%22 = load i32, i32* %4
%23 = sdiv i32 %22, 32
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %21, i64 %24
store i32 %20, i32* %25
ret void
}

LLVM IR (-O2):
define void @clear_bit_val(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 32
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 31
%8 = shl nuw i32 1, %7
%9 = xor i32 %8, -1
%10 = and i32 %6, %9
store i32 %10, i32* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS)
    stream = stdout;
  fprintf(stream, "Usage: %s <ut_line> [utmp_file] [wtmp_file]\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [45 x i8] c"Usage: %s <ut_line> [utmp_file] [wtmp_file]\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [45 x i8] c"Usage: %s <ut_line> [utmp_file] [wtmp_file]\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
size_t pread(int, void *, size_t, int /*<<< orphan*/);
size_t txc_libc_pread(int fd, void *buf, size_t count, off_t offset) {
  return pread(fd, buf, count, offset);
}


x86 assembly (clang, -O0):
<txc_libc_pread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <pread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txc_libc_pread>:
jmp    1030 <pread@plt>

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

LLVM IR (-O2):
define i64 @txc_libc_pread(i32 %0, i8* nocapture %1, i64 %2, i32 %3) {
%5 = tail call i64 @pread(i32 %0, i8* %1, i64 %2, i32 %3)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ run_valid(int);
int main() {
  run_valid(1024);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x400,%edi
call   1030 <run_valid@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @run_valid(i32 1024)
ret i32 0
}
void avio_accept() {}


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

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

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

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

/* Variables and functions */
struct CList *init(int);
int /*<<< orphan*/ merge(struct CList *);
int /*<<< orphan*/ print(struct CList *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  struct CList *head;
  head = init(500);
  printf("\nМасивите преди сортирането:\n");
  print(head);
  printf("Резултатът от сливането:");
  merge(head);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1f4,%edi
call   1050 <init@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <print@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <merge@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1f4,%edi
call   1060 <init@plt>
mov    %rax,%rbx
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <print@plt>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1070 <merge@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.CList = type { i32 }
@.str = [54 x i8] c"\0A\D0\9C\D0\B0\D1\81\D0\B8\D0\B2\D0\B8\D1\82\D0\B5 \D0\BF\D1\80\D0\B5\D0\B4\D0\B8 \D1\81\D0\BE\D1\80\D1\82\D0\B8\D1\80\D0\B0\D0\BD\D0\B5\D1\82\D0\BE:\0A\00"
@.str.1 = [46 x i8] c"\D0\A0\D0\B5\D0\B7\D1\83\D0\BB\D1\82\D0\B0\D1\82\D1\8A\D1\82 \D0\BE\D1\82 \D1\81\D0\BB\D0\B8\D0\B2\D0\B0\D0\BD\D0\B5\D1\82\D0\BE:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.CList*
store i32 0, i32* %1
%3 = call %struct.CList* @init(i32 500)
store %struct.CList* %3, %struct.CList** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%5 = load %struct.CList*, %struct.CList** %2
%6 = call i32 @print(%struct.CList* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%8 = load %struct.CList*, %struct.CList** %2
%9 = call i32 @merge(%struct.CList* %8)
ret i32 0
}

LLVM IR (-O2):
%struct.CList = type { i32 }
@.str.1 = [46 x i8] c"\D0\A0\D0\B5\D0\B7\D1\83\D0\BB\D1\82\D0\B0\D1\82\D1\8A\D1\82 \D0\BE\D1\82 \D1\81\D0\BB\D0\B8\D0\B2\D0\B0\D0\BD\D0\B5\D1\82\D0\BE:\00"
@str = [53 x i8] c"\0A\D0\9C\D0\B0\D1\81\D0\B8\D0\B2\D0\B8\D1\82\D0\B5 \D0\BF\D1\80\D0\B5\D0\B4\D0\B8 \D1\81\D0\BE\D1\80\D1\82\D0\B8\D1\80\D0\B0\D0\BD\D0\B5\D1\82\D0\BE:\00"
define i32 @main() {
%1 = tail call %struct.CList* @init(i32 500)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @print(%struct.CList* %1)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @merge(%struct.CList* %1)
ret i32 0
}
/* Variables and functions */
double M_PI;
int find_wrap(double pixelL_value, double pixelR_value) {
  double difference;
  int wrap_value;
  difference = pixelL_value - pixelR_value;
  if (difference > M_PI)
    wrap_value = -1;
  else if (difference < -M_PI)
    wrap_value = 1;
  else
    wrap_value = 0;
  return wrap_value;
}


x86 assembly (clang, -O0):
<find_wrap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
ucomisd (%rax),%xmm0
jbe    113f <find_wrap+0x3f>
movl   $0xffffffff,-0x1c(%rbp)
jmp    1188 <find_wrap+0x88>
movsd  -0x18(%rbp),%xmm1
mov    0x2e9d(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jbe    117c <find_wrap+0x7c>
movl   $0x1,-0x1c(%rbp)
jmp    1183 <find_wrap+0x83>
movl   $0x0,-0x1c(%rbp)
jmp    1188 <find_wrap+0x88>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_wrap>:
subsd  %xmm1,%xmm0
mov    0x2edd(%rip),%rax
movsd  (%rax),%xmm1
movapd 0xee9(%rip),%xmm2
xorpd  %xmm1,%xmm2
xor    %ecx,%ecx
ucomisd %xmm0,%xmm2
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define i32 @find_wrap(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fsub double %7, %8
store double %9, double* %5
%10 = load double, double* %5
%11 = load double, double* @M_PI
%12 = fcmp ogt double %10, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %6
br label %22
14: ; preds = %2
%15 = load double, double* %5
%16 = load double, double* @M_PI
%17 = fneg double %16
%18 = fcmp olt double %15, %17
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 1, i32* %6
br label %21
20: ; preds = %14
store i32 0, i32* %6
br label %21
21: ; preds = %20, %19
br label %22
22: ; preds = %21, %13
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define i32 @find_wrap(double %0, double %1) {
%3 = fsub double %0, %1
%4 = load double, double* @M_PI
%5 = fcmp ogt double %3, %4
%6 = fneg double %4
%7 = fcmp olt double %3, %6
%8 = zext i1 %7 to i32
%9 = select i1 %5, i32 -1, i32 %8
ret i32 %9
}
long Ymd_date(int year, int month, int day) {
  return ((long)year * 10000L + (long)month * 100L + (long)day);
}


x86 assembly (clang, -O0):
<Ymd_date>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movslq -0x4(%rbp),%rax
imul   $0x2710,%rax,%rax
movslq -0x8(%rbp),%rcx
imul   $0x64,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ymd_date>:
movslq %edi,%rax
imul   $0x2710,%rax,%rax
movslq %esi,%rcx
imul   $0x64,%rcx,%rcx
add    %rax,%rcx
movslq %edx,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @Ymd_date(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul nsw i64 %8, 10000
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = mul nsw i64 %11, 100
%13 = add nsw i64 %9, %12
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = add nsw i64 %13, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @Ymd_date(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = mul nsw i64 %4, 10000
%6 = sext i32 %1 to i64
%7 = mul nsw i64 %6, 100
%8 = add nsw i64 %7, %5
%9 = sext i32 %2 to i64
%10 = add nsw i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ printArray();
void main() { printArray(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @printArray()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Atm128CounterC__1__Timer__overflow();
int /*<<< orphan*/ Atm128TimerInitC__1__Timer__overflow();
void HplAtm128Timer3P__Timer__overflow(void) {
  Atm128TimerInitC__1__Timer__overflow();
  Atm128CounterC__1__Timer__overflow();
}


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

x86 assembly (clang, -O2):
<HplAtm128Timer3P__Timer__overflow>:
push   %rax
xor    %eax,%eax
call   1040 <Atm128TimerInitC__1__Timer__overflow@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Atm128CounterC__1__Timer__overflow@plt>

LLVM IR (-O0):
define void @HplAtm128Timer3P__Timer__overflow() {
%1 = call i32 (...) @Atm128TimerInitC__1__Timer__overflow()
%2 = call i32 (...) @Atm128CounterC__1__Timer__overflow()
ret void
}

LLVM IR (-O2):
define void @HplAtm128Timer3P__Timer__overflow() {
%1 = tail call i32 (...) @Atm128TimerInitC__1__Timer__overflow()
%2 = tail call i32 (...) @Atm128CounterC__1__Timer__overflow()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void memcpy4() {
  char src[] = {1, 2, 3, 4};
  char dst[10];
  memcpy(dst + 2, src + 2, 3);
}


x86 assembly (clang, -O0):
<memcpy4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
add    $0x2,%rdi
lea    -0x4(%rbp),%rsi
add    $0x2,%rsi
mov    $0x3,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy4>:
sub    $0x18,%rsp
movl   $0x4030201,0x8(%rsp)
04
lea    0x10(%rsp),%rdi
lea    0xa(%rsp),%rsi
mov    $0x3,%edx
call   1030 <memcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.memcpy4.src = [4 x i8] c"\01\02\03\04"
define void @memcpy4() {
%1 = alloca [4 x i8]
%2 = alloca [10 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds i8, i8* %4, i64 2
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = call i32 @memcpy(i8* %5, i8* %7, i32 3)
ret void
}

LLVM IR (-O2):
define void @memcpy4() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = bitcast i32* %1 to i8*
store i32 67305985, i32* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 2
%6 = getelementptr inbounds i8, i8* %3, i64 2
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = -100;
  printf("%d", a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 -100)
ret i32 0
}
/* Variables and functions */
int f169(int *);
int f170(int *p) { return f169(p); }


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

x86 assembly (clang, -O2):
<f170>:
jmp    1030 <f169@plt>

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

LLVM IR (-O2):
define i32 @f170(i32* %0) {
%2 = tail call i32 @f169(i32* %0)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ format;
};
typedef TYPE_1__ XTextProperty;

/* Variables and functions */
int get_XTextProperty_format(void *_p) {
  return (int)((XTextProperty *)_p)->format;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XTextProperty_format(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int stub_ast_sign_bin(struct ast_key *key, const char *msg, int msglen,
                      unsigned char *sig) {
  ast_log(2,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/tpenguin/solarisvoip-asterisk/refs/heads/"
          "master/cryptostub.c",
          55, __PRETTY_FUNCTION__, "Crypto support not loaded!\n");
  return -1;
}


x86 assembly (clang, -O0):
<stub_ast_sign_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x2,%edi
lea    0xecd(%rip),%rsi
mov    $0x37,%edx
lea    0xf58(%rip),%rcx
lea    0xf9d(%rip),%r8
mov    $0x0,%al
call   1030 <ast_log@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stub_ast_sign_bin>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xf78(%rip),%rcx
lea    0xfbd(%rip),%r8
mov    $0x2,%edi
mov    $0x37,%edx
xor    %eax,%eax
call   1030 <ast_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ast_key = type opaque
@.str = [151 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tpenguin/solarisvoip-asterisk/refs/heads/master/cryptostub.c\00"
@__PRETTY_FUNCTION__.stub_ast_sign_bin = [76 x i8] c"int stub_ast_sign_bin(struct ast_key *, const char *, int, unsigned char *)\00"
@.str.1 = [28 x i8] c"Crypto support not loaded!\0A\00"
define i32 @stub_ast_sign_bin(%struct.ast_key* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca %struct.ast_key*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store %struct.ast_key* %0, %struct.ast_key** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = call i32 (i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @ast_log to i32 (i32, i8*, i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @__PRETTY_FUNCTION__.stub_ast_sign_bin, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.ast_key = type opaque
@.str = [151 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tpenguin/solarisvoip-asterisk/refs/heads/master/cryptostub.c\00"
@__PRETTY_FUNCTION__.stub_ast_sign_bin = [76 x i8] c"int stub_ast_sign_bin(struct ast_key *, const char *, int, unsigned char *)\00"
@.str.1 = [28 x i8] c"Crypto support not loaded!\0A\00"
define i32 @stub_ast_sign_bin(%struct.ast_key* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
%5 = tail call i32 (i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @ast_log to i32 (i32, i8*, i32, i8*, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @__PRETTY_FUNCTION__.stub_ast_sign_bin, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
int iupStrCountChar(const char *str, char c) {
  int n;
  if (!str)
    return 0;
  for (n = 0; *str; str++) {
    if (*str == c)
      n++;
  }
  return n;
}


x86 assembly (clang, -O0):
<iupStrCountChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1125 <iupStrCountChar+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1171 <iupStrCountChar+0x71>
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <iupStrCountChar+0x6b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1155 <iupStrCountChar+0x55>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115a <iupStrCountChar+0x5a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <iupStrCountChar+0x2c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupStrCountChar>:
xor    %eax,%eax
test   %rdi,%rdi
je     1135 <iupStrCountChar+0x35>
mov    (%rdi),%cl
test   %cl,%cl
je     1135 <iupStrCountChar+0x35>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <iupStrCountChar+0x20>
ret

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

LLVM IR (-O2):
define i32 @iupStrCountChar(i8* %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %4, %7
%8 = phi i8 [ %15, %7 ], [ %5, %4 ]
%9 = phi i32 [ %13, %7 ], [ 0, %4 ]
%10 = phi i8* [ %14, %7 ], [ %0, %4 ]
%11 = icmp eq i8 %8, %1
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %9, %12
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %4, %2
%18 = phi i32 [ 0, %2 ], [ 0, %4 ], [ %13, %7 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("welcome to c programming\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"welcome to c programming\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int f_ne_rr2(float a1, float a2) { return !(((a1) != (a2))); }


x86 assembly (clang, -O0):
<f_ne_rr2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ne_rr2>:
cmpeqss %xmm1,%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_ne_rr2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp une float %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_ne_rr2(float %0, float %1) {
%3 = fcmp oeq float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int int_min(int a, int b) { return a > b ? b : a; }


x86 assembly (clang, -O0):
<int_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <int_min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <int_min+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @int_min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int read(int /*<<< orphan*/, char *, int);
long strtol(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ x_perror(char *);
long read_long() {
  char lbuf[10];
  if (read(0, lbuf, 8) != 8)
    x_perror("read_long");
  lbuf[8] = 0;
  return strtol(lbuf, 0, 16);
}


x86 assembly (clang, -O0):
<read_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rsi
xor    %edi,%edi
mov    $0x8,%edx
call   1040 <read@plt>
cmp    $0x8,%eax
je     115d <read_long+0x2d>
lea    0xea8(%rip),%rdi
call   1030 <x_perror@plt>
movb   $0x0,-0x2(%rbp)
lea    -0xa(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_long>:
sub    $0x18,%rsp
lea    0xe(%rsp),%rsi
xor    %edi,%edi
mov    $0x8,%edx
call   1040 <read@plt>
cmp    $0x8,%eax
je     1156 <read_long+0x26>
lea    0xeaf(%rip),%rdi
call   1030 <x_perror@plt>
movb   $0x0,0x16(%rsp)
lea    0xe(%rsp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <strtol@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"read_long\00"
define i64 @read_long() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 8)
%4 = icmp eq i32 %3, 8
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @x_perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 8
store i8 0, i8* %8
%9 = call i64 @strtol(i8* %2, i32 0, i32 16)
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ ls(char *);
void main() { ls("."); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define void @main() {
%1 = tail call i32 @ls(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_command(unsigned int *, int, int);
int /*<<< orphan*/ ipfw_init(int, char **, unsigned int, char const *,
                             int /*<<< orphan*/);
scalar_t__ optind;
int ipfw_check(int args, char **arglist, const char *chain) {
  unsigned int command = 0;
  add_command(&command, 0x2000U, 0x0000U);
  ipfw_init(args, arglist, command, chain, 0);
  optind = 0;
  return (0);
}


x86 assembly (clang, -O0):
<ipfw_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
mov    $0x2000,%esi
xor    %edx,%edx
call   1040 <add_command@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <ipfw_init@plt>
mov    0x2e81(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipfw_check>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x2000,%esi
xor    %edx,%edx
call   1040 <add_command@plt>
mov    0xc(%rsp),%edx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rcx
xor    %r8d,%r8d
call   1030 <ipfw_init@plt>
mov    0x2e84(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@optind = global i64 0
define i32 @ipfw_check(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
store i32 0, i32* %7
%8 = call i32 @add_command(i32* %7, i32 8192, i32 0)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = load i32, i32* %7
%12 = load i8*, i8** %6
%13 = call i32 @ipfw_init(i32 %9, i8** %10, i32 %11, i8* %12, i32 0)
store i64 0, i64* @optind
ret i32 0
}

LLVM IR (-O2):
@optind = global i64 0
define i32 @ipfw_check(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @add_command(i32* %4, i32 8192, i32 0)
%7 = load i32, i32* %4
%8 = call i32 @ipfw_init(i32 %0, i8** %1, i32 %7, i8* %2, i32 0)
store i64 0, i64* @optind
ret i32 0
}