xunge/DecIR huggingface dataset:
/* Variables and functions */
int tng_compress_uncompress_vel_gen(char *, double *, int /*<<< orphan*/ *,
                                    int /*<<< orphan*/ *, unsigned long *,
                                    unsigned long *);
int tng_compress_uncompress_vel(char *data, double *vel) {
  unsigned long prec_hi, prec_lo;
  return tng_compress_uncompress_vel_gen(data, vel, NULL, NULL, &prec_hi,
                                         &prec_lo);
}


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

x86 assembly (clang, -O2):
<tng_compress_uncompress_vel>:
sub    $0x18,%rsp
lea    0x10(%rsp),%r8
lea    0x8(%rsp),%r9
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <tng_compress_uncompress_vel_gen@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @tng_compress_uncompress_vel(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store double* %1, double** %4
%7 = load i8*, i8** %3
%8 = load double*, double** %4
%9 = call i32 @tng_compress_uncompress_vel_gen(i8* %7, double* %8, i32* null, i32* null, i64* %5, i64* %6)
ret i32 %9
}

LLVM IR (-O2):
define i32 @tng_compress_uncompress_vel(i8* %0, double* %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
%6 = bitcast i64* %4 to i8*
%7 = call i32 @tng_compress_uncompress_vel_gen(i8* %0, double* %1, i32* null, i32* null, i64* %3, i64* %4)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void usage(FILE *fp, int rc) {
  fprintf(fp, "Usage: load [-?h] [-o offset] [-d device] <file>\n\n"
              "\t-h?\t\tthis help\n"
              "\t-o offset\toffset into the SPI device to start\n"
              "\t-d\t\tSPI device (default /dev/spi)\n");
  exit(rc);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rcx
lea    0xed3(%rip),%rdi
mov    $0x94,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %ebx,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [149 x i8] c"Usage: load [-?h] [-o offset] [-d device] <file>\0A\0A\09-h?\09\09this help\0A\09-o offset\09offset into the SPI device to start\0A\09-d\09\09SPI device (default /dev/spi)\0A\00"
define void @usage(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 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [149 x i8] c"Usage: load [-?h] [-o offset] [-d device] <file>\0A\0A\09-h?\09\09this help\0A\09-o offset\09offset into the SPI device to start\0A\09-d\09\09SPI device (default /dev/spi)\0A\00"
define void @usage(i32* nocapture %0, i32 %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0), i64 148, i64 1, i32* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
scalar_t__ parsemalloc(int);
char *ParseMalloc(int x) { return ((char *)parsemalloc(x)); }


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

x86 assembly (clang, -O2):
<ParseMalloc>:
jmp    1030 <parsemalloc@plt>

LLVM IR (-O0):
define i8* @ParseMalloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @parsemalloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @ParseMalloc(i32 %0) {
%2 = tail call i64 @parsemalloc(i32 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeCAN(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000004, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeCAN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x4,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeCAN>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeCAN(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 @GPIODirModeSet(i32 %5, i32 %6, i32 2)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @GPIOPadConfigSet(i32 %8, i32 %9, i32 4, i32 8)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeCAN(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 4, i32 8)
ret void
}
int main() {
  char *friends = {"Ai", "Bob"};
  char *copy = strdup(friends[0]);
  printf("%s\n", &copy);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbq (%rax),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
lea    0xeb1(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x41,%edi
call   1040 <strdup@plt>
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"Ai\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = tail call i8* @strdup(i8* inttoptr (i64 65 to i8*))
store i8* %3, i8** %1
%4 = call i32 @puts(i8* %2)
ret i32 0
}
int emac1_etherstatsdropevents_set(unsigned int dev_id,
                                   union emac1_etherstatsdropevents_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac1_etherstatsdropevents_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.emac1_etherstatsdropevents_u = type opaque
define i32 @emac1_etherstatsdropevents_set(i32 %0, %union.emac1_etherstatsdropevents_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_etherstatsdropevents_u*
store i32 %0, i32* %3
store %union.emac1_etherstatsdropevents_u* %1, %union.emac1_etherstatsdropevents_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_etherstatsdropevents_u = type opaque
define i32 @emac1_etherstatsdropevents_set(i32 %0, %union.emac1_etherstatsdropevents_u* nocapture readnone %1) {
ret i32 1
}
/* Type definitions */
struct circular_buffer {
  int dummy;
};

/* Variables and functions */
int _available_data(struct circular_buffer *);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ lock(struct circular_buffer *);
int /*<<< orphan*/ unlock(struct circular_buffer *);
int cb_available_data(struct circular_buffer *buffer) {
  int available = 0;
  lock(buffer);
  available = _available_data(buffer);
  unlock(buffer);
  assert(available >= 0);
  return available;
}


x86 assembly (clang, -O0):
<cb_available_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <lock@plt>
mov    -0x8(%rbp),%rdi
call   1050 <_available_data@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlock@plt>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_available_data>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <lock@plt>
mov    %rbx,%rdi
call   1050 <_available_data@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <unlock@plt>
mov    %ebp,%edi
not    %edi
shr    $0x1f,%edi
call   1060 <assert@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.circular_buffer = type { i32 }
define i32 @cb_available_data(%struct.circular_buffer* %0) {
%2 = alloca %struct.circular_buffer*
%3 = alloca i32
store %struct.circular_buffer* %0, %struct.circular_buffer** %2
store i32 0, i32* %3
%4 = load %struct.circular_buffer*, %struct.circular_buffer** %2
%5 = call i32 @lock(%struct.circular_buffer* %4)
%6 = load %struct.circular_buffer*, %struct.circular_buffer** %2
%7 = call i32 @_available_data(%struct.circular_buffer* %6)
store i32 %7, i32* %3
%8 = load %struct.circular_buffer*, %struct.circular_buffer** %2
%9 = call i32 @unlock(%struct.circular_buffer* %8)
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.circular_buffer = type { i32 }
define i32 @cb_available_data(%struct.circular_buffer* %0) {
%2 = tail call i32 @lock(%struct.circular_buffer* %0)
%3 = tail call i32 @_available_data(%struct.circular_buffer* %0)
%4 = tail call i32 @unlock(%struct.circular_buffer* %0)
%5 = xor i32 %3, -1
%6 = lshr i32 %5, 31
%7 = tail call i32 @assert(i32 %6)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ system(char *);
void usage(char *progname) {
  system("clear");
  printf("usage: %s <address> <low port> <high port> \n", progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <system@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <system@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [45 x i8] c"usage: %s <address> <low port> <high port> \0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [45 x i8] c"usage: %s <address> <low port> <high port> \0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double *lsd_scale(int *, double *, int, int, double);
double *lsd(int *n_out, double *img, int X, int Y) {
  double scale = 0.8;
  return lsd_scale(n_out, img, X, Y, scale);
}


x86 assembly (clang, -O0):
<lsd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
movsd  -0x20(%rbp),%xmm0
call   1030 <lsd_scale@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsd>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <lsd_scale@plt>

LLVM IR (-O0):
define double* @lsd(i32* %0, double* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
store i32* %0, i32** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store double 8.000000e-01, double* %9
%10 = load i32*, i32** %5
%11 = load double*, double** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load double, double* %9
%15 = call double* @lsd_scale(i32* %10, double* %11, i32 %12, i32 %13, double %14)
ret double* %15
}

LLVM IR (-O2):
define double* @lsd(i32* %0, double* %1, i32 %2, i32 %3) {
%5 = tail call double* @lsd_scale(i32* %0, double* %1, i32 %2, i32 %3, double 8.000000e-01)
ret double* %5
}
/* Variables and functions */
scalar_t__ EINTR;
int /*<<< orphan*/ LOCK_SH;
scalar_t__ errno;
int flock(int, int /*<<< orphan*/);
int zflock_share(int fd) {
  int ret;
  do {
    ret = flock(fd, LOCK_SH);
  } while ((ret < 0) && (errno == EINTR));
  return ret;
  ;
}


x86 assembly (clang, -O0):
<zflock_share>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <flock@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jge    1158 <zflock_share+0x48>
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    111b <zflock_share+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zflock_share>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ec7(%rip),%r14
mov    0x2eb0(%rip),%r15
mov    0x2ea1(%rip),%r12
nop
mov    (%r14),%esi
mov    %ebx,%edi
call   1030 <flock@plt>
test   %eax,%eax
jns    1147 <zflock_share+0x37>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <zflock_share+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@LOCK_SH = global i32 0
@errno = global i64 0
@EINTR = global i64 0
define i32 @zflock_share(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %2
%6 = load i32, i32* @LOCK_SH
%7 = call i32 @flock(i32 %5, i32 %6)
store i32 %7, i32* %3
br label %8
8: ; preds = %4
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i64, i64* @errno
%13 = load i64, i64* @EINTR
%14 = icmp eq i64 %12, %13
br label %15
15: ; preds = %11, %8
%16 = phi i1 [ false, %8 ], [ %14, %11 ]
br i1 %16, label %4, label %17
17: ; preds = %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@LOCK_SH = global i32 0
@errno = global i64 0
@EINTR = global i64 0
define i32 @zflock_share(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @LOCK_SH
%4 = tail call i32 @flock(i32 %0, i32 %3)
%5 = icmp slt i32 %4, 0
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINTR
%8 = icmp eq i64 %6, %7
%9 = select i1 %5, i1 %8, i1 false
br i1 %9, label %2, label %10
10: ; preds = %2
ret i32 %4
}
/* Variables and functions */
int type1(int *, int, int /*<<< orphan*/, int /*<<< orphan*/,
          int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int type(void *v) {
  int *msgvec = v;
  return (type1(msgvec, 1, 0, 0, 0, NULL, NULL));
}


x86 assembly (clang, -O0):
<type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
xor    %r8d,%r8d
xor    %eax,%eax
mov    %eax,%r9d
mov    %r8d,%edx
mov    %r8d,%ecx
movq   $0x0,(%rsp)
call   1030 <type1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<type>:
push   %rax
movq   $0x0,(%rsp)
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <type1@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @type(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @type1(i32* %6, i32 1, i32 0, i32 0, i32 0, i32* null, i32* null)
ret i32 %7
}

LLVM IR (-O2):
define i32 @type(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @type1(i32* %2, i32 1, i32 0, i32 0, i32 0, i32* null, i32* null)
ret i32 %3
}
/* Type definitions */
struct Rational {
  int dummy;
};

/* Variables and functions */
struct Rational *rational_get(int /*<<< orphan*/, int);
struct Rational *rational_create() {
  return rational_get(0, 1);
}


x86 assembly (clang, -O0):
<rational_create>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <rational_get@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rational_create>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <rational_get@plt>

LLVM IR (-O0):
%struct.Rational = type { i32 }
define %struct.Rational* @rational_create() {
%1 = call %struct.Rational* @rational_get(i32 0, i32 1)
ret %struct.Rational* %1
}

LLVM IR (-O2):
%struct.Rational = type { i32 }
define %struct.Rational* @rational_create() {
%1 = tail call %struct.Rational* @rational_get(i32 0, i32 1)
ret %struct.Rational* %1
}
/* Variables and functions */
void target_ignore(void) {}


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

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

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

LLVM IR (-O2):
define void @target_ignore() {
ret void
}
int test_imm_C9int8_reg(signed char val) {
  return ((val) & (-0xC9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C9int8_reg>:
test   $0xffffff37,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C9int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -201
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t hash_integer(uint64_t integer) {
  return 11400714819674759057UL * (integer ^ integer >> 3);
}


x86 assembly (clang, -O0):
<hash_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x3,%ecx
xor    %ecx,%eax
cltq
movabs $0x9e3779b9943edf91,%rcx
79 37 9e
imul   %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_integer>:
mov    %edi,%eax
sar    $0x3,%eax
xor    %edi,%eax
imul   $0x943edf91,%eax,%eax
ret

LLVM IR (-O0):
define i32 @hash_integer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 3
%6 = xor i32 %3, %5
%7 = sext i32 %6 to i64
%8 = mul i64 -7046029254034792559, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @hash_integer(i32 %0) {
%2 = ashr i32 %0, 3
%3 = xor i32 %2, %0
%4 = mul i32 %3, -1807818863
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void debug(char *msg) { printf("%s\r\n", msg); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0D\0A\00"
define void @debug(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
size_t int_find(int);
void int_doall_arg(int *p, short *f) { f[int_find(*p)]++; }


x86 assembly (clang, -O0):
<int_doall_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <int_find@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    (%rax,%rcx,2),%dx
add    $0x1,%dx
mov    %dx,(%rax,%rcx,2)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_doall_arg>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <int_find@plt>
addw   $0x1,(%rbx,%rax,2)
pop    %rbx
ret

LLVM IR (-O0):
define void @int_doall_arg(i32* %0, i16* %1) {
%3 = alloca i32*
%4 = alloca i16*
store i32* %0, i32** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i64 @int_find(i32 %7)
%9 = getelementptr inbounds i16, i16* %5, i64 %8
%10 = load i16, i16* %9
%11 = add i16 %10, 1
store i16 %11, i16* %9
ret void
}

LLVM IR (-O2):
define void @int_doall_arg(i32* nocapture %0, i16* nocapture %1) {
%3 = load i32, i32* %0
%4 = tail call i64 @int_find(i32 %3)
%5 = getelementptr inbounds i16, i16* %1, i64 %4
%6 = load i16, i16* %5
%7 = add i16 %6, 1
store i16 %7, i16* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AAAA_CONTROL_LOOP_IMPL();
int /*<<< orphan*/ AAAA_TEMPERATURE_IMPL();
int /*<<< orphan*/ AIBV_plant_IMPL();
int /*<<< orphan*/ omp_set_num_threads(int);
int main(int argc, char *argv[]) {
  omp_set_num_threads(4);
#pragma omp parallel sections
  {
#pragma omp section
    { AAAA_CONTROL_LOOP_IMPL(); }
#pragma omp section
    { AAAA_TEMPERATURE_IMPL(); }
#pragma omp section
    { AIBV_plant_IMPL(); }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1060 <omp_set_num_threads@plt>
mov    $0x0,%al
call   1050 <AAAA_CONTROL_LOOP_IMPL@plt>
mov    $0x0,%al
call   1040 <AAAA_TEMPERATURE_IMPL@plt>
mov    $0x0,%al
call   1030 <AIBV_plant_IMPL@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1060 <omp_set_num_threads@plt>
xor    %eax,%eax
call   1050 <AAAA_CONTROL_LOOP_IMPL@plt>
xor    %eax,%eax
call   1040 <AAAA_TEMPERATURE_IMPL@plt>
xor    %eax,%eax
call   1030 <AIBV_plant_IMPL@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @omp_set_num_threads(i32 4)
%6 = call i32 (...) @AAAA_CONTROL_LOOP_IMPL()
%7 = call i32 (...) @AAAA_TEMPERATURE_IMPL()
%8 = call i32 (...) @AIBV_plant_IMPL()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @omp_set_num_threads(i32 4)
%4 = tail call i32 (...) @AAAA_CONTROL_LOOP_IMPL()
%5 = tail call i32 (...) @AAAA_TEMPERATURE_IMPL()
%6 = tail call i32 (...) @AIBV_plant_IMPL()
ret i32 0
}
char *strcpy(char *dest, const char *src) {
  char *old_dest = dest;
  while ((*dest++ = *src++)) {
  }
  return old_dest;
}


x86 assembly (clang, -O0):
<strcpy>:
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,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
void av_stereo3d_from_name() {}


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

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

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

LLVM IR (-O2):
define void @av_stereo3d_from_name() {
ret void
}
/* Variables and functions */
char *luaI_malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *luaI_strdup(char *str) {
  char *newstr = luaI_malloc(strlen(str) + 1);
  strcpy(newstr, str);
  return newstr;
}


x86 assembly (clang, -O0):
<luaI_strdup>:
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 <luaI_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):
<luaI_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <luaI_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @luaI_strdup(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 nsw i64 %5, 1
%7 = call i8* @luaI_malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @luaI_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @luaI_malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
int is_adreno_ib_dump_on_pagef_enabled(struct kgsl_device *device) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.kgsl_device = type opaque
define i32 @is_adreno_ib_dump_on_pagef_enabled(%struct.kgsl_device* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ stacktrace_pop();
char stacktrace_cpop(char val) {
  stacktrace_pop();
  return val;
}


x86 assembly (clang, -O0):
<stacktrace_cpop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <stacktrace_pop@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stacktrace_cpop>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <stacktrace_pop@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @stacktrace_cpop(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @stacktrace_pop()
%4 = load i8, i8* %2
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @stacktrace_cpop(i8 returned signext %0) {
%2 = tail call i32 (...) @stacktrace_pop()
ret i8 %0
}
/* Variables and functions */
int syscall(int, void *, size_t, int, size_t, int);
int remap_file_pages(void *addr, size_t size, int prot, size_t pgoff,
                     int flags) {
  return syscall(253, addr, size, prot, pgoff, flags);
}


x86 assembly (clang, -O0):
<remap_file_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    $0xfd,%edi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remap_file_pages>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xfd,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @remap_file_pages(i8* %0, i64 %1, i32 %2, i64 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i64
%10 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i32 %2, i32* %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i32, i32* %8
%14 = load i64, i64* %9
%15 = load i32, i32* %10
%16 = call i32 @syscall(i32 253, i8* %11, i64 %12, i32 %13, i64 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @remap_file_pages(i8* %0, i64 %1, i32 %2, i64 %3, i32 %4) {
%6 = tail call i32 @syscall(i32 253, i8* %0, i64 %1, i32 %2, i64 %3, i32 %4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ uart_tx_uint16_t(int /*<<< orphan*/);
void log_uint16_t(uint16_t i) { uart_tx_uint16_t(i); }


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

x86 assembly (clang, -O2):
<log_uint16_t>:
jmp    1030 <uart_tx_uint16_t@plt>

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

LLVM IR (-O2):
define void @log_uint16_t(i32 %0) {
%2 = tail call i32 @uart_tx_uint16_t(i32 %0)
ret void
}
int compare_int(const void *a, const void *b) {
  return (*(const int *)a - *(const int *)b);
}


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

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

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

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
scalar_t__ writen(int, void *, scalar_t__);
void Writen(int fd, void *ptr, ssize_t nbytes) {
  if (writen(fd, ptr, nbytes) != nbytes)
    err_sys("writen error");
}


x86 assembly (clang, -O0):
<Writen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <writen@plt>
cmp    -0x18(%rbp),%rax
je     1159 <Writen+0x39>
lea    0xeac(%rip),%rdi
call   1030 <err_sys@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Writen>:
push   %rbx
mov    %rdx,%rbx
call   1040 <writen@plt>
cmp    %rbx,%rax
jne    1130 <Writen+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
pop    %rbx
jmp    1030 <err_sys@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"writen error\00"
define void @Writen(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @writen(i32 %7, i8* %8, i64 %9)
%11 = load i64, i64* %6
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"writen error\00"
define void @Writen(i32 %0, i8* %1, i64 %2) {
%4 = tail call i64 @writen(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int16_t;

/* Variables and functions */
void swapEndiannesS16(int16_t *value) {
  uint32_t tmp = *value;
  *value = (tmp >> 8) | (tmp << 8);
}


x86 assembly (clang, -O0):
<swapEndiannesS16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapEndiannesS16>:
mov    (%rdi),%eax
mov    %eax,%ecx
sar    $0x8,%ecx
shl    $0x8,%eax
or     %ecx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @swapEndiannesS16(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = ashr i32 %6, 8
%8 = load i32, i32* %3
%9 = shl i32 %8, 8
%10 = or i32 %7, %9
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @swapEndiannesS16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 8
%4 = shl i32 %2, 8
%5 = or i32 %3, %4
store i32 %5, i32* %0
ret void
}
void br_multicast_forward(struct net_bridge_mdb_entry *mdst,
                          struct sk_buff *skb, struct sk_buff *skb2) {}


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

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

LLVM IR (-O0):
%struct.net_bridge_mdb_entry = type opaque
%struct.sk_buff = type opaque
define void @br_multicast_forward(%struct.net_bridge_mdb_entry* %0, %struct.sk_buff* %1, %struct.sk_buff* %2) {
%4 = alloca %struct.net_bridge_mdb_entry*
%5 = alloca %struct.sk_buff*
%6 = alloca %struct.sk_buff*
store %struct.net_bridge_mdb_entry* %0, %struct.net_bridge_mdb_entry** %4
store %struct.sk_buff* %1, %struct.sk_buff** %5
store %struct.sk_buff* %2, %struct.sk_buff** %6
ret void
}

LLVM IR (-O2):
%struct.net_bridge_mdb_entry = type opaque
%struct.sk_buff = type opaque
define void @br_multicast_forward(%struct.net_bridge_mdb_entry* nocapture %0, %struct.sk_buff* nocapture %1, %struct.sk_buff* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_PALETTE_swap(char *, int);
void U_WMRANIMATEPALETTE_swap(char *record, int torev) {
  U_WMRCORE_PALETTE_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRANIMATEPALETTE_swap>:
jmp    1030 <U_WMRCORE_PALETTE_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRANIMATEPALETTE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_PALETTE_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int rand();
int rand_int(int low, int high) { return low + rand() % (high - low + 1); }


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

x86 assembly (clang, -O2):
<rand_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @rand_int(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
float powf(double, float);
float ldexpf(float x, int n) { return (x * powf(2.0, (float)n)); }


x86 assembly (clang, -O0):
<ldexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm0
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexpf>:
push   %rax
movss  %xmm0,0x4(%rsp)
cvtsi2ss %edi,%xmm1
movsd  0xedd(%rip),%xmm0
call   1030 <powf@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ldexpf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to float
%8 = call float @powf(double 2.000000e+00, float %7)
%9 = fmul float %5, %8
ret float %9
}

LLVM IR (-O2):
define float @ldexpf(float %0, i32 %1) {
%3 = sitofp i32 %1 to float
%4 = tail call float @powf(double 2.000000e+00, float %3)
%5 = fmul float %4, %0
ret float %5
}
char *bslio_version(void) {
  return ("bslio : V0.65 Peter Boesecke 2010-12-18");
}


x86 assembly (clang, -O0):
<bslio_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bslio_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [40 x i8] c"bslio : V0.65 Peter Boesecke 2010-12-18\00"
define i8* @bslio_version() {
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [40 x i8] c"bslio : V0.65 Peter Boesecke 2010-12-18\00"
define i8* @bslio_version() {
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int yas_bma250_read_reg_byte(int);
int yas_bma250_write_reg_byte(int, int);
int yas_bma250_set_eeprom_mode(unsigned char value) {
  int ret = 0;
  int reg_data = 0;
  reg_data = yas_bma250_read_reg_byte(0x33);
  reg_data = ((reg_data & ~0x01) | ((value << 0) & 0x01));
  ret = yas_bma250_write_reg_byte(0x33, reg_data);
  return ret;
}


x86 assembly (clang, -O0):
<yas_bma250_set_eeprom_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x33,%edi
call   1040 <yas_bma250_read_reg_byte@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfffffffe,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x0,%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x33,%edi
call   1030 <yas_bma250_write_reg_byte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_bma250_set_eeprom_mode>:
push   %rbx
mov    %edi,%ebx
mov    $0x33,%edi
call   1040 <yas_bma250_read_reg_byte@plt>
and    $0xfffffffe,%eax
and    $0x1,%ebx
or     %eax,%ebx
mov    $0x33,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <yas_bma250_write_reg_byte@plt>

LLVM IR (-O0):
define i32 @yas_bma250_set_eeprom_mode(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = call i32 @yas_bma250_read_reg_byte(i32 51)
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = and i32 %6, -2
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 0
%11 = and i32 %10, 1
%12 = or i32 %7, %11
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @yas_bma250_write_reg_byte(i32 51, i32 %13)
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @yas_bma250_set_eeprom_mode(i8 zeroext %0) {
%2 = tail call i32 @yas_bma250_read_reg_byte(i32 51)
%3 = and i32 %2, -2
%4 = and i8 %0, 1
%5 = zext i8 %4 to i32
%6 = or i32 %3, %5
%7 = tail call i32 @yas_bma250_write_reg_byte(i32 51, i32 %6)
ret i32 %7
}
unsigned short ST7735_SwapColor(unsigned short x) {
  return (x << 11) | (x & 0x07E0) | (x >> 11);
}


x86 assembly (clang, -O0):
<ST7735_SwapColor>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0xb,%eax
movzwl -0x2(%rbp),%ecx
and    $0x7e0,%ecx
or     %ecx,%eax
movzwl -0x2(%rbp),%ecx
sar    $0xb,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ST7735_SwapColor>:
mov    %edi,%ecx
shl    $0xb,%ecx
mov    %edi,%eax
and    $0x7e0,%eax
or     %ecx,%eax
shr    $0xb,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @ST7735_SwapColor(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = shl i32 %4, 11
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = and i32 %7, 2016
%9 = or i32 %5, %8
%10 = load i16, i16* %2
%11 = zext i16 %10 to i32
%12 = ashr i32 %11, 11
%13 = or i32 %9, %12
%14 = trunc i32 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @ST7735_SwapColor(i16 zeroext %0) {
%2 = shl i16 %0, 11
%3 = and i16 %0, 2016
%4 = or i16 %2, %3
%5 = lshr i16 %0, 11
%6 = or i16 %4, %5
ret i16 %6
}
unsigned long get_ulong_m(const unsigned char *buf_ptr) {
  return ((unsigned long)buf_ptr[0] << 24) + ((unsigned long)buf_ptr[1] << 16) +
         ((unsigned long)buf_ptr[2] << 8) + ((unsigned long)buf_ptr[3]);
}


x86 assembly (clang, -O0):
<get_ulong_m>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ulong_m>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @get_ulong_m(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl i64 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl i64 %11, 16
%13 = add i64 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = shl i64 %17, 8
%19 = add i64 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i64
%24 = add i64 %19, %23
ret i64 %24
}

LLVM IR (-O2):
define i64 @get_ulong_m(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = shl nuw nsw i64 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 16
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %12, 8
%14 = or i64 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int writen(int, char *, int /*<<< orphan*/);
int writeline(int fd, char *ptr) { return writen(fd, ptr, strlen(ptr)); }


x86 assembly (clang, -O0):
<writeline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <writen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeline>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <writen@plt>

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

LLVM IR (-O2):
define i32 @writeline(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @writen(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
void opcode_fc() {}


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

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

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

LLVM IR (-O2):
define void @opcode_fc() {
ret void
}
/* Variables and functions */
int tan(int);
int internal_tan_i(int value) { return tan(value); }


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

x86 assembly (clang, -O2):
<internal_tan_i>:
jmp    1030 <tan@plt>

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

LLVM IR (-O2):
define i32 @internal_tan_i(i32 %0) {
%2 = tail call i32 @tan(i32 %0)
ret i32 %2
}