xunge/DecIR huggingface dataset:
/* Variables and functions */
char toupper(char);
char *__strupr(char *str) {
  char *p = str;
  while (*p) {
    *p = toupper(*p);
    ++p;
  }
  return str;
}


x86 assembly (clang, -O0):
<__strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <__strupr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <__strupr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <__strupr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <__strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @__strupr(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 %16
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call signext i8 @toupper(i8 signext %11)
%13 = load i8*, i8** %3
store i8 %12, i8* %13
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
br label %5
16: ; preds = %5
%17 = load i8*, i8** %2
ret i8* %17
}

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


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

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

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

LLVM IR (-O2):
define void @gdk_input_set_extension_events() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y;
};
typedef TYPE_1__ XKeyReleasedEvent;

/* Variables and functions */
int get_XKeyReleasedEvent_y(void *_p) {
  return (int)((XKeyReleasedEvent *)_p)->y;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XKeyReleasedEvent_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void CONF_get_string(void) {}


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

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

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

LLVM IR (-O2):
define void @CONF_get_string() {
ret void
}
void noShadow() {
  switch (0) {
    int x;
  case 0: {
    x = 0;
  }
  }
}


x86 assembly (clang, -O0):
<noShadow>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
test   %al,%al
jne    111a <noShadow+0x1a>
jmp    1113 <noShadow+0x13>
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @noShadow() {
%1 = alloca i32
switch i32 0, label %3 [
i32 0, label %2
]
2: ; preds = %0
store i32 0, i32* %1
br label %3
3: ; preds = %2, %0
ret void
}

LLVM IR (-O2):
define void @noShadow() {
ret void
}
/* Variables and functions */
unsigned int binary(unsigned int);
int palindrome(unsigned int);
unsigned int is_validate(unsigned int number) {
  if (palindrome(number) == 1 && palindrome(binary(number)) == 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <palindrome@plt>
cmp    $0x1,%eax
jne    1160 <is_validate+0x40>
mov    -0x8(%rbp),%edi
call   1030 <binary@plt>
mov    %eax,%edi
call   1040 <palindrome@plt>
cmp    $0x1,%eax
jne    1160 <is_validate+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1167 <is_validate+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_validate>:
push   %rbx
mov    %edi,%ebx
call   1040 <palindrome@plt>
cmp    $0x1,%eax
jne    1147 <is_validate+0x27>
mov    %ebx,%edi
call   1030 <binary@plt>
mov    %eax,%edi
call   1040 <palindrome@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     1149 <is_validate+0x29>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_validate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @palindrome(i32 %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @binary(i32 %8)
%10 = call i32 @palindrome(i32 %9)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %7
store i32 1, i32* %2
br label %14
13: ; preds = %7, %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @is_validate(i32 %0) {
%2 = tail call i32 @palindrome(i32 %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @binary(i32 %0)
%6 = tail call i32 @palindrome(i32 %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %9, label %8
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 0, %8 ], [ 1, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
double stdlib_strided_dssumpw(int /*<<< orphan*/ const, float const *,
                              int /*<<< orphan*/ const);
double stdlib_strided_dssum(const int64_t N, const float *X,
                            const int64_t stride) {
  return stdlib_strided_dssumpw(N, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_dssum>:
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 <stdlib_strided_dssumpw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dssum>:
jmp    1030 <stdlib_strided_dssumpw@plt>

LLVM IR (-O0):
define double @stdlib_strided_dssum(i32 %0, float* %1, i32 %2) {
%4 = alloca i32
%5 = alloca float*
%6 = alloca i32
store i32 %0, i32* %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load float*, float** %5
%9 = load i32, i32* %6
%10 = call double @stdlib_strided_dssumpw(i32 %7, float* %8, i32 %9)
ret double %10
}

LLVM IR (-O2):
define double @stdlib_strided_dssum(i32 %0, float* %1, i32 %2) {
%4 = tail call double @stdlib_strided_dssumpw(i32 %0, float* %1, i32 %2)
ret double %4
}
/* Variables and functions */
int fnmatch(char const *, char const *, int /*<<< orphan*/);
int c_strmatch(const char *pat, const char *str) {
  return fnmatch(pat, str, 0);
}


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

x86 assembly (clang, -O2):
<c_strmatch>:
xor    %edx,%edx
jmp    1030 <fnmatch@plt>

LLVM IR (-O0):
define i32 @c_strmatch(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 i32 @fnmatch(i8* %5, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @c_strmatch(i8* %0, i8* %1) {
%3 = tail call i32 @fnmatch(i8* %0, i8* %1, i32 0)
ret i32 %3
}
int test_imm_42int8_reg(signed char val) {
  return ((val) & (0x42 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_42int8_reg>:
test   $0x42,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_42int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 66
%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_42int8_reg(i8 signext %0) {
%2 = and i8 %0, 66
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ freelist_shutdown();
int /*<<< orphan*/ verify_heap();
void teardown() {
  verify_heap();
  freelist_shutdown();
}


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

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

LLVM IR (-O0):
define void @teardown() {
%1 = call i32 (...) @verify_heap()
%2 = call i32 (...) @freelist_shutdown()
ret void
}

LLVM IR (-O2):
define void @teardown() {
%1 = tail call i32 (...) @verify_heap()
%2 = tail call i32 (...) @freelist_shutdown()
ret void
}
int main() {
  int j = 0;
  for (int b = 0;; b++) {
    j += j;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
int dev_pm_set_wake_irq(struct device *dev, int irq) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @dev_pm_set_wake_irq(%struct.device* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ec_cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int halt_session(void) {
  ec_cleanup();
  exit(0);
}


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

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

LLVM IR (-O0):
define i32 @halt_session() {
%1 = call i32 (...) @ec_cleanup()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @halt_session() {
%1 = tail call i32 (...) @ec_cleanup()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int F2_cc_nu_n(double, double);
double F1_cc_nu_n(double xx, double Q2) { return F2_cc_nu_n(xx, Q2) / 2 / xx; }


x86 assembly (clang, -O0):
<F1_cc_nu_n>:
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 <F2_cc_nu_n@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F1_cc_nu_n>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <F2_cc_nu_n@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @F1_cc_nu_n(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 i32 @F2_cc_nu_n(double %5, double %6)
%8 = sdiv i32 %7, 2
%9 = sitofp i32 %8 to double
%10 = load double, double* %3
%11 = fdiv double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @F1_cc_nu_n(double %0, double %1) {
%3 = tail call i32 @F2_cc_nu_n(double %0, double %1)
%4 = sdiv i32 %3, 2
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, %0
ret double %6
}
/* Variables and functions */
char *GetRandomData(char *, int, char *);
char *GetRandomAlphabetStr(char *RetBuff, int len) {
  return (GetRandomData(
      RetBuff, len,
      "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"));
}


x86 assembly (clang, -O0):
<GetRandomAlphabetStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <GetRandomData@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRandomAlphabetStr>:
lea    0xee9(%rip),%rdx
jmp    1030 <GetRandomData@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\00"
define i8* @GetRandomAlphabetStr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i8* @GetRandomData(i8* %5, i32 %6, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
@.str = [63 x i8] c"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\00"
define i8* @GetRandomAlphabetStr(i8* %0, i32 %1) {
%3 = tail call i8* @GetRandomData(i8* %0, i32 %1, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
short urj_jam_bits_required(short n) {
  short result = 16;
  if (n == 0)
    result = 1;
  else {
    while ((n & (1 << (16 - 1))) == 0) {
      n = (short)(n << 1);
      --result;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<urj_jam_bits_required>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movw   $0x10,-0x4(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1129 <urj_jam_bits_required+0x29>
movw   $0x1,-0x4(%rbp)
jmp    1161 <urj_jam_bits_required+0x61>
jmp    112e <urj_jam_bits_required+0x2e>
movswl -0x2(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
jne    115c <urj_jam_bits_required+0x5c>
movswl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %ax,-0x2(%rbp)
mov    -0x4(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x4(%rbp)
jmp    112e <urj_jam_bits_required+0x2e>
jmp    1161 <urj_jam_bits_required+0x61>
movswl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<urj_jam_bits_required>:
test   %di,%di
je     111b <urj_jam_bits_required+0x1b>
mov    $0x10,%ax
js     111a <urj_jam_bits_required+0x1a>
nopl   0x0(%rax,%rax,1)
add    %edi,%edi
add    $0xffffffff,%eax
test   %di,%di
jns    1110 <urj_jam_bits_required+0x10>
ret
mov    $0x1,%ax
ret

LLVM IR (-O0):
define signext i16 @urj_jam_bits_required(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
store i16 16, i16* %3
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i16 1, i16* %3
br label %22
8: ; preds = %1
br label %9
9: ; preds = %14, %8
%10 = load i16, i16* %2
%11 = sext i16 %10 to i32
%12 = and i32 %11, 32768
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %9
%15 = load i16, i16* %2
%16 = sext i16 %15 to i32
%17 = shl i32 %16, 1
%18 = trunc i32 %17 to i16
store i16 %18, i16* %2
%19 = load i16, i16* %3
%20 = add i16 %19, -1
store i16 %20, i16* %3
br label %9
21: ; preds = %9
br label %22
22: ; preds = %21, %7
%23 = load i16, i16* %3
ret i16 %23
}

LLVM IR (-O2):
define signext i16 @urj_jam_bits_required(i16 signext %0) {
%2 = icmp eq i16 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp sgt i16 %0, -1
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i16 [ %9, %5 ], [ 16, %3 ]
%7 = phi i16 [ %8, %5 ], [ %0, %3 ]
%8 = shl nuw i16 %7, 1
%9 = add i16 %6, -1
%10 = icmp sgt i16 %8, -1
br i1 %10, label %5, label %11
11: ; preds = %5, %3, %1
%12 = phi i16 [ 1, %1 ], [ 16, %3 ], [ %9, %5 ]
ret i16 %12
}
int main(void) {
  const int x = 0;
  int *p = &x;
  *p = 5;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
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
%3 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
store i32 5, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct _WsbmBufferPool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _WsbmBufferPool *);
void pool_takedown(struct _WsbmBufferPool *pool) { free(pool); }


x86 assembly (clang, -O0):
<pool_takedown>:
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):
<pool_takedown>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct._WsbmBufferPool = type { i32 }
define void @pool_takedown(%struct._WsbmBufferPool* nocapture %0) {
%2 = tail call i32 @free(%struct._WsbmBufferPool* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_sub_d(double *, double, double);
double xil_fpo_sub_d(double a, double b) {
  double res_d;
  xip_fpo_sub_d(&res_d, a, b);
  return res_d;
}


x86 assembly (clang, -O0):
<xil_fpo_sub_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x18(%rbp),%rdi
call   1030 <xip_fpo_sub_d@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @xil_fpo_sub_d(double %0, double %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = call i32 @xip_fpo_sub_d(double* %3, double %0, double %1)
%6 = load double, double* %3
ret double %6
}
/* Variables and functions */
double cos(int /*<<< orphan*/);
int /*<<< orphan*/ radians(double);
double xscale_at_lat(double latitude) { return cos(radians(latitude)); }


x86 assembly (clang, -O0):
<xscale_at_lat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <radians@plt>
mov    %eax,%edi
call   1040 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xscale_at_lat>:
push   %rax
call   1030 <radians@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <cos@plt>

LLVM IR (-O0):
define double @xscale_at_lat(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @radians(double %3)
%5 = call double @cos(i32 %4)
ret double %5
}

LLVM IR (-O2):
define double @xscale_at_lat(double %0) {
%2 = tail call i32 @radians(double %0)
%3 = tail call double @cos(i32 %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void abort_query(int sig) { exit(1); }


x86 assembly (clang, -O0):
<abort_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<abort_query>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @abort_query(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @abort_query(i32 %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int atoi(char *);
int pow(int, int);
int /*<<< orphan*/ printf(char *, int);
void exponent(char *arg1, char *arg2) {
  int a, b, c;
  a = atoi(arg1);
  b = atoi(arg2);
  c = pow(a, b);
  printf("%d\n", c);
}


x86 assembly (clang, -O0):
<exponent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <pow@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponent>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <pow@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @exponent(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @pow(i32 %12, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @exponent(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @atoi(i8* %0)
%4 = tail call i32 @atoi(i8* %1)
%5 = tail call i32 @pow(i32 %3, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
unsigned int get_up_irq(unsigned int irq) {
  if (irq >= 155)
    return (80 + 6) + (irq - 155) / 32;
  return 0;
}


x86 assembly (clang, -O0):
<get_up_irq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9b,-0x8(%rbp)
jb     112a <get_up_irq+0x2a>
mov    -0x8(%rbp),%eax
sub    $0x9b,%eax
shr    $0x5,%eax
add    $0x56,%eax
mov    %eax,-0x4(%rbp)
jmp    1131 <get_up_irq+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_up_irq>:
lea    -0x9b(%rdi),%ecx
shr    $0x5,%ecx
add    $0x56,%ecx
xor    %eax,%eax
cmp    $0x9b,%edi
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_up_irq(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp uge i32 %4, 155
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sub i32 %7, 155
%9 = udiv i32 %8, 32
%10 = add i32 86, %9
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_up_irq(i32 %0) {
%2 = icmp ugt i32 %0, 154
%3 = add i32 %0, -155
%4 = lshr i32 %3, 5
%5 = add nuw nsw i32 %4, 86
%6 = select i1 %2, i32 %5, i32 0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ lnxcDisplayPaint();
void linuxDisplayPaint(int window) {
  if (window) {
  } else {
    lnxcDisplayPaint();
  }
}


x86 assembly (clang, -O0):
<linuxDisplayPaint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112a <linuxDisplayPaint+0x1a>
jmp    1131 <linuxDisplayPaint+0x21>
mov    $0x0,%al
call   1030 <lnxcDisplayPaint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linuxDisplayPaint>:
test   %edi,%edi
je     1115 <linuxDisplayPaint+0x5>
ret
xor    %eax,%eax
jmp    1030 <lnxcDisplayPaint@plt>

LLVM IR (-O0):
define void @linuxDisplayPaint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = call i32 (...) @lnxcDisplayPaint()
br label %8
8: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @linuxDisplayPaint(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @lnxcDisplayPaint()
br label %5
5: ; preds = %1, %3
ret void
}
void RTLockValidatorRecSharedDelete(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorRecSharedDelete() {
ret void
}
void chk2(void) {}


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

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

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

LLVM IR (-O2):
define void @chk2() {
ret void
}
int mdc(int a, int b) {
  if (a == 0) {
    return 0;
  }
  return mdc(a % b, a);
}


x86 assembly (clang, -O0):
<mdc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1134 <mdc+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1148 <mdc+0x38>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%edi
mov    -0x8(%rbp),%esi
call   1030 <mdc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdc>:
test   %edi,%edi
je     111d <mdc+0x1d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %esi
mov    %edi,%esi
mov    %edx,%edi
test   %edx,%edx
jne    1110 <mdc+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mdc(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i32 0
}
void adis16204_uninitialize_ring(struct iio_ring_buffer *ring) {}


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define void @adis16204_uninitialize_ring(%struct.iio_ring_buffer* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
double *allocMat(int matsize) {
  double *mat;
  mat = (double *)malloc(matsize * matsize * sizeof(double));
  if (mat == NULL) {
    printf("Error : allocation fault.\n");
    exit(-1);
  }
  return (mat);
}


x86 assembly (clang, -O0):
<allocMat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <allocMat+0x44>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocMat>:
push   %rax
imul   %edi,%edi
shl    $0x3,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1143 <allocMat+0x13>
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Error : allocation fault.\0A\00"
define double* @allocMat(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 8
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to double*
store double* %11, double** %3
%12 = load double*, double** %3
%13 = icmp eq double* %12, null
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 -1)
unreachable
17: ; preds = %1
%18 = load double*, double** %3
ret double* %18
}

LLVM IR (-O2):
@str = [26 x i8] c"Error : allocation fault.\00"
define double* @allocMat(i32 %0) {
%2 = shl i32 %0, 3
%3 = mul i32 %2, %0
%4 = tail call i64 @malloc(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
%10 = inttoptr i64 %4 to double*
ret double* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _TIFFprintAscii(int /*<<< orphan*/ *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void _TIFFprintAsciiTag(FILE *fd, const char *name, const char *value) {
  fprintf(fd, "  %s: \"", name);
  _TIFFprintAscii(fd, value);
  fprintf(fd, "\"\n");
}


x86 assembly (clang, -O0):
<_TIFFprintAsciiTag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <_TIFFprintAscii@plt>
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_TIFFprintAsciiTag>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xebc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <_TIFFprintAscii@plt>
lea    0xeab(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [8 x i8] c" %s: \22\00"
@.str.1 = [3 x i8] c"\22\0A\00"
define void @_TIFFprintAsciiTag(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32*, i32** %4
%11 = load i8*, i8** %6
%12 = call i32 @_TIFFprintAscii(i32* %10, i8* %11)
%13 = load i32*, i32** %4
%14 = call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c" %s: \22\00"
@.str.1 = [3 x i8] c"\22\0A\00"
define void @_TIFFprintAsciiTag(i32* %0, i8* %1, i8* %2) {
%4 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @_TIFFprintAscii(i32* %0, i8* %2)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 2, i64 1, i32* %0)
ret void
}
int main() {
  sizeof(int);
  sizeof(20);
}


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

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

LLVM IR (-O0):
define i32 @main() {
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stub(int, char *, char *, char *, int /*<<< orphan*/);
void testTortureExecute(void) {
  stub(1, "ab", "bc", "cx", 0);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
lea    0xedc(%rip),%rdx
lea    0xed8(%rip),%rcx
xor    %r8d,%r8d
call   1030 <stub@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
lea    0xee9(%rip),%rsi
lea    0xee5(%rip),%rdx
lea    0xee1(%rip),%rcx
mov    $0x1,%edi
xor    %r8d,%r8d
jmp    1030 <stub@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ab\00"
@.str.1 = [3 x i8] c"bc\00"
@.str.2 = [3 x i8] c"cx\00"
define void @testTortureExecute() {
%1 = call i32 @stub(i32 1, 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), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ab\00"
@.str.1 = [3 x i8] c"bc\00"
@.str.2 = [3 x i8] c"cx\00"
define void @testTortureExecute() {
%1 = tail call i32 @stub(i32 1, 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), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat1(char *, char *);
int main() {
  char s[10] = "chen";
  char t[10] = "zongzhi";
  strcat1(s, t);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0x10(%rbp)
lea    -0xe(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <strcat1@plt>
lea    -0xe(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movw   $0x0,0x18(%rsp)
movq   $0x6e656863,0x10(%rsp)
65 6e
movabs $0x69687a676e6f7a,%rax
mov    %rax,(%rsp)
movw   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <strcat1@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.s = [10 x i8] c"chen\00\00\00\00\00\00"
@__const.main.t = [10 x i8] c"zongzhi\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcat1(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
char *strtok_r(char *, char const *, char **);
char *c_strtok_r(char *arg0, const char *arg1, char **arg2) {
  return strtok_r(arg0, arg1, arg2);
}


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

x86 assembly (clang, -O2):
<c_strtok_r>:
jmp    1030 <strtok_r@plt>

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

LLVM IR (-O2):
define i8* @c_strtok_r(i8* %0, i8* nocapture %1, i8** %2) {
%4 = tail call i8* @strtok_r(i8* %0, i8* %1, i8** %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ mk_MD5Init(void *);
void md5_init(void *context) { mk_MD5Init(context); }


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

x86 assembly (clang, -O2):
<md5_init>:
jmp    1030 <mk_MD5Init@plt>

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

LLVM IR (-O2):
define void @md5_init(i8* %0) {
%2 = tail call i32 @mk_MD5Init(i8* %0)
ret void
}
int bar() { return "honey"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"honey\00"
define i32 @bar() {
ret i32 ptrtoint ([6 x i8]* @.str to i32)
}

LLVM IR (-O2):
@.str = [6 x i8] c"honey\00"
define i32 @bar() {
ret i32 ptrtoint ([6 x i8]* @.str to i32)
}
/* Variables and functions */
int /*<<< orphan*/ dump_malloc_chunk(void *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *);
void free_wrapper(void *ptr) {
  if (!ptr) {
    printf("[-] free pointer == NULL\n");
    return;
  }
  free(ptr);
  dump_malloc_chunk(ptr);
}


x86 assembly (clang, -O0):
<free_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1158 <free_wrapper+0x28>
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
jmp    116a <free_wrapper+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1050 <dump_malloc_chunk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_wrapper>:
test   %rdi,%rdi
je     1147 <free_wrapper+0x17>
push   %rbx
mov    %rdi,%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <dump_malloc_chunk@plt>
lea    0xeb2(%rip),%rdi
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"[-] free pointer == NULL\0A\00"
define void @free_wrapper(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @dump_malloc_chunk(i8* %10)
br label %12
12: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"[-] free pointer == NULL\00"
define void @free_wrapper(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %8
5: ; preds = %1
%6 = tail call i32 @free(i8* %0)
%7 = tail call i32 @dump_malloc_chunk(i8* %0)
br label %8
8: ; preds = %5, %3
ret void
}
int foo() { return 123; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 123
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 123
}
unsigned int PerformInternalTest() { return 1; }


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

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

LLVM IR (-O0):
define i32 @PerformInternalTest() {
ret i32 1
}

LLVM IR (-O2):
define i32 @PerformInternalTest() {
ret i32 1
}
/* Variables and functions */
int Q_CountChar(const char *string, char tocount) {
  int count;
  for (count = 0; *string; string++) {
    if (*string == tocount)
      count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<Q_CountChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1154 <Q_CountChar+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <Q_CountChar+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1143 <Q_CountChar+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <Q_CountChar+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_CountChar>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <Q_CountChar+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <Q_CountChar+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Q_CountChar(i8* %0, i8 signext %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 = %21, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %13, %15
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %20
20: ; preds = %17, %10
br label %21
21: ; preds = %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
br label %6
24: ; preds = %6
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @Q_CountChar(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ ulong;
typedef int /*<<< orphan*/ uint;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ byte_swap_long(int /*<<< orphan*/ *, int /*<<< orphan*/);
void byte_swap_ulong(ulong *buffer, uint number_of_swaps) {
  byte_swap_long((int64_t *)buffer, number_of_swaps);
}


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

x86 assembly (clang, -O2):
<byte_swap_ulong>:
jmp    1030 <byte_swap_long@plt>

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

LLVM IR (-O2):
define void @byte_swap_ulong(i32* %0, i32 %1) {
%3 = tail call i32 @byte_swap_long(i32* %0, i32 %1)
ret void
}
int addDigits(int num) {
  while (num > 9) {
    int sum = 0;
    while (num > 0) {
      sum += num % 10;
      num /= 10;
    }
    num = sum;
  }
  return num;
}


x86 assembly (clang, -O0):
<addDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jle    1151 <addDigits+0x51>
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1146 <addDigits+0x46>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1118 <addDigits+0x18>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <addDigits+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addDigits>:
cmp    $0xa,%edi
jl     113e <addDigits+0x3e>
xor    %edx,%edx
mov    $0xcccccccd,%r8d
nopl   (%rax)
mov    %edi,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%eax
mov    %edi,%ecx
sub    %eax,%ecx
mov    %edx,%eax
add    %ecx,%eax
mov    %eax,%edx
cmp    $0xa,%edi
mov    %esi,%edi
jae    1110 <addDigits+0x10>
mov    $0x0,%edx
mov    %eax,%edi
cmp    $0xa,%eax
jae    1110 <addDigits+0x10>
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @addDigits(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %5, label %15
3: ; preds = %5
%4 = icmp ugt i32 %9, 9
br i1 %4, label %12, label %15
5: ; preds = %1, %12
%6 = phi i32 [ %13, %12 ], [ 0, %1 ]
%7 = phi i32 [ %14, %12 ], [ %0, %1 ]
%8 = urem i32 %7, 10
%9 = add nuw nsw i32 %6, %8
%10 = udiv i32 %7, 10
%11 = icmp ult i32 %7, 10
br i1 %11, label %3, label %12
12: ; preds = %5, %3
%13 = phi i32 [ %9, %5 ], [ 0, %3 ]
%14 = phi i32 [ %10, %5 ], [ %9, %3 ]
br label %5
15: ; preds = %3, %1
%16 = phi i32 [ %0, %1 ], [ %9, %3 ]
ret i32 %16
}
char *get_api_secret() { return "secret_key\0"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"secret_key\00\00"
define i8* @get_api_secret() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"secret_key\00\00"
define i8* @get_api_secret() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}