xunge/DecIR huggingface dataset:
/* Variables and functions */
int EINVAL;
int crypto_rfc4106_check_authsize(unsigned int authsize) {
  switch (authsize) {
  case 8:
  case 12:
  case 16:
    break;
  default:
    return -EINVAL;
  }
  return 0;
}


x86 assembly (clang, -O0):
<crypto_rfc4106_check_authsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x8,%eax
je     113d <crypto_rfc4106_check_authsize+0x3d>
jmp    111b <crypto_rfc4106_check_authsize+0x1b>
mov    -0xc(%rbp),%eax
sub    $0xc,%eax
je     113d <crypto_rfc4106_check_authsize+0x3d>
jmp    112c <crypto_rfc4106_check_authsize+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x10,%eax
jne    1142 <crypto_rfc4106_check_authsize+0x42>
jmp    113d <crypto_rfc4106_check_authsize+0x3d>
jmp    1155 <crypto_rfc4106_check_authsize+0x55>
xor    %eax,%eax
mov    0x2e95(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <crypto_rfc4106_check_authsize+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_rfc4106_check_authsize>:
cmp    $0x10,%edi
ja     1112 <crypto_rfc4106_check_authsize+0x12>
xor    %eax,%eax
mov    $0x11100,%ecx
bt     %edi,%ecx
jae    1112 <crypto_rfc4106_check_authsize+0x12>
ret
mov    0x2ec7(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @crypto_rfc4106_check_authsize(i32 %0) {
switch i32 %0, label %2 [
i32 8, label %5
i32 12, label %5
i32 16, label %5
]
2: ; preds = %1
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ %4, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %6
}
int digitValue(char c) {
  int value = 0;
  switch (c) {
  case 'I':
    value = 1;
    break;
  case 'V':
    value = 5;
    break;
  case 'X':
    value = 10;
    break;
  case 'L':
    value = 50;
    break;
  case 'C':
    value = 100;
    break;
  case '\0':
    value = 0;
    break;
  default:
    value = -1;
  }
  return value;
}


x86 assembly (clang, -O0):
<digitValue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     11b6 <digitValue+0xb6>
jmp    1125 <digitValue+0x25>
mov    -0xc(%rbp),%eax
sub    $0x43,%eax
je     11aa <digitValue+0xaa>
jmp    1136 <digitValue+0x36>
mov    -0xc(%rbp),%eax
sub    $0x49,%eax
je     117a <digitValue+0x7a>
jmp    1147 <digitValue+0x47>
mov    -0xc(%rbp),%eax
sub    $0x4c,%eax
je     119e <digitValue+0x9e>
jmp    1158 <digitValue+0x58>
mov    -0xc(%rbp),%eax
sub    $0x56,%eax
je     1186 <digitValue+0x86>
jmp    1169 <digitValue+0x69>
mov    -0xc(%rbp),%eax
sub    $0x58,%eax
je     1192 <digitValue+0x92>
jmp    11c2 <digitValue+0xc2>
movl   $0x1,-0x8(%rbp)
jmp    11c9 <digitValue+0xc9>
movl   $0x5,-0x8(%rbp)
jmp    11c9 <digitValue+0xc9>
movl   $0xa,-0x8(%rbp)
jmp    11c9 <digitValue+0xc9>
movl   $0x32,-0x8(%rbp)
jmp    11c9 <digitValue+0xc9>
movl   $0x64,-0x8(%rbp)
jmp    11c9 <digitValue+0xc9>
movl   $0x0,-0x8(%rbp)
jmp    11c9 <digitValue+0xc9>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitValue>:
lea    -0x43(%rdi),%ecx
cmp    $0x15,%ecx
ja     1123 <digitValue+0x23>
mov    $0x1,%eax
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x64,%eax
ret
test   %edi,%edi
jne    112a <digitValue+0x2a>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x32,%eax
ret
mov    $0x5,%eax
ret
mov    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @digitValue(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
switch i32 %5, label %12 [
i32 73, label %6
i32 86, label %7
i32 88, label %8
i32 76, label %9
i32 67, label %10
i32 0, label %11
]
6: ; preds = %1
store i32 1, i32* %3
br label %13
7: ; preds = %1
store i32 5, i32* %3
br label %13
8: ; preds = %1
store i32 10, i32* %3
br label %13
9: ; preds = %1
store i32 50, i32* %3
br label %13
10: ; preds = %1
store i32 100, i32* %3
br label %13
11: ; preds = %1
store i32 0, i32* %3
br label %13
12: ; preds = %1
store i32 -1, i32* %3
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @digitValue(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %8 [
i32 73, label %9
i32 86, label %3
i32 88, label %4
i32 76, label %5
i32 67, label %6
i32 0, label %7
]
3: ; preds = %1
br label %9
4: ; preds = %1
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %7, %6, %5, %4, %3
%10 = phi i32 [ -1, %8 ], [ 0, %7 ], [ 100, %6 ], [ 50, %5 ], [ 10, %4 ], [ 5, %3 ], [ 1, %1 ]
ret i32 %10
}
void swapm(double v[], int i, int j) {
  double temp;
  temp = v[i];
  v[i] = v[j];
  v[j] = temp;
}


x86 assembly (clang, -O0):
<swapm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapm>:
movslq %esi,%rax
movsd  (%rdi,%rax,8),%xmm0
movslq %edx,%rcx
movsd  (%rdi,%rcx,8),%xmm1
movsd  %xmm1,(%rdi,%rax,8)
movsd  %xmm0,(%rdi,%rcx,8)
ret

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

LLVM IR (-O2):
define void @swapm(double* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = load double, double* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
store double %9, double* %5
store double %6, double* %8
ret void
}
/* Variables and functions */
int move_pages(int, unsigned long, void **, int const *, int *, int);
int numa_move_pages(int pid, unsigned long count, void **pages,
                    const int *nodes, int *status, int flags) {
  return move_pages(pid, count, pages, nodes, status, flags);
}


x86 assembly (clang, -O0):
<numa_move_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <move_pages@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numa_move_pages>:
jmp    1030 <move_pages@plt>

LLVM IR (-O0):
define i32 @numa_move_pages(i32 %0, i64 %1, i8** %2, i32* %3, i32* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8**
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
store i32 %0, i32* %7
store i64 %1, i64* %8
store i8** %2, i8*** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i64, i64* %8
%15 = load i8**, i8*** %9
%16 = load i32*, i32** %10
%17 = load i32*, i32** %11
%18 = load i32, i32* %12
%19 = call i32 @move_pages(i32 %13, i64 %14, i8** %15, i32* %16, i32* %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @numa_move_pages(i32 %0, i64 %1, i8** %2, i32* %3, i32* %4, i32 %5) {
%7 = tail call i32 @move_pages(i32 %0, i64 %1, i8** %2, i32* %3, i32* %4, i32 %5)
ret i32 %7
}
/* Variables and functions */
int log(float);
float adcCoCalc(int value) {
  return log((94.37751004f / value) - 0.06084945844f) * 1900 / (-1.8971f) + 100;
}


x86 assembly (clang, -O0):
<adcCoCalc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm1
movss  0xee4(%rip),%xmm0
divss  %xmm1,%xmm0
movss  0xed4(%rip),%xmm1
subss  %xmm1,%xmm0
call   1030 <log@plt>
imul   $0x76c,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  0xeb5(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xea5(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcCoCalc>:
push   %rax
cvtsi2ss %edi,%xmm1
movss  0xee3(%rip),%xmm0
divss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
call   1030 <log@plt>
imul   $0x76c,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
divss  0xec5(%rip),%xmm0
addss  0xec1(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @adcCoCalc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to float
%5 = fdiv float 0x4057982920000000, %4
%6 = fsub float %5, 0x3FAF27A900000000
%7 = call i32 @log(float %6)
%8 = mul nsw i32 %7, 1900
%9 = sitofp i32 %8 to float
%10 = fdiv float %9, 0xBFFE5A8580000000
%11 = fadd float %10, 1.000000e+02
ret float %11
}

LLVM IR (-O2):
define float @adcCoCalc(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = fdiv float 0x4057982920000000, %2
%4 = fadd float %3, 0xBFAF27A900000000
%5 = tail call i32 @log(float %4)
%6 = mul nsw i32 %5, 1900
%7 = sitofp i32 %6 to float
%8 = fdiv float %7, 0x3FFE5A8580000000
%9 = fsub float 1.000000e+02, %8
ret float %9
}
void wkup_m3_wake_src(struct wkup_m3_wakeup_src *wakeup_src) {}


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

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

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

LLVM IR (-O2):
%struct.wkup_m3_wakeup_src = type opaque
define void @wkup_m3_wake_src(%struct.wkup_m3_wakeup_src* nocapture %0) {
ret void
}
int main(void) {
  char s[] = "hello";
  s[0] = 'x';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xef0(%rip),%ax
mov    %ax,-0x2(%rbp)
movb   $0x78,-0x6(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.s = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = bitcast [6 x i8]* %1 to i8*
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
store i8 120, i8* %3
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @RTCritSectEnterDebug() {
ret void
}
/* Variables and functions */
int silnia(int);
int npok(int a, int b) { return silnia(a) / (silnia(b) * silnia(a - b)); }


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

x86 assembly (clang, -O2):
<npok>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <silnia@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <silnia@plt>
mov    %eax,%r15d
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <silnia@plt>
mov    %eax,%ecx
imul   %r15d,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @npok(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @silnia(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @silnia(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = call i32 @silnia(i32 %11)
%13 = mul nsw i32 %8, %12
%14 = sdiv i32 %6, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @npok(i32 %0, i32 %1) {
%3 = tail call i32 @silnia(i32 %0)
%4 = tail call i32 @silnia(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call i32 @silnia(i32 %5)
%7 = mul nsw i32 %6, %4
%8 = sdiv i32 %3, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ cache_clean_invalidate();
int /*<<< orphan*/ mem_mapping_linear();
int /*<<< orphan*/ tlb_invalidate();
void mem_map(void) {
  mem_mapping_linear();
  cache_clean_invalidate();
  tlb_invalidate();
}


x86 assembly (clang, -O0):
<mem_map>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <mem_mapping_linear@plt>
mov    $0x0,%al
call   1030 <cache_clean_invalidate@plt>
mov    $0x0,%al
call   1050 <tlb_invalidate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_map>:
push   %rax
xor    %eax,%eax
call   1040 <mem_mapping_linear@plt>
xor    %eax,%eax
call   1030 <cache_clean_invalidate@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <tlb_invalidate@plt>

LLVM IR (-O0):
define void @mem_map() {
%1 = call i32 (...) @mem_mapping_linear()
%2 = call i32 (...) @cache_clean_invalidate()
%3 = call i32 (...) @tlb_invalidate()
ret void
}

LLVM IR (-O2):
define void @mem_map() {
%1 = tail call i32 (...) @mem_mapping_linear()
%2 = tail call i32 (...) @cache_clean_invalidate()
%3 = tail call i32 (...) @tlb_invalidate()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ecrire_int(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int strlen(char *);
void ecrire_chaine_binaire(FILE *fichier, char *chaine) {
  int taille;
  taille = strlen(chaine);
  ecrire_int(fichier, taille);
  fwrite(chaine, 1, taille, fichier);
}


x86 assembly (clang, -O0):
<ecrire_chaine_binaire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <ecrire_int@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecrire_chaine_binaire>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <ecrire_int@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <fwrite@plt>

LLVM IR (-O0):
define void @ecrire_chaine_binaire(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %5
%10 = call i32 @ecrire_int(i32* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i32*, i32** %3
%14 = call i32 @fwrite(i8* %11, i32 1, i32 %12, i32* %13)
ret void
}

LLVM IR (-O2):
define void @ecrire_chaine_binaire(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @ecrire_int(i32* %0, i32 %3)
%5 = tail call i32 @fwrite(i8* %1, i32 1, i32 %3, i32* %0)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct stat *, int /*<<< orphan*/, int);
int /*<<< orphan*/ stat_make_file(struct stat *);
void stat_default_file(struct stat *st) {
  memset(st, 0, sizeof(struct stat));
  stat_make_file(st);
}


x86 assembly (clang, -O0):
<stat_default_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1030 <stat_make_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat_default_file>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <stat_make_file@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define void @stat_default_file(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = call i32 @memset(%struct.stat* %3, i32 0, i32 4)
%5 = load %struct.stat*, %struct.stat** %2
%6 = call i32 @stat_make_file(%struct.stat* %5)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define void @stat_default_file(%struct.stat* %0) {
%2 = tail call i32 @memset(%struct.stat* %0, i32 0, i32 4)
%3 = tail call i32 @stat_make_file(%struct.stat* %0)
ret void
}
int mulNum(int a, int b) { return (a * b); }


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

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

LLVM IR (-O0):
define i32 @mulNum(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mulNum(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ext_device_restore_sudirribe() {
  printf("NOT IMPLEMENTED:"
         "pa_ext_device_restore_sudirribe"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"NOT IMPLEMENTED:pa_ext_device_restore_sudirribe\0A\00"
define i32 @pa_ext_device_restore_sudirribe() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [48 x i8] c"NOT IMPLEMENTED:pa_ext_device_restore_sudirribe\00"
define i32 @pa_ext_device_restore_sudirribe() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ open(char *, int, ...);
void test1() {
  open("path", 0x100);
  open("path", 0x100, 0660);
  open("path", 0);
  open("path", 0, 0);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x100,%esi
mov    $0x0,%al
call   1030 <open@plt>
lea    0xed2(%rip),%rdi
mov    $0x100,%esi
mov    $0x1b0,%edx
mov    $0x0,%al
call   1030 <open@plt>
lea    0xeba(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <open@plt>
lea    0xeaa(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
xor    %eax,%eax
call   1030 <open@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
mov    $0x1b0,%edx
xor    %eax,%eax
call   1030 <open@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <open@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"path\00"
define void @test1() {
%1 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 256)
%2 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 256, i32 432)
%3 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"path\00"
define void @test1() {
%1 = tail call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 256)
%2 = tail call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 256, i32 432)
%3 = tail call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ v;
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
__attribute__((__unused__)) __attribute__((__nonnull__)) uint32_t
gdnsd_get_una32(const uint8_t *p) {
  uint32_t v;
  memcpy(&v, p, sizeof(v));
  return v;
}


x86 assembly (clang, -O0):
<gdnsd_get_una32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdnsd_get_una32>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gdnsd_get_una32(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i32* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
void chr_swap(char *a, char *b) {
  char swap = *a;
  *a = *b;
  *b = swap;
}


x86 assembly (clang, -O0):
<chr_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<chr_swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @chr_swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @chr_swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double gettime(void) {
  struct timeval tv;
  struct timezone tz;
  double i;
  gettimeofday(&tv, NULL);
  i = tv.tv_usec;
  return i;
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { double }
%struct.timezone = type { i32 }
define double @gettime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = alloca double
%4 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%6 = load double, double* %5
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
%struct.timeval = type { double }
define double @gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
ret double %5
}
/* Variables and functions */
int reverse(int);
bool isPalindrome(int x) { return x >= 0 && x == reverse(x); }


x86 assembly (clang, -O0):
<isPalindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1145 <isPalindrome+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <reverse@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindrome>:
test   %edi,%edi
js     1127 <isPalindrome+0x17>
push   %rbx
mov    %edi,%ebx
call   1030 <reverse@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPalindrome(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @reverse(i32 %7)
%9 = icmp eq i32 %6, %8
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ false, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isPalindrome(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @reverse(i32 %0)
%5 = icmp eq i32 %4, %0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
void pramcache_save_page_cache(struct super_block *sb) {}


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

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

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

LLVM IR (-O2):
%struct.super_block = type opaque
define void @pramcache_save_page_cache(%struct.super_block* nocapture %0) {
ret void
}
/* Type definitions */
struct random {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct random *);
void random_exit(struct random *r) { free(r); }


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

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

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

LLVM IR (-O2):
%struct.random = type { i32 }
define void @random_exit(%struct.random* nocapture %0) {
%2 = tail call i32 @free(%struct.random* %0)
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  const char *p = str;
  while (*p) {
    p++;
  }
  return (size_t)(p - str);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
void TimerLoadSet64(unsigned long ulBase, unsigned long long ullValue) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) = ullValue >> 32;
  (*((volatile unsigned long *)(ulBase + 0x00000028))) = ullValue & 0xffffffff;
}


x86 assembly (clang, -O0):
<TimerLoadSet64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
shr    $0x20,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x2c(%rax)
movabs $0xffffffff,%rcx
and    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x28(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerLoadSet64>:
mov    %esi,%eax
shr    $0x20,%rsi
mov    %rsi,0x2c(%rdi)
mov    %rax,0x28(%rdi)
ret

LLVM IR (-O0):
define void @TimerLoadSet64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = lshr i64 %5, 32
%7 = load i64, i64* %3
%8 = add i64 %7, 44
%9 = inttoptr i64 %8 to i64*
store volatile i64 %6, i64* %9
%10 = load i64, i64* %4
%11 = and i64 %10, 4294967295
%12 = load i64, i64* %3
%13 = add i64 %12, 40
%14 = inttoptr i64 %13 to i64*
store volatile i64 %11, i64* %14
ret void
}

LLVM IR (-O2):
define void @TimerLoadSet64(i64 %0, i64 %1) {
%3 = lshr i64 %1, 32
%4 = add i64 %0, 44
%5 = inttoptr i64 %4 to i64*
store volatile i64 %3, i64* %5
%6 = and i64 %1, 4294967295
%7 = add i64 %0, 40
%8 = inttoptr i64 %7 to i64*
store volatile i64 %6, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void or_reg32_imm32(int reg32, unsigned long imm32) {
  put8(0x81);
  put8(0xC8 + reg32);
  put32(imm32);
}


x86 assembly (clang, -O0):
<or_reg32_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x81,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0xc8,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or_reg32_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x81,%edi
call   1030 <put8@plt>
add    $0xc8,%ebp
mov    %ebp,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @or_reg32_imm32(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = call i32 @put8(i32 129)
%6 = load i32, i32* %3
%7 = add nsw i32 200, %6
%8 = call i32 @put8(i32 %7)
%9 = load i64, i64* %4
%10 = call i32 @put32(i64 %9)
ret void
}

LLVM IR (-O2):
define void @or_reg32_imm32(i32 %0, i64 %1) {
%3 = tail call i32 @put8(i32 129)
%4 = add nsw i32 %0, 200
%5 = tail call i32 @put8(i32 %4)
%6 = tail call i32 @put32(i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int sump(int);
int main(void) {
  int n;
  printf("请输入一个整数: ");
  scanf("%d", &n);
  printf("1到%d之间的和: %d\n", n, sump(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <sump@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1050 <sump@plt>
lea    0xeb5(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"1\E5\88\B0%d\E4\B9\8B\E9\97\B4\E7\9A\84\E5\92\8C: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @sump(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"1\E5\88\B0%d\E4\B9\8B\E9\97\B4\E7\9A\84\E5\92\8C: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @sump(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
int test_imm_29uint32_mem(unsigned int *val) {
  return ((*val) & (0x29 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_29uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 41
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double fmod(double, double);
double aa_fremainder(double a, double b) { return fmod(a, b); }


x86 assembly (clang, -O0):
<aa_fremainder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <fmod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_fremainder>:
jmp    1030 <fmod@plt>

LLVM IR (-O0):
define double @aa_fremainder(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @fmod(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @aa_fremainder(double %0, double %1) {
%3 = tail call double @fmod(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, int /*<<< orphan*/ *);
int fork();
int main(int argc, char **argv) {
  int pid = fork();
  if (pid == 0) {
    execlp("ls", "ls", "-l", NULL);
  } else {
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1169 <main+0x49>
lea    0xeaf(%rip),%rsi
lea    0xeab(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1030 <execlp@plt>
jmp    116e <main+0x4e>
jmp    116e <main+0x4e>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
jne    1144 <main+0x24>
lea    0xecd(%rip),%rdi
lea    0xec9(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
call   1030 <execlp@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fork()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
br label %7
7: ; preds = %2, %5
ret i32 1
}
void glIsProgram(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glIsProgram() {
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t xchg64(uint64_t *addr, uint64_t val) {
  asm volatile("xchg"
               "q"
               " %0,%1"
               : "=r"(val)
               : "m"(*addr), "0"(val)
               : "memory");
  return val;
}


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

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

LLVM IR (-O0):
define i8* @xchg64(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 = load i8*, i8** %4
%7 = call i8* asm sideeffect "xchgq $0,$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %5, i8* %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
define i8* @xchg64(i8** %0, i8* %1) {
%3 = tail call i8* asm sideeffect "xchgq $0,$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strlen(char *);
int main(int argc, char **argv) {
  char name[] = "Mahesh S  Rao";
  printf("Name %s\n", name);
  printf("length: %ld\n", strlen(name));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x1e(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
lea    -0x1e(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rsi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6f615220205320,%rax
mov    %rax,0x6(%rsp)
movabs $0x532068736568614d,%rax
68 20 53
mov    %rax,(%rsp)
lea    0xec5(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xeb4(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.name = [14 x i8] c"Mahesh S Rao\00"
@.str = [9 x i8] c"Name %s\0A\00"
@.str.1 = [13 x i8] c"length: %ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [14 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [14 x i8]* %6 to i8*
%8 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
%11 = call i8* @strlen(i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.name = [14 x i8] c"Mahesh S Rao\00"
@.str = [9 x i8] c"Name %s\0A\00"
@.str.1 = [13 x i8] c"length: %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [14 x i8]
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i8* @strlen(i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}
int Right(i) { return 2 * i + 1; }


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

x86 assembly (clang, -O2):
<Right>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @Right(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @Right(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("ANITALAVALATINA\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"ANITALAVALATINA\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void __attribute__((weak)) dcmi_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<dcmi_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcmi_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.dcmi_isr = [9 x i8] c"dcmi_isr\00"
define weak void @dcmi_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.dcmi_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.dcmi_isr = [9 x i8] c"dcmi_isr\00"
define weak void @dcmi_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.dcmi_isr, i64 0, i64 0))
ret void
}
int rl_list_possib(pathname, avp)
char *pathname;
char ***avp;
{
  char *dir;
  char *file;
  int ac;
  if (SplitPath(pathname, &dir, &file) < 0)
    return 0;
  ac = FindMatches(dir, file, avp);
  free((char *)(dir));
  free((char *)(file));
  return ac;
}


x86 assembly (clang, -O0):
<rl_list_possib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1050 <SplitPath@plt>
cmp    $0x0,%eax
jge    1168 <rl_list_possib+0x38>
movl   $0x0,-0x4(%rbp)
jmp    1196 <rl_list_possib+0x66>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <FindMatches@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_list_possib>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
xor    %ebx,%ebx
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1050 <SplitPath@plt>
test   %eax,%eax
js     117b <rl_list_possib+0x4b>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <FindMatches@plt>
mov    %eax,%ebx
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @rl_list_possib(i8* %0, i8*** %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = bitcast i8** %3 to i8*
%6 = bitcast i8** %4 to i8*
%7 = call i32 (i8*, i8**, i8**, ...) bitcast (i32 (...)* @SplitPath to i32 (i8*, i8**, i8**, ...)*)(i8* %0, i8** %3, i8** %4)
%8 = icmp slt i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 (i8*, i8*, i8***, ...) bitcast (i32 (...)* @FindMatches to i32 (i8*, i8*, i8***, ...)*)(i8* %10, i8* %11, i8*** %1)
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
br label %15
15: ; preds = %2, %9
%16 = phi i32 [ %12, %9 ], [ 0, %2 ]
ret i32 %16
}