xunge/DecIR huggingface dataset:
/* Variables and functions */
void *shmat(int, int /*<<< orphan*/, int /*<<< orphan*/);
void *qshm_get(int shmid) {
  void *pShm;
  if (shmid < 0)
    return NULL;
  pShm = shmat(shmid, 0, 0);
  if (pShm == (void *)-1)
    return NULL;
  return pShm;
}


x86 assembly (clang, -O0):
<qshm_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1132 <qshm_get+0x22>
movq   $0x0,-0x8(%rbp)
jmp    1168 <qshm_get+0x58>
mov    -0xc(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <shmat@plt>
mov    %rax,-0x18(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x18(%rbp)
jne    1160 <qshm_get+0x50>
movq   $0x0,-0x8(%rbp)
jmp    1168 <qshm_get+0x58>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qshm_get>:
push   %rbx
xor    %ebx,%ebx
test   %edi,%edi
js     1128 <qshm_get+0x18>
xor    %esi,%esi
xor    %edx,%edx
call   1030 <shmat@plt>
cmp    $0xffffffffffffffff,%rax
cmovne %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @qshm_get(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i8* @shmat(i32 %0, i32 0, i32 0)
%5 = icmp eq i8* %4, inttoptr (i64 -1 to i8*)
%6 = select i1 %5, i8* null, i8* %4
br label %7
7: ; preds = %3, %1
%8 = phi i8* [ null, %1 ], [ %6, %3 ]
ret i8* %8
}
/* Variables and functions */
double RAND_MAX;
double rand();
double random_uniform(void) { return rand() / (RAND_MAX + 1.0); }


x86 assembly (clang, -O0):
<random_uniform>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
movsd  0xedd(%rip),%xmm1
mov    0x2ebe(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_uniform>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @random_uniform() {
%1 = call double (...) @rand()
%2 = load double, double* @RAND_MAX
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double %1, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @random_uniform() {
%1 = tail call double (...) @rand()
%2 = load double, double* @RAND_MAX
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double %1, %3
ret double %4
}
/* Variables and functions */
int f_socketpair(int, int, int, int *);
int /*<<< orphan*/ printf(char *, char *, int, int);
int socketpair(int domain, int type, int protocol, int socket_vector[2]) {
  (void)(3 >= 4 ? printf("%ssocketpair(domain=%d, type=%d)", "\n:: [CALL]\t",
                         domain, type)
                : 0);
  if (0) {
    return f_socketpair(domain, type, protocol, socket_vector);
  }
  return f_socketpair(domain, type, protocol, socket_vector);
}


x86 assembly (clang, -O0):
<socketpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <f_socketpair@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketpair>:
jmp    1030 <f_socketpair@plt>

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

LLVM IR (-O2):
define i32 @socketpair(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 @f_socketpair(i32 %0, i32 %1, i32 %2, i32* %3)
ret i32 %5
}
int mod_i(int i, int n) { return (i % n + n) % n; }


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

x86 assembly (clang, -O2):
<mod_i>:
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rdx,%rsi,1),%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @mod_i(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 = srem i32 %5, %6
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = srem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mod_i(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = add nsw i32 %3, %1
%5 = srem i32 %4, %1
ret i32 %5
}
double sum(double *args) { return args[1] + args[0]; }


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

x86 assembly (clang, -O2):
<sum>:
movsd  0x8(%rdi),%xmm0
addsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @sum(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 1
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fadd double %5, %8
ret double %9
}

LLVM IR (-O2):
define double @sum(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 1
%3 = load double, double* %2
%4 = load double, double* %0
%5 = fadd double %3, %4
ret double %5
}
/* Variables and functions */
scalar_t__ ehnlc_islower(int);
scalar_t__ ehnlc_isupper(int);
int ehnlc_isalpha(int c) {
  return (ehnlc_islower(c) || ehnlc_isupper(c)) ? 1024 : 0;
}


x86 assembly (clang, -O0):
<ehnlc_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ehnlc_islower@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <ehnlc_isalpha+0x37>
mov    -0x4(%rbp),%edi
call   1040 <ehnlc_isupper@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x400,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehnlc_isalpha>:
push   %rbx
mov    %edi,%ebx
call   1030 <ehnlc_islower@plt>
mov    %rax,%rcx
mov    $0x400,%eax
test   %rcx,%rcx
je     1137 <ehnlc_isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <ehnlc_isupper@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
shl    $0xa,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ehnlc_isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ehnlc_islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @ehnlc_isupper(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1024, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @ehnlc_isalpha(i32 %0) {
%2 = tail call i64 @ehnlc_islower(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ehnlc_isupper(i32 %0)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 0, i32 1024
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1024, %1 ], [ %7, %4 ]
ret i32 %9
}
void av_strnstr() {}


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

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

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

LLVM IR (-O2):
define void @av_strnstr() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_OK;
int memUnlock(sqlite3_file *pFile, int eLock) { return SQLITE_OK; }


x86 assembly (clang, -O0):
<memUnlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memUnlock>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@SQLITE_OK = global i32 0
define i32 @memUnlock(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @SQLITE_OK
ret i32 %3
}
/* Type definitions */
struct RNAinverse_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct RNAinverse_args_info *);
int /*<<< orphan*/ clear_given(struct RNAinverse_args_info *);
int /*<<< orphan*/ init_args_info(struct RNAinverse_args_info *);
void RNAinverse_cmdline_parser_init(struct RNAinverse_args_info *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<RNAinverse_cmdline_parser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNAinverse_cmdline_parser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.RNAinverse_args_info = type { i32 }
define void @RNAinverse_cmdline_parser_init(%struct.RNAinverse_args_info* %0) {
%2 = alloca %struct.RNAinverse_args_info*
store %struct.RNAinverse_args_info* %0, %struct.RNAinverse_args_info** %2
%3 = load %struct.RNAinverse_args_info*, %struct.RNAinverse_args_info** %2
%4 = call i32 @clear_given(%struct.RNAinverse_args_info* %3)
%5 = load %struct.RNAinverse_args_info*, %struct.RNAinverse_args_info** %2
%6 = call i32 @clear_args(%struct.RNAinverse_args_info* %5)
%7 = load %struct.RNAinverse_args_info*, %struct.RNAinverse_args_info** %2
%8 = call i32 @init_args_info(%struct.RNAinverse_args_info* %7)
ret void
}

LLVM IR (-O2):
%struct.RNAinverse_args_info = type { i32 }
define void @RNAinverse_cmdline_parser_init(%struct.RNAinverse_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.RNAinverse_args_info* %0)
%3 = tail call i32 @clear_args(%struct.RNAinverse_args_info* %0)
%4 = tail call i32 @init_args_info(%struct.RNAinverse_args_info* %0)
ret void
}
int coord(int i, int j, int cols, int rows) {
  int c;
  c = j * rows + i;
  return c;
}


x86 assembly (clang, -O0):
<coord>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<coord>:
imul   %ecx,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @coord(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = load i32, i32* %8
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %5
%14 = add nsw i32 %12, %13
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @coord(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %1
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) void dbg_vAssertImpl(const char *Private_pcSrcFileName,
                                              uint32_t Private_u32SrcLineNumber,
                                              const char *pcAssertionString) {}


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

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

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

LLVM IR (-O2):
define void @dbg_vAssertImpl(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
int ulaw_decode(unsigned int ulawbyte) {
  static int exp_lut[8] = {0, 132, 396, 924, 1980, 4092, 8316, 16764};
  int sign, exponent, mantissa, sample;
  ulawbyte = ~ulawbyte;
  sign = (ulawbyte & 0x80);
  exponent = (ulawbyte >> 4) & 0x07;
  mantissa = ulawbyte & 0x0F;
  sample = exp_lut[exponent] + (mantissa << (exponent + 3));
  if (sign != 0)
    sample = -sample;
  return sample;
}


x86 assembly (clang, -O0):
<ulaw_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
and    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x10(%rbp)
movslq -0xc(%rbp),%rcx
lea    0x2ef5(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
add    $0x3,%ecx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1162 <ulaw_decode+0x62>
xor    %eax,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulaw_decode>:
not    %edi
mov    %edi,%eax
shr    $0x4,%eax
and    $0x7,%eax
mov    %edi,%edx
and    $0xf,%edx
mov    %eax,%ecx
add    $0x3,%cl
shl    %cl,%edx
lea    0xee3(%rip),%rcx
add    (%rcx,%rax,4),%edx
mov    %edx,%eax
neg    %eax
test   $0x80,%dil
cmove  %edx,%eax
ret

LLVM IR (-O0):
@ulaw_decode.exp_lut = internal global [8 x i32] [i32 0, i32 132, i32 396, i32 924, i32 1980, i32 4092, i32 8316, i32 16764]
define i32 @ulaw_decode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = xor i32 %7, -1
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 128
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = lshr i32 %11, 4
%13 = and i32 %12, 7
store i32 %13, i32* %4
%14 = load i32, i32* %2
%15 = and i32 %14, 15
store i32 %15, i32* %5
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [8 x i32], [8 x i32]* @ulaw_decode.exp_lut, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %5
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 3
%23 = shl i32 %20, %22
%24 = add nsw i32 %19, %23
store i32 %24, i32* %6
%25 = load i32, i32* %3
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %1
%28 = load i32, i32* %6
%29 = sub nsw i32 0, %28
store i32 %29, i32* %6
br label %30
30: ; preds = %27, %1
%31 = load i32, i32* %6
ret i32 %31
}

LLVM IR (-O2):
@ulaw_decode.exp_lut = internal unnamed_addr constant [8 x i32] [i32 0, i32 132, i32 396, i32 924, i32 1980, i32 4092, i32 8316, i32 16764]
define i32 @ulaw_decode(i32 %0) {
%2 = xor i32 %0, -1
%3 = and i32 %2, 128
%4 = lshr i32 %2, 4
%5 = and i32 %4, 7
%6 = and i32 %2, 15
%7 = zext i32 %5 to i64
%8 = getelementptr inbounds [8 x i32], [8 x i32]* @ulaw_decode.exp_lut, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = add nuw nsw i32 %5, 3
%11 = shl nuw nsw i32 %6, %10
%12 = add nsw i32 %9, %11
%13 = icmp eq i32 %3, 0
%14 = sub nsw i32 0, %12
%15 = select i1 %13, i32 %12, i32 %14
ret i32 %15
}
unsigned char return_uchar() { return 42; }


x86 assembly (clang, -O0):
<return_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_uchar>:
mov    $0x2a,%al
ret

LLVM IR (-O0):
define zeroext i8 @return_uchar() {
ret i8 42
}

LLVM IR (-O2):
define zeroext i8 @return_uchar() {
ret i8 42
}
/* Variables and functions */
int i2c_smbus_read_word_data(int, int);
int wiringPiI2CReadReg16(int fd, int reg) {
  return i2c_smbus_read_word_data(fd, reg);
}


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

x86 assembly (clang, -O2):
<wiringPiI2CReadReg16>:
jmp    1030 <i2c_smbus_read_word_data@plt>

LLVM IR (-O0):
define i32 @wiringPiI2CReadReg16(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 @i2c_smbus_read_word_data(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @wiringPiI2CReadReg16(i32 %0, i32 %1) {
%3 = tail call i32 @i2c_smbus_read_word_data(i32 %0, i32 %1)
ret i32 %3
}
int main(argc, argv)
int argc;
char *argv[];
{
  minimain(argc, argv);
  as_bomb("Main program dropped through.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <minimain@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <as_bomb@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"Main program dropped through.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @minimain to i32 (i32, i8**, ...)*)(i32 %6, i8** %7)
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @as_bomb to i32 (i8*, ...)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Main program dropped through.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @minimain to i32 (i32, i8**, ...)*)(i32 %0, i8** %1)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @as_bomb to i32 (i8*, ...)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ apic_enable();
int /*<<< orphan*/ ioapic_init();
int /*<<< orphan*/ lapic_init();
void apic_init() {
  apic_enable();
  ioapic_init();
  lapic_init();
}


x86 assembly (clang, -O0):
<apic_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <apic_enable@plt>
mov    $0x0,%al
call   1030 <ioapic_init@plt>
mov    $0x0,%al
call   1050 <lapic_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<apic_init>:
push   %rax
xor    %eax,%eax
call   1040 <apic_enable@plt>
xor    %eax,%eax
call   1030 <ioapic_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <lapic_init@plt>

LLVM IR (-O0):
define void @apic_init() {
%1 = call i32 (...) @apic_enable()
%2 = call i32 (...) @ioapic_init()
%3 = call i32 (...) @lapic_init()
ret void
}

LLVM IR (-O2):
define void @apic_init() {
%1 = tail call i32 (...) @apic_enable()
%2 = tail call i32 (...) @ioapic_init()
%3 = tail call i32 (...) @lapic_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ show_message();
int main() {
  int count;
  count = 0;
  while (count < 10) {
    show_message();
    count = count + 1;
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1155 <main+0x35>
mov    $0x0,%al
call   1030 <show_message@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 (...) @show_message()
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @show_message()
%2 = tail call i32 (...) @show_message()
%3 = tail call i32 (...) @show_message()
%4 = tail call i32 (...) @show_message()
%5 = tail call i32 (...) @show_message()
%6 = tail call i32 (...) @show_message()
%7 = tail call i32 (...) @show_message()
%8 = tail call i32 (...) @show_message()
%9 = tail call i32 (...) @show_message()
%10 = tail call i32 (...) @show_message()
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int INT_MIN;
int g(int b) {
  if (b != INT_MIN) {
    b = b > 0 ? b : -b;
    if (b >= 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed7(%rip),%rcx
cmp    (%rcx),%eax
je     1157 <g+0x57>
cmpl   $0x0,-0x8(%rbp)
jle    112e <g+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <g+0x36>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1152 <g+0x52>
movl   $0x0,-0x4(%rbp)
jmp    115e <g+0x5e>
jmp    1157 <g+0x57>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
sete   %al
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @g(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @INT_MIN
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %21
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = load i32, i32* %3
br label %15
12: ; preds = %7
%13 = load i32, i32* %3
%14 = sub nsw i32 0, %13
br label %15
15: ; preds = %12, %10
%16 = phi i32 [ %11, %10 ], [ %14, %12 ]
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = icmp sge i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 0, i32* %2
br label %22
20: ; preds = %15
br label %21
21: ; preds = %20, %1
store i32 1, i32* %2
br label %22
22: ; preds = %21, %19
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @g(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned long long unsignedlonglong_ignoring_signedint(unsigned long long x,
                                                       signed int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedlonglong_ignoring_signedint>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @unsignedlonglong_ignoring_signedint(i64 returned %0, i32 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void default_color() { printf("\033[38;5;256m"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"\1B[38;5;256m\00"
define void @default_color() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[38;5;256m\00"
define void @default_color() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint8_t ivory_hw_io_read_u8(uint32_t addr) {
  return *((volatile uint8_t *)addr);
}


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

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

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

LLVM IR (-O2):
define i32 @ivory_hw_io_read_u8(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int commonfun() { bar(); }


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

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

LLVM IR (-O0):
define i32 @commonfun() {
%1 = alloca i32
%2 = call i32 (...) @bar()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @commonfun() {
%1 = tail call i32 (...) @bar()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ prints(char *);
void _mvaddnstr(int y, int x, char *ptr, int len) {
  move(y, x);
  prints(ptr);
  move(y, x);
}


x86 assembly (clang, -O0):
<_mvaddnstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <move@plt>
mov    -0x10(%rbp),%rdi
call   1030 <prints@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <move@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mvaddnstr>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <move@plt>
mov    %r14,%rdi
call   1030 <prints@plt>
mov    %ebx,%edi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <move@plt>

LLVM IR (-O0):
define void @_mvaddnstr(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @move(i32 %9, i32 %10)
%12 = load i8*, i8** %7
%13 = call i32 @prints(i8* %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @move(i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @_mvaddnstr(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @move(i32 %0, i32 %1)
%6 = tail call i32 @prints(i8* %2)
%7 = tail call i32 @move(i32 %0, i32 %1)
ret void
}
__attribute__((no)) void g(int x) { asm volatile("" : "+r"(x)); }


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

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

LLVM IR (-O0):
define void @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %3)
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @g(i32 %0) {
%2 = tail call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret void
}
int power_supply_unregister_charger(struct power_supply *psy) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.power_supply = type opaque
define i32 @power_supply_unregister_charger(%struct.power_supply* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
double ceil(double);
double floor(double);
double ssround(double a) { return (a >= 0) ? floor(a + 0.5) : -ceil(-a - 0.5); }


x86 assembly (clang, -O0):
<ssround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     115b <ssround+0x3b>
movsd  0xeb9(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    11a4 <ssround+0x84>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe81(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssround>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    114a <ssround+0x2a>
movsd  0xed5(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <ceil@plt>
xorpd  0xec8(%rip),%xmm0
pop    %rax
ret
addsd  0xeae(%rip),%xmm0
pop    %rax
jmp    1040 <floor@plt>

LLVM IR (-O0):
define double @ssround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
%8 = call double @llvm.floor.f64(double %7)
br label %15
9: ; preds = %1
%10 = load double, double* %2
%11 = fneg double %10
%12 = fsub double %11, 5.000000e-01
%13 = call double @llvm.ceil.f64(double %12)
%14 = fneg double %13
br label %15
15: ; preds = %9, %5
%16 = phi double [ %8, %5 ], [ %14, %9 ]
ret double %16
}

LLVM IR (-O2):
define double @ssround(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fadd double %0, 5.000000e-01
%5 = tail call double @llvm.floor.f64(double %4)
br label %10
6: ; preds = %1
%7 = fsub double -5.000000e-01, %0
%8 = tail call double @llvm.ceil.f64(double %7)
%9 = fneg double %8
br label %10
10: ; preds = %6, %3
%11 = phi double [ %5, %3 ], [ %9, %6 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_list(int *list, int len) {
  for (int i = 0; i < len; i++)
    printf("%d,", list[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_list+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_list+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_list>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_list+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_list+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d,\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_list(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d,\00"
define void @print_list(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
float vec4f_norm(float const *);
int /*<<< orphan*/ vec4f_scalarDiv_new(float *, float const *, float);
void vec4f_normalize_new(float dest[4], const float src[4]) {
  float len = vec4f_norm(src);
  vec4f_scalarDiv_new(dest, src, len);
}


x86 assembly (clang, -O0):
<vec4f_normalize_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <vec4f_norm@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
call   1040 <vec4f_scalarDiv_new@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4f_normalize_new>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <vec4f_norm@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <vec4f_scalarDiv_new@plt>

LLVM IR (-O0):
define void @vec4f_normalize_new(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %4
%7 = call float @vec4f_norm(float* %6)
store float %7, float* %5
%8 = load float*, float** %3
%9 = load float*, float** %4
%10 = load float, float* %5
%11 = call i32 @vec4f_scalarDiv_new(float* %8, float* %9, float %10)
ret void
}

LLVM IR (-O2):
define void @vec4f_normalize_new(float* %0, float* %1) {
%3 = tail call float @vec4f_norm(float* %1)
%4 = tail call i32 @vec4f_scalarDiv_new(float* %0, float* %1, float %3)
ret void
}
/* Variables and functions */
int LOG_CONS;
int /*<<< orphan*/ LOG_INFO;
int LOG_NOWAIT;
int LOG_PERROR;
int /*<<< orphan*/ LOG_UPTO(int /*<<< orphan*/);
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ setlogmask(int /*<<< orphan*/);
void start_log() {
  setlogmask(LOG_UPTO(LOG_INFO));
  openlog("janfsd", LOG_NOWAIT | LOG_CONS | LOG_PERROR, LOG_USER);
}


x86 assembly (clang, -O0):
<start_log>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <LOG_UPTO@plt>
mov    %eax,%edi
call   1040 <setlogmask@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
mov    0x2e77(%rip),%rax
or     (%rax),%esi
mov    0x2e7e(%rip),%rax
or     (%rax),%esi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
lea    0xe8c(%rip),%rdi
call   1050 <openlog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_log>:
push   %rax
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1030 <LOG_UPTO@plt>
mov    %eax,%edi
call   1040 <setlogmask@plt>
mov    0x2e7b(%rip),%rax
mov    0x2e7c(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e81(%rip),%rax
or     (%rax),%esi
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
lea    0xe8f(%rip),%rdi
pop    %rax
jmp    1050 <openlog@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [7 x i8] c"janfsd\00"
@LOG_NOWAIT = global i32 0
@LOG_CONS = global i32 0
@LOG_PERROR = global i32 0
@LOG_USER = global i32 0
define void @start_log() {
%1 = load i32, i32* @LOG_INFO
%2 = call i32 @LOG_UPTO(i32 %1)
%3 = call i32 @setlogmask(i32 %2)
%4 = load i32, i32* @LOG_NOWAIT
%5 = load i32, i32* @LOG_CONS
%6 = or i32 %4, %5
%7 = load i32, i32* @LOG_PERROR
%8 = or i32 %6, %7
%9 = load i32, i32* @LOG_USER
%10 = call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [7 x i8] c"janfsd\00"
@LOG_NOWAIT = global i32 0
@LOG_CONS = global i32 0
@LOG_PERROR = global i32 0
@LOG_USER = global i32 0
define void @start_log() {
%1 = load i32, i32* @LOG_INFO
%2 = tail call i32 @LOG_UPTO(i32 %1)
%3 = tail call i32 @setlogmask(i32 %2)
%4 = load i32, i32* @LOG_NOWAIT
%5 = load i32, i32* @LOG_CONS
%6 = or i32 %5, %4
%7 = load i32, i32* @LOG_PERROR
%8 = or i32 %6, %7
%9 = load i32, i32* @LOG_USER
%10 = tail call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: sg_turs [--help] [--number=NUM] [--progress] [--time] "
         "[--verbose]\n"
         "               [--version] DEVICE\n"
         "  where:\n"
         "    --help|-h        print usage message then exit\n"
         "    --number=NUM|-n NUM    number of test_unit_ready commands "
         "(def: 1)\n"
         "    --progress|-p    outputs progress indication (percentage) "
         "if available\n"
         "    --time|-t        outputs total duration and commands per "
         "second\n"
         "    --verbose|-v     increase verbosity\n"
         "    --version|-V     print version string then exit\n\n"
         "Performs a SCSI TEST UNIT READY command (or many of them)\n");
}


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

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

LLVM IR (-O0):
@.str = [533 x i8] c"Usage: sg_turs [--help] [--number=NUM] [--progress] [--time] [--verbose]\0A [--version] DEVICE\0A where:\0A --help|-h print usage message then exit\0A --number=NUM|-n NUM number of test_unit_ready commands (def: 1)\0A --progress|-p outputs progress indication (percentage) if available\0A --time|-t outputs total duration and commands per second\0A --verbose|-v increase verbosity\0A --version|-V print version string then exit\0A\0APerforms a SCSI TEST UNIT READY command (or many of them)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([533 x i8], [533 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [532 x i8] c"Usage: sg_turs [--help] [--number=NUM] [--progress] [--time] [--verbose]\0A [--version] DEVICE\0A where:\0A --help|-h print usage message then exit\0A --number=NUM|-n NUM number of test_unit_ready commands (def: 1)\0A --progress|-p outputs progress indication (percentage) if available\0A --time|-t outputs total duration and commands per second\0A --verbose|-v increase verbosity\0A --version|-V print version string then exit\0A\0APerforms a SCSI TEST UNIT READY command (or many of them)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([532 x i8], [532 x i8]* @str, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_bi_epel_v4_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v4_10_sse4() {
ret void
}
XSetClipMask() {}


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

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

LLVM IR (-O0):
define i32 @XSetClipMask() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSetClipMask() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, char *);
void errorRedef(char *s) { error("Redefinition of identifier '%s'\n", s); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Redefinition of identifier '%s'\0A\00"
define void @errorRedef(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Redefinition of identifier '%s'\0A\00"
define void @errorRedef(i8* %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sink(void *);
__attribute__((noipa)) void *return_array_plus_var(int i) {
  int a[32];
  void *p = a + i;
  sink(p);
  return p;
}


x86 assembly (clang, -O0):
<return_array_plus_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x90(%rbp),%rax
movslq -0x4(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rdi
call   1030 <sink@plt>
mov    -0x98(%rbp),%rax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_array_plus_var>:
push   %rbx
sub    $0x80,%rsp
movslq %edi,%rax
lea    (%rsp,%rax,4),%rbx
mov    %rbx,%rdi
call   1030 <sink@plt>
mov    %rbx,%rax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @return_array_plus_var(i32 %0) {
%2 = alloca i32
%3 = alloca [32 x i32]
%4 = alloca i8*
store i32 %0, i32* %2
%5 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = bitcast i32* %8 to i8*
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @sink(i8* %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
define i8* @return_array_plus_var(i32 %0) {
%2 = alloca [32 x i32]
%3 = bitcast [32 x i32]* %2 to i8*
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 %4
%6 = bitcast i32* %5 to i8*
%7 = call i32 @sink(i8* %6)
ret i8* %6
}
void cpstring(char *dest, const char *str) {
  int i = 0;
  while (str[i] != '\0') {
    dest[i] = str[i];
    i++;
  }
  dest[i] = '\0';
}


x86 assembly (clang, -O0):
<cpstring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <cpstring+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <cpstring+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpstring>:
mov    (%rsi),%al
test   %al,%al
je     1127 <cpstring+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rdi,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <cpstring+0x10>
mov    %ecx,%eax
movb   $0x0,(%rdi,%rax,1)
ret
xor    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @cpstring(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_init(pthread_mutexattr_t *__attr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_init(i32* nocapture readnone %0) {
ret i32 0
}