xunge/DecIR huggingface dataset:
long long uzsu() { return 0x7fff0000ffff7fffLL; }


x86 assembly (clang, -O0):
<uzsu>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fff0000ffff7fff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uzsu>:
movabs $0x7fff0000ffff7fff,%rax
ret

LLVM IR (-O0):
define i64 @uzsu() {
ret i64 9223090566172999679
}

LLVM IR (-O2):
define i64 @uzsu() {
ret i64 9223090566172999679
}
/* Type definitions */
struct em8051 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
int disasm_movx_a_indir_dptr(struct em8051 *aCPU, int aPosition,
                             char *aBuffer) {
  sprintf(aBuffer, "MOVX  A, @DPTR");
  return 1;
}


x86 assembly (clang, -O0):
<disasm_movx_a_indir_dptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_movx_a_indir_dptr>:
movabs $0x5254504440202c,%rax
mov    %rax,0x7(%rdx)
movabs $0x2c41202058564f4d,%rax
20 41 2c
mov    %rax,(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.em8051 = type { i32 }
@.str = [15 x i8] c"MOVX A, @DPTR\00"
define i32 @disasm_movx_a_indir_dptr(%struct.em8051* %0, i32 %1, i8* %2) {
%4 = alloca %struct.em8051*
%5 = alloca i32
%6 = alloca i8*
store %struct.em8051* %0, %struct.em8051** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.em8051 = type { i32 }
@.str = [15 x i8] c"MOVX A, @DPTR\00"
define i32 @disasm_movx_a_indir_dptr(%struct.em8051* nocapture readnone %0, i32 %1, i8* nocapture writeonly %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(15) %2, i8* align 1 dereferenceable(15) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 15, i1 false)
ret i32 1
}
int test_imm_73uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x73 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_73uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x73,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_73uint64_highword_mem>:
testb  $0x73,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_73uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 115
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_73uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 493921239040
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void vector_mult_sc(double *v, double s) {
  int i;
  for (i = 1; i < 4; ++i)
    v[i] = v[i] * s;
}


x86 assembly (clang, -O0):
<vector_mult_sc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    114b <vector_mult_sc+0x4b>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <vector_mult_sc+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_mult_sc>:
movupd 0x8(%rdi),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,0x8(%rdi)
mulsd  0x18(%rdi),%xmm0
movsd  %xmm0,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @vector_mult_sc(double* nocapture %0, double %1) {
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = bitcast double* %3 to <2 x double>*
%5 = load <2 x double>, <2 x double>* %4
%6 = insertelement <2 x double> poison, double %1, i64 0
%7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> zeroinitializer
%8 = fmul <2 x double> %5, %7
%9 = bitcast double* %3 to <2 x double>*
store <2 x double> %8, <2 x double>* %9
%10 = getelementptr inbounds double, double* %0, i64 3
%11 = load double, double* %10
%12 = fmul double %11, %1
store double %12, double* %10
ret void
}
void _HibernateWriteComplete(void) {
  while (!((*((volatile unsigned long *)(0x400FC010))) & 0x80000000)) {
  }
}


x86 assembly (clang, -O0):
<_HibernateWriteComplete>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <_HibernateWriteComplete+0x9>
mov    $0x400fc010,%eax
mov    (%rax),%rax
movabs $0x80000000,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1134 <_HibernateWriteComplete+0x34>
jmp    1139 <_HibernateWriteComplete+0x39>
jmp    1109 <_HibernateWriteComplete+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_HibernateWriteComplete>:
mov    0x400fc010,%rax
40
and    $0x80000000,%eax
test   %rax,%rax
je     1100 <_HibernateWriteComplete>
ret

LLVM IR (-O0):
define void @_HibernateWriteComplete() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%3 = and i64 %2, 2147483648
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @_HibernateWriteComplete() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%3 = and i64 %2, 2147483648
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
void test_safelen_simdlen() {
  int i;
#pragma omp target
#pragma omp teams
#pragma omp distribute simd simdlen(6) safelen(5)
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
#pragma omp distribute simd safelen(5) simdlen(6)
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_safelen_simdlen>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_safelen_simdlen+0x28>
jmp    111a <test_safelen_simdlen+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_safelen_simdlen+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_safelen_simdlen+0x4c>
jmp    113e <test_safelen_simdlen+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_safelen_simdlen+0x2f>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_safelen_simdlen() {
ret void
}
int main(void) {
  unsigned i = 0;
  for (;; i++) {
    if (i < 10)
      continue;
    else
      break;
  }
  while (1) {
    i++;
    if (i == 42)
      break;
  }
  do {
    if ((i % 3) == 0) {
      i++;
      continue;
    }
    i += 2;
  } while (i < 89);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jae    1121 <main+0x21>
jmp    1126 <main+0x26>
jmp    1134 <main+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
jmp    1139 <main+0x39>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2a,-0x8(%rbp)
jne    1151 <main+0x51>
jmp    1156 <main+0x56>
jmp    1139 <main+0x39>
jmp    115b <main+0x5b>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    117e <main+0x7e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1187 <main+0x87>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x59,-0x8(%rbp)
jb     115b <main+0x5b>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void foo678(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo678(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SaveVocab();
int /*<<< orphan*/ exit(int);
void breakout() {
  SaveVocab();
  exit(-1);
}


x86 assembly (clang, -O0):
<breakout>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SaveVocab@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<breakout>:
push   %rax
xor    %eax,%eax
call   1030 <SaveVocab@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @breakout() {
%1 = call i32 (...) @SaveVocab()
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @breakout() {
%1 = tail call i32 (...) @SaveVocab()
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
float dds_frequency(int32_t phase_rate) {
  return (float)phase_rate * (float)8000 / (65536.0f * 65536.0f);
}


x86 assembly (clang, -O0):
<dds_frequency>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
movss  0xeee(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xede(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dds_frequency>:
cvtsi2ss %rdi,%xmm0
mulss  0xef3(%rip),%xmm0
mulss  0xeef(%rip),%xmm0
ret

LLVM IR (-O0):
define float @dds_frequency(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
%5 = fmul float %4, 8.000000e+03
%6 = fdiv float %5, 0x41F0000000000000
ret float %6
}

LLVM IR (-O2):
define float @dds_frequency(i64 %0) {
%2 = sitofp i64 %0 to float
%3 = fmul float %2, 8.000000e+03
%4 = fmul float %3, 0x3DF0000000000000
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
int /*<<< orphan*/ strchr(char *, char);
int symchar(char c) {
  static char *special = "()';\\|";
  return (!isspace(c) && !strchr(special, c));
}


x86 assembly (clang, -O0):
<symchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    1162 <symchar+0x42>
mov    0x2ee2(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symchar>:
push   %rbx
mov    %edi,%ebx
call   1040 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1132 <symchar+0x12>
pop    %rbx
ret
movsbl %bl,%esi
lea    0xec4(%rip),%rdi
call   1030 <strchr@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@symchar.special = internal global i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0)
@.str = [7 x i8] c"()';\\|\00"
define i32 @symchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @isspace(i8 signext %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i8*, i8** @symchar.special
%8 = load i8, i8* %2
%9 = call i32 @strchr(i8* %7, i8 signext %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %6, %1
%13 = phi i1 [ false, %1 ], [ %11, %6 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@.str = [7 x i8] c"()';\\|\00"
define i32 @symchar(i8 signext %0) {
%2 = tail call i32 @isspace(i8 signext %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @strchr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int librlc_crs_encode_cleanup(char *encoded_data, char *encoded_parity) {
  free(encoded_data);
  free(encoded_parity);
  return 0;
}


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

x86 assembly (clang, -O2):
<librlc_crs_encode_cleanup>:
push   %rbx
mov    %rsi,%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @librlc_crs_encode_cleanup(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %0)
%4 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int write(int, char *, int);
int pcsl_serial_writechar(int port, char *buffer, int size) {
  int result;
  result = write(port, buffer, size);
  return result;
}


x86 assembly (clang, -O0):
<pcsl_serial_writechar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcsl_serial_writechar>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @pcsl_serial_writechar(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, int);
int /*<<< orphan*/ stderr;
char *strerror(int);
void sockerror(char *s) {
  int err = errno;
  fprintf(stderr, "%s: %s (%d)\n", s, strerror(err), err);
}


x86 assembly (clang, -O0):
<sockerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
mov    -0xc(%rbp),%r8d
lea    0xe97(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockerror>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2eaa(%rip),%rax
mov    (%rax),%ebp
mov    0x2ea9(%rip),%rax
mov    (%rax),%ebx
mov    %ebp,%edi
call   1040 <strerror@plt>
lea    0xeb9(%rip),%rsi
mov    %ebx,%edi
mov    %r14,%rdx
mov    %rax,%rcx
mov    %ebp,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@errno = global i32 0
@stderr = global i32 0
@.str = [13 x i8] c"%s: %s (%d)\0A\00"
define void @sockerror(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i8* @strerror(i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [13 x i8] c"%s: %s (%d)\0A\00"
define void @sockerror(i8* %0) {
%2 = load i32, i32* @errno
%3 = load i32, i32* @stderr
%4 = tail call i8* @strerror(i32 %2)
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ useconds_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int /*<<< orphan*/);
void *timer_thread(void *ctx) {
  useconds_t *terminate_in = ctx;
  usleep(*terminate_in);
  return NULL;
}


x86 assembly (clang, -O0):
<timer_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <usleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_thread>:
push   %rax
mov    (%rdi),%edi
call   1030 <usleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @timer_thread(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 = load i32, i32* %6
%8 = call i32 @usleep(i32 %7)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @timer_thread(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @usleep(i32 %3)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ log_printf(int, char *, char const *);
scalar_t__ lseek(int, long, int /*<<< orphan*/);
void safe_rewind(int fd, const char *filename) {
  if (lseek(fd, 0L, SEEK_SET) < 0) {
    log_printf(2, "While seeking to start of %s: %m\n", filename);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<safe_rewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <lseek@plt>
cmp    $0x0,%rax
jge    117d <safe_rewind+0x4d>
mov    -0x10(%rbp),%rdx
mov    $0x2,%edi
lea    0xe92(%rip),%rsi
call   1040 <log_printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_rewind>:
push   %rbx
mov    %rsi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
test   %rax,%rax
js     114b <safe_rewind+0x1b>
pop    %rbx
ret
lea    0xeae(%rip),%rsi
mov    $0x2,%edi
mov    %rbx,%rdx
call   1040 <log_printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [34 x i8] c"While seeking to start of %s: %m\0A\00"
define void @safe_rewind(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 i32, i32* @SEEK_SET
%7 = call i64 @lseek(i32 %5, i64 0, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @log_printf(i32 2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [34 x i8] c"While seeking to start of %s: %m\0A\00"
define void @safe_rewind(i32 %0, i8* %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i64 @lseek(i32 %0, i64 0, i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @log_printf(i32 2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int expected_sz_void = 0;
  if (sizeof(void) != expected_sz_void) {
    printf("Error %d\n", (int)1);
    exit(1);
  };
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
mov    $0x1,%eax
cmp    %rcx,%rax
je     1165 <main+0x45>
lea    0xeb1(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Error %d\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = icmp ne i64 1, %4
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"Error %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @exit(i32 1)
unreachable
}
char test4_i(const char *x) { return x[1]; }


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

x86 assembly (clang, -O2):
<test4_i>:
mov    0x1(%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @test4_i(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @test4_i(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
ret i8 %3
}
int test_imm_7Buint16_mem(unsigned short *val) {
  return ((*val) & (0x7B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Buint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x7b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Buint16_mem>:
testb  $0x7b,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Buint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 123
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *strtok_r(char *, char const *, char **);
char *strtok(char *restrict str, const char *restrict delim) {
  static char *strtok_state = NULL;
  return strtok_r(str, delim, &strtok_state);
}


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

x86 assembly (clang, -O2):
<strtok>:
lea    0x2f19(%rip),%rdx
jmp    1030 <strtok_r@plt>

LLVM IR (-O0):
@strtok.strtok_state = internal global i8* null
define i8* @strtok(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @strtok_r(i8* %5, i8* %6, i8** @strtok.strtok_state)
ret i8* %7
}

LLVM IR (-O2):
@strtok.strtok_state = internal global i8* null
define i8* @strtok(i8* noalias %0, i8* noalias nocapture %1) {
%3 = tail call i8* @strtok_r(i8* %0, i8* %1, i8** @strtok.strtok_state)
ret i8* %3
}
/* Variables and functions */
int atoi(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *hours_to_days(char *hours) {
  char *aux = (char *)malloc(10);
  sprintf(aux, "%d", (atoi(hours) / 8));
  return aux;
}


x86 assembly (clang, -O0):
<hours_to_days>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    -0x18(%rbp),%rdi
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xe90(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hours_to_days>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <atoi@plt>
lea    0x7(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
sar    $0x3,%edx
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @hours_to_days(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 10)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = call i32 @atoi(i8* %7)
%9 = sdiv i32 %8, 8
%10 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @hours_to_days(i8* nocapture %0) {
%2 = tail call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @atoi(i8* %0)
%5 = sdiv i32 %4, 8
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void error(const char *routine, const char *text) {
  fprintf(stderr, " error (isinusfor.c/%s : %s\n", routine, text);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c" error (isinusfor.c/%s : %s\0A\00"
define void @error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c" error (isinusfor.c/%s : %s\0A\00"
define void @error(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int read_long(void *src) {
  return (((unsigned char *)src)[0] << 24) + (((unsigned char *)src)[1] << 16) +
         (((unsigned char *)src)[2] << 8) + ((unsigned char *)src)[3];
}


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

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

LLVM IR (-O0):
define i32 @read_long(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 i32
%7 = shl i32 %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 i32
%12 = shl i32 %11, 16
%13 = add nsw i32 %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 i32
%18 = shl i32 %17, 8
%19 = add nsw i32 %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 i32
%24 = add nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @read_long(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
unsigned gameboy3x_generic_output_fmts(unsigned input_fmts) {
  return input_fmts;
}


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

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

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

LLVM IR (-O2):
define i32 @gameboy3x_generic_output_fmts(i32 returned %0) {
ret i32 %0
}
void *symbol22_i386() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @symbol22_i386() {
ret i8* undef
}
void wpas_dbus_signal_p2p_go_neg_resp(struct wpa_supplicant *wpa_s,
                                      struct p2p_go_neg_results *res) {}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.p2p_go_neg_results = type opaque
define void @wpas_dbus_signal_p2p_go_neg_resp(%struct.wpa_supplicant* %0, %struct.p2p_go_neg_results* %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca %struct.p2p_go_neg_results*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store %struct.p2p_go_neg_results* %1, %struct.p2p_go_neg_results** %4
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.p2p_go_neg_results = type opaque
define void @wpas_dbus_signal_p2p_go_neg_resp(%struct.wpa_supplicant* nocapture %0, %struct.p2p_go_neg_results* nocapture %1) {
ret void
}
char *XSetOCValues() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @XSetOCValues() {
ret i8* undef
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_12(uint64_t x) {
  __asm__("rolq $12, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_12>:
mov    %rdi,%rax
rol    $0xc,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_12(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$12, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_12(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$12, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
void rop3_65_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk1 = *D | stk2;
  stk1 = ~stk1;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_65_0_0>:
xor    %edx,%esi
or     (%rdi),%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_65_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @rop3_65_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
store i8 %7, i8* %0
ret void
}
void initTmp(unsigned int tmp[3]) { tmp[0] = ((unsigned int)1) << 2; }


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

x86 assembly (clang, -O2):
<initTmp>:
movl   $0x4,(%rdi)
ret

LLVM IR (-O0):
define void @initTmp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 4, i32* %4
ret void
}

LLVM IR (-O2):
define void @initTmp(i32* nocapture writeonly %0) {
store i32 4, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void show_float(double f) { printf("%f\n", f); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @show_float(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ moveDown(int *);
int /*<<< orphan*/ moveLeft(int *);
int /*<<< orphan*/ moveRight(int *);
int /*<<< orphan*/ moveUp(int *);
void moveChar(char move, int *x, int *y) {
  switch (move) {
  case 'n':
    moveUp(y);
    break;
  case 'e':
    moveRight(x);
    break;
  case 's':
    moveDown(y);
    break;
  case 'w':
    moveLeft(x);
    break;
  };
}


x86 assembly (clang, -O0):
<moveChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffff9b,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x12,%eax
ja     11b3 <moveChar+0x73>
mov    -0x20(%rbp),%rax
lea    0xe89(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%rdi
call   1060 <moveUp@plt>
jmp    11b3 <moveChar+0x73>
mov    -0x10(%rbp),%rdi
call   1030 <moveRight@plt>
jmp    11b3 <moveChar+0x73>
mov    -0x18(%rbp),%rdi
call   1050 <moveDown@plt>
jmp    11b3 <moveChar+0x73>
mov    -0x10(%rbp),%rdi
call   1040 <moveLeft@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveChar>:
add    $0xffffff9b,%edi
cmp    $0x12,%edi
ja     1160 <moveChar+0x20>
lea    0xeb1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    %rsi,%rdi
jmp    1030 <moveRight@plt>
ret
mov    %rdx,%rdi
jmp    1060 <moveUp@plt>
mov    %rdx,%rdi
jmp    1050 <moveDown@plt>
mov    %rsi,%rdi
jmp    1040 <moveLeft@plt>

LLVM IR (-O0):
define void @moveChar(i8 signext %0, i32* %1, i32* %2) {
%4 = alloca i8
%5 = alloca i32*
%6 = alloca i32*
store i8 %0, i8* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
switch i32 %8, label %21 [
i32 110, label %9
i32 101, label %12
i32 115, label %15
i32 119, label %18
]
9: ; preds = %3
%10 = load i32*, i32** %6
%11 = call i32 @moveUp(i32* %10)
br label %21
12: ; preds = %3
%13 = load i32*, i32** %5
%14 = call i32 @moveRight(i32* %13)
br label %21
15: ; preds = %3
%16 = load i32*, i32** %6
%17 = call i32 @moveDown(i32* %16)
br label %21
18: ; preds = %3
%19 = load i32*, i32** %5
%20 = call i32 @moveLeft(i32* %19)
br label %21
21: ; preds = %3, %18, %15, %12, %9
ret void
}

LLVM IR (-O2):
define void @moveChar(i8 signext %0, i32* %1, i32* %2) {
%4 = sext i8 %0 to i32
switch i32 %4, label %13 [
i32 110, label %5
i32 101, label %7
i32 115, label %9
i32 119, label %11
]
5: ; preds = %3
%6 = tail call i32 @moveUp(i32* %2)
br label %13
7: ; preds = %3
%8 = tail call i32 @moveRight(i32* %1)
br label %13
9: ; preds = %3
%10 = tail call i32 @moveDown(i32* %2)
br label %13
11: ; preds = %3
%12 = tail call i32 @moveLeft(i32* %1)
br label %13
13: ; preds = %3, %11, %9, %7, %5
ret void
}
int findRange(char c) {
  int ret = 0;
  if (c >= 'a' && c <= 'z')
    ret = 36 + (c - 'a');
  else if (c >= 'A' && c <= 'Z')
    ret = 11 + (c - 'A');
  else
    ret = 1 + (c - '0');
  ret++;
  return ret;
}


x86 assembly (clang, -O0):
<findRange>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     113d <findRange+0x3d>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     113d <findRange+0x3d>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0x24,%eax
mov    %eax,-0x8(%rbp)
jmp    117b <findRange+0x7b>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1169 <findRange+0x69>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1169 <findRange+0x69>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xb,%eax
mov    %eax,-0x8(%rbp)
jmp    1176 <findRange+0x76>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117b <findRange+0x7b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findRange>:
lea    -0x61(%rdi),%eax
lea    -0x41(%rdi),%ecx
cmp    $0x1a,%cl
mov    $0xffffffca,%ecx
mov    $0xffffffd1,%edx
cmovb  %ecx,%edx
cmp    $0x1a,%al
mov    $0xffffffc3,%eax
cmovae %edx,%eax
add    %edi,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @findRange(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 36, %14
store i32 %15, i32* %3
br label %35
16: ; preds = %7, %1
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 65
br i1 %19, label %20, label %29
20: ; preds = %16
%21 = load i8, i8* %2
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %22, 90
br i1 %23, label %24, label %29
24: ; preds = %20
%25 = load i8, i8* %2
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 65
%28 = add nsw i32 11, %27
store i32 %28, i32* %3
br label %34
29: ; preds = %20, %16
%30 = load i8, i8* %2
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %31, 48
%33 = add nsw i32 1, %32
store i32 %33, i32* %3
br label %34
34: ; preds = %29, %24
br label %35
35: ; preds = %34, %11
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
define i32 @findRange(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -97
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -65
%6 = icmp ult i8 %5, 26
%7 = select i1 %6, i32 -54, i32 -47
%8 = select i1 %4, i32 -61, i32 %7
%9 = add nsw i32 %8, %2
%10 = add nsw i32 %9, 1
ret i32 %10
}
char *strcpy(char *dst, const char *src) {
  int i = 0;
  while ((dst[i] = src[i]) != '\0')
    i++;
  return dst;
}


x86 assembly (clang, -O0):
<strcpy>:
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
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1143 <strcpy+0x43>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
mov    -0x8(%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 i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %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 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 %11, i8* %15
%16 = sext i8 %11 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %6
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int myfunction();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", myfunction());
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <myfunction@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <myfunction@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @myfunction()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Circle187(long, long, long, unsigned long);
void circle(long x, long y, long r, unsigned long c) { Circle187(x, y, r, c); }


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

x86 assembly (clang, -O2):
<circle>:
jmp    1030 <Circle187@plt>

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

LLVM IR (-O2):
define void @circle(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 @Circle187(i64 %0, i64 %1, i64 %2, i64 %3)
ret void
}