xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_move_current_quaddobl_to_next(int *cursor) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(456, cursor, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_move_current_quaddobl_to_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1c8,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_move_current_quaddobl_to_next>:
mov    %rdi,%rsi
mov    $0x1c8,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_move_current_quaddobl_to_next(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 456, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @solcon_move_current_quaddobl_to_next(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 456, i32* %0, i32* undef, double* undef)
ret i32 %2
}
/* Variables and functions */
int fabs(double);
double sumWeigtedInputs(int const, double const *, double const *);
double _softsign(const int numInputs, const double *inputs,
                 const double *connectionWeights) {
  double weightedInputSum;
  double out;
  weightedInputSum = sumWeigtedInputs(numInputs, inputs, connectionWeights);
  out = weightedInputSum / (1 + fabs(weightedInputSum));
  return out;
}


x86 assembly (clang, -O0):
<_softsign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sumWeigtedInputs@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <fabs@plt>
movsd  -0x30(%rbp),%xmm0
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_softsign>:
push   %rax
call   1030 <sumWeigtedInputs@plt>
movsd  %xmm0,(%rsp)
call   1040 <fabs@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @_softsign(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%9 = load i32, i32* %4
%10 = load double*, double** %5
%11 = load double*, double** %6
%12 = call double @sumWeigtedInputs(i32 %9, double* %10, double* %11)
store double %12, double* %7
%13 = load double, double* %7
%14 = load double, double* %7
%15 = call i32 @fabs(double %14)
%16 = add nsw i32 1, %15
%17 = sitofp i32 %16 to double
%18 = fdiv double %13, %17
store double %18, double* %8
%19 = load double, double* %8
ret double %19
}

LLVM IR (-O2):
define double @_softsign(i32 %0, double* %1, double* %2) {
%4 = tail call double @sumWeigtedInputs(i32 %0, double* %1, double* %2)
%5 = tail call i32 @fabs(double %4)
%6 = add nsw i32 %5, 1
%7 = sitofp i32 %6 to double
%8 = fdiv double %4, %7
ret double %8
}
void prepare_data(unsigned int data, unsigned char *tx_buff) {
  tx_buff[2] = (data >> 24) & 0xff;
  tx_buff[3] = (data >> 16) & 0xff;
  tx_buff[4] = (data >> 8) & 0xff;
  tx_buff[5] = (data >> 0) & 0xff;
}


x86 assembly (clang, -O0):
<prepare_data>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x4(%rbp),%eax
shr    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x5(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepare_data>:
bswap  %edi
mov    %edi,0x2(%rsi)
ret

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

LLVM IR (-O2):
define void @prepare_data(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 24
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %4, i8* %5
%6 = lshr i32 %0, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %7, i8* %8
%9 = lshr i32 %0, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %10, i8* %11
%12 = trunc i32 %0 to i8
%13 = getelementptr inbounds i8, i8* %1, i64 5
store i8 %12, i8* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned char, unsigned char);
void pnp_write_config(void) {
  unsigned char port;
  unsigned char value;
  unsigned char reg;
  port = 0x2e;
  value = 0x03;
  reg = 0x07;
  outb(reg, port);
  outb(value, port + 1);
  outb(value - 1, port + 2);
}


x86 assembly (clang, -O0):
<pnp_write_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x2e,-0x1(%rbp)
movb   $0x3,-0x2(%rbp)
movb   $0x7,-0x3(%rbp)
mov    -0x3(%rbp),%al
movzbl %al,%edi
movzbl -0x1(%rbp),%esi
call   1030 <outb@plt>
mov    -0x2(%rbp),%cl
movzbl -0x1(%rbp),%eax
add    $0x1,%eax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <outb@plt>
movzbl -0x2(%rbp),%eax
sub    $0x1,%eax
mov    %al,%cl
movzbl -0x1(%rbp),%eax
add    $0x2,%eax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnp_write_config>:
push   %rax
mov    $0x7,%edi
mov    $0x2e,%esi
call   1030 <outb@plt>
mov    $0x3,%edi
mov    $0x2f,%esi
call   1030 <outb@plt>
mov    $0x2,%edi
mov    $0x30,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @pnp_write_config() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
store i8 46, i8* %1
store i8 3, i8* %2
store i8 7, i8* %3
%4 = load i8, i8* %3
%5 = load i8, i8* %1
%6 = call i32 @outb(i8 zeroext %4, i8 zeroext %5)
%7 = load i8, i8* %2
%8 = load i8, i8* %1
%9 = zext i8 %8 to i32
%10 = add nsw i32 %9, 1
%11 = trunc i32 %10 to i8
%12 = call i32 @outb(i8 zeroext %7, i8 zeroext %11)
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = sub nsw i32 %14, 1
%16 = trunc i32 %15 to i8
%17 = load i8, i8* %1
%18 = zext i8 %17 to i32
%19 = add nsw i32 %18, 2
%20 = trunc i32 %19 to i8
%21 = call i32 @outb(i8 zeroext %16, i8 zeroext %20)
ret void
}

LLVM IR (-O2):
define void @pnp_write_config() {
%1 = tail call i32 @outb(i8 zeroext 7, i8 zeroext 46)
%2 = tail call i32 @outb(i8 zeroext 3, i8 zeroext 47)
%3 = tail call i32 @outb(i8 zeroext 2, i8 zeroext 48)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int NGROUPS;
int /*<<< orphan*/ getgroups(int, int /*<<< orphan*/ *);
int main() {
  gid_t gidset[NGROUPS];
  getgroups(NGROUPS, gidset);
  getgroups(-1, gidset);
  getgroups(NGROUPS, (gid_t *)-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x8(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,-0x18(%rbp)
mov    %rsi,%rsp
mov    %rax,-0x10(%rbp)
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1030 <getgroups@plt>
mov    -0x18(%rbp),%rsi
mov    $0xffffffff,%edi
call   1030 <getgroups@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    $0xffffffffffffffff,%rsi
call   1030 <getgroups@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
mov    %rsp,%rbx
lea    0xf(,%rdi,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rsi
call   1030 <getgroups@plt>
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1030 <getgroups@plt>
mov    (%r14),%edi
mov    $0xffffffffffffffff,%rsi
call   1030 <getgroups@plt>
xor    %eax,%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@NGROUPS = global i32 0
define i32 @main() {
%1 = alloca i8*
%2 = alloca i64
%3 = load i32, i32* @NGROUPS
%4 = zext i32 %3 to i64
%5 = call i8* @llvm.stacksave()
store i8* %5, i8** %1
%6 = alloca i32, i64 %4
store i64 %4, i64* %2
%7 = load i32, i32* @NGROUPS
%8 = call i32 @getgroups(i32 %7, i32* %6)
%9 = call i32 @getgroups(i32 -1, i32* %6)
%10 = load i32, i32* @NGROUPS
%11 = call i32 @getgroups(i32 %10, i32* inttoptr (i64 -1 to i32*))
%12 = load i8*, i8** %1
ret i32 0
}

LLVM IR (-O2):
@NGROUPS = global i32 0
define i32 @main() {
%1 = load i32, i32* @NGROUPS
%2 = zext i32 %1 to i64
%3 = alloca i32, i64 %2
%4 = call i32 @getgroups(i32 %1, i32* %3)
%5 = call i32 @getgroups(i32 -1, i32* %3)
%6 = load i32, i32* @NGROUPS
%7 = call i32 @getgroups(i32 %6, i32* inttoptr (i64 -1 to i32*))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ move(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
void clrscr(void) {
  clear();
  move(0, 0);
  refresh();
}


x86 assembly (clang, -O0):
<clrscr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clear@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <move@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrscr>:
push   %rax
xor    %eax,%eax
call   1040 <clear@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <move@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <refresh@plt>

LLVM IR (-O0):
define void @clrscr() {
%1 = call i32 (...) @clear()
%2 = call i32 @move(i32 0, i32 0)
%3 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @clrscr() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 @move(i32 0, i32 0)
%3 = tail call i32 (...) @refresh()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_srl_pi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_srl_pi32(__m64 a, __m64 b) { return _mm_srl_pi32(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_srl_pi32>:
jmp    1030 <_mm_srl_pi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srl_pi32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_srl_pi32(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int ax2om(double *, double *, int);
int om2eu(double *, double *, int);
int ax2eu(double *ax, double *eu, int p) {
  double om[9];
  int trash;
  trash = ax2om(ax, om, p);
  trash = om2eu(om, eu, p);
  return 1;
}


x86 assembly (clang, -O0):
<ax2eu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ax2om@plt>
mov    %eax,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <om2eu@plt>
mov    %eax,-0x64(%rbp)
mov    $0x1,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ax2eu>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rsp,%r15
mov    %r15,%rsi
call   1030 <ax2om@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <om2eu@plt>
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ax2eu(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca [9 x double]
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%11 = load i32, i32* %6
%12 = call i32 @ax2om(double* %9, double* %10, i32 %11)
store i32 %12, i32* %8
%13 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = call i32 @om2eu(double* %13, double* %14, i32 %15)
store i32 %16, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @ax2eu(double* %0, double* %1, i32 %2) {
%4 = alloca [9 x double]
%5 = bitcast [9 x double]* %4 to i8*
%6 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 0
%7 = call i32 @ax2om(double* %0, double* %6, i32 %2)
%8 = call i32 @om2eu(double* %6, double* %1, i32 %2)
ret i32 1
}
int lib1t22(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @lib1t22() {
ret i32 2
}

LLVM IR (-O2):
define i32 @lib1t22() {
ret i32 2
}
extern void test9() {}


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

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

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

LLVM IR (-O2):
define void @test9() {
ret void
}
int is_prime(long long n) {
  long long i;
  for (i = 2; i <= n / 2; i++) {
    if (n % i == 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jg     116c <is_prime+0x6c>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
cmp    $0x0,%rdx
jne    1156 <is_prime+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1173 <is_prime+0x73>
jmp    115b <is_prime+0x5b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <is_prime+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
xor    %eax,%eax
cmp    $0x4,%rdi
jl     1165 <is_prime+0x65>
mov    %rdi,%rax
shr    %rax
mov    $0x1,%ecx
sub    %rax,%rcx
mov    $0x2,%esi
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1140 <is_prime+0x40>
mov    %rdi,%rax
cqto
idiv   %rsi
test   %rdx,%rdx
jne    114b <is_prime+0x4b>
jmp    1160 <is_prime+0x60>
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
je     1160 <is_prime+0x60>
lea    (%rcx,%rsi,1),%rax
add    $0x1,%rax
add    $0x1,%rsi
cmp    $0x2,%rax
jne    1120 <is_prime+0x20>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i64 %0) {
%2 = icmp slt i64 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i64 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw nsw i64 %9, 1
%7 = icmp eq i64 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i64 [ %6, %5 ], [ 2, %3 ]
%10 = srem i64 %0, %9
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 0, %1 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
char *strrchr(char const *, char);
bool hasExtension(const char *filename, const char *extension) {
  const char *ext = strrchr(filename, '.');
  return (ext && !strcmp(ext, extension));
}


x86 assembly (clang, -O0):
<hasExtension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     116a <hasExtension+0x4a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasExtension>:
push   %rbx
mov    %rsi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1149 <hasExtension+0x29>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hasExtension(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 = call i8* @strrchr(i8* %6, i8 signext 46)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = call i32 @strcmp(i8* %11, i8* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br label %16
16: ; preds = %10, %2
%17 = phi i1 [ false, %2 ], [ %15, %10 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @hasExtension(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* %3, i8* dereferenceable(1) %1)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
char *getcwd(char **, int);
char getcwd_no_check_bad() {
  char buf[16];
  char *cwd = getcwd(&buf, 16);
  return cwd[0];
}


x86 assembly (clang, -O0):
<getcwd_no_check_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1030 <getcwd@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd_no_check_bad>:
sub    $0x18,%rsp
mov    %rsp,%rdi
mov    $0x10,%esi
call   1030 <getcwd@plt>
mov    (%rax),%al
add    $0x18,%rsp
ret

LLVM IR (-O0):
define signext i8 @getcwd_no_check_bad() {
%1 = alloca [16 x i8]
%2 = alloca i8*
%3 = bitcast [16 x i8]* %1 to i8**
%4 = call i8* @getcwd(i8** %3, i32 16)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @getcwd_no_check_bad() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = bitcast [16 x i8]* %1 to i8**
%4 = call i8* @getcwd(i8** %3, i32 16)
%5 = load i8, i8* %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ __stack_chk_fail();
void __stack_chk_fail_local(void) { __stack_chk_fail(); }


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

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

LLVM IR (-O0):
define void @__stack_chk_fail_local() {
%1 = call i32 (...) @__stack_chk_fail()
ret void
}

LLVM IR (-O2):
define void @__stack_chk_fail_local() {
%1 = tail call i32 (...) @__stack_chk_fail()
ret void
}
void ExttProfileNameAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttProfileNameAuxTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ft_memdel(void **ap) {
  if (ap == 0)
    return;
  free(*ap);
  *ap = 0;
}


x86 assembly (clang, -O0):
<ft_memdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <ft_memdel+0x1c>
jmp    1143 <ft_memdel+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memdel>:
test   %rdi,%rdi
je     1129 <ft_memdel+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_memdel(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp eq i8** %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = call i32 @free(i8* %8)
%10 = load i8**, i8*** %2
store i8* null, i8** %10
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @ft_memdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *const);
int /*<<< orphan*/ *strchr(char *const, char);
__attribute__((always_)) int shell_vulnerability(char *const a) {
  if (strchr(a, '`') != NULL) {
    printf("[Vulnerability]: broken string: [%s]"
           "\n",
           a);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<shell_vulnerability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x60,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1160 <shell_vulnerability+0x40>
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1167 <shell_vulnerability+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell_vulnerability>:
push   %rbx
mov    %rdi,%rbx
mov    $0x60,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1149 <shell_vulnerability+0x29>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"[Vulnerability]: broken string: [%s]\0A\00"
define i32 @shell_vulnerability(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32* @strchr(i8* %4, i8 signext 96)
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %8)
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [38 x i8] c"[Vulnerability]: broken string: [%s]\0A\00"
define i32 @shell_vulnerability(i8* %0) {
%2 = tail call i32* @strchr(i8* %0, i8 signext 96)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int strcmp(char *, char *);
int compare_string(void *str1, void *str2) {
  char *s1 = (char *)str1;
  char *s2 = (char *)str2;
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<compare_string>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compare_string(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M224_f(char *s) {
  debug("M224_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M224_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M224_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M224_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M224_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M224_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M224_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int flag = 0;
  int *p = &flag;
  char a[100];
  scanf("%s", a);
  printf(a);
  if (flag == 2000) {
    printf("good!\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x80(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <printf@plt>
cmpl   $0x7d0,-0x8(%rbp)
jne    1173 <main+0x53>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* %2)
ret i32 0
}
void deeper() {}


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

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

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

LLVM IR (-O2):
define void @deeper() {
ret void
}
/* Variables and functions */
scalar_t__ f(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, k = 0;
  for (i = 0; i < 255; i++) {
    k += f(i);
  }
  printf("Result: %d\n", k);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jge    116d <main+0x4d>
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <f@plt>
add    %eax,%ebx
add    $0x1,%ebp
cmp    $0xff,%ebp
jne    1130 <main+0x10>
lea    0xeb5(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"Result: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = tail call i64 @f(i32 %3)
%5 = trunc i64 %4 to i32
%6 = add i32 %2, %5
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 255
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
void gtk_widget_get_parent_window() {}


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

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

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

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

/* Type definitions */
struct TYPE_2__ {
  int xoffset;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_xoffset(void *_p, int _v) { ((XImage *)_p)->xoffset = (int)_v; }


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

x86 assembly (clang, -O2):
<set_XImage_xoffset>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XImage_xoffset(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void free_toklist(char **toklist, int len) {
  int i;
  for (i = 0; i < len; i++)
    free(toklist[i]);
  free(toklist);
}


x86 assembly (clang, -O0):
<free_toklist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_toklist+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_toklist+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_toklist>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_toklist+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_toklist+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_toklist(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eterm();
int /*<<< orphan*/ eterms();
void dterm() {
  eterm();
  eterms();
}


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

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

LLVM IR (-O0):
define void @dterm() {
%1 = call i32 (...) @eterm()
%2 = call i32 (...) @eterms()
ret void
}

LLVM IR (-O2):
define void @dterm() {
%1 = tail call i32 (...) @eterm()
%2 = tail call i32 (...) @eterms()
ret void
}
int fontrender_get_font_index(char *name) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @fontrender_get_font_index(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ multstore(int, int, long *);
int /*<<< orphan*/ printf(char *, long);
int main() {
  long d;
  multstore(2, 3, &d);
  printf("2 * 3 -->%ld\n", d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
lea    -0x10(%rbp),%rdx
call   1040 <multstore@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdx
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <multstore@plt>
mov    (%rsp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"2 * 3 -->%ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @multstore(i32 2, i32 3, i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ luaL_check_string(int);
int /*<<< orphan*/ lua_getglobal(int /*<<< orphan*/);
int /*<<< orphan*/ lua_pushobject(int /*<<< orphan*/);
void luaI_getglobal(void) {
  lua_pushobject(lua_getglobal(luaL_check_string(1)));
}


x86 assembly (clang, -O0):
<luaI_getglobal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_string@plt>
mov    %eax,%edi
call   1040 <lua_getglobal@plt>
mov    %eax,%edi
call   1050 <lua_pushobject@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaI_getglobal>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_string@plt>
mov    %eax,%edi
call   1040 <lua_getglobal@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <lua_pushobject@plt>

LLVM IR (-O0):
define void @luaI_getglobal() {
%1 = call i32 @luaL_check_string(i32 1)
%2 = call i32 @lua_getglobal(i32 %1)
%3 = call i32 @lua_pushobject(i32 %2)
ret void
}

LLVM IR (-O2):
define void @luaI_getglobal() {
%1 = tail call i32 @luaL_check_string(i32 1)
%2 = tail call i32 @lua_getglobal(i32 %1)
%3 = tail call i32 @lua_pushobject(i32 %2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int bbswap_16(int);
uint32_t bbswap_32(uint32_t x) {
  return (bbswap_16(x & 0xffff) << 16) | (bbswap_16(x >> 16));
}


x86 assembly (clang, -O0):
<bbswap_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
call   1030 <bbswap_16@plt>
shl    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
call   1030 <bbswap_16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbswap_32>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movzwl %bx,%edi
call   1030 <bbswap_16@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
sar    $0x10,%ebx
mov    %ebx,%edi
call   1030 <bbswap_16@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bbswap_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = call i32 @bbswap_16(i32 %4)
%6 = shl i32 %5, 16
%7 = load i32, i32* %2
%8 = ashr i32 %7, 16
%9 = call i32 @bbswap_16(i32 %8)
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @bbswap_32(i32 %0) {
%2 = and i32 %0, 65535
%3 = tail call i32 @bbswap_16(i32 %2)
%4 = shl i32 %3, 16
%5 = ashr i32 %0, 16
%6 = tail call i32 @bbswap_16(i32 %5)
%7 = or i32 %4, %6
ret i32 %7
}
void cfg80211_debugfs_drv_add(struct cfg80211_registered_device *drv) {}


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

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

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

LLVM IR (-O2):
%struct.cfg80211_registered_device = type opaque
define void @cfg80211_debugfs_drv_add(%struct.cfg80211_registered_device* nocapture %0) {
ret void
}
int *add(int *block, int n) {
  int i;
  for (i = 0; i < 64; i++) {
    if ((i - 1) % n == 0) {
      block[i] = (block[i] + 11) % 256;
    }
  }
  return block;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x40,-0x10(%rbp)
jge    1163 <add+0x63>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1150 <add+0x50>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0xb,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1155 <add+0x55>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <add+0x12>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
mov    %rdi,%r8
xor    %ecx,%ecx
jmp    111a <add+0x1a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rcx
cmp    $0x40,%rcx
je     1149 <add+0x49>
lea    -0x1(%rcx),%eax
cltd
idiv   %esi
test   %edx,%edx
jne    1110 <add+0x10>
mov    (%r8,%rcx,4),%eax
lea    0xb(%rax),%edx
lea    0x10a(%rax),%edi
test   %edx,%edx
cmovns %edx,%edi
and    $0xffffff00,%edi
neg    %edi
add    %edi,%eax
add    $0xb,%eax
mov    %eax,(%r8,%rcx,4)
jmp    1110 <add+0x10>
mov    %r8,%rax
ret

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

LLVM IR (-O2):
define i32* @add(i32* returned %0, i32 %1) {
br label %3
3: ; preds = %2, %14
%4 = phi i64 [ 0, %2 ], [ %15, %14 ]
%5 = trunc i64 %4 to i32
%6 = add i32 %5, -1
%7 = srem i32 %6, %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = getelementptr inbounds i32, i32* %0, i64 %4
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 11
%13 = srem i32 %12, 256
store i32 %13, i32* %10
br label %14
14: ; preds = %3, %9
%15 = add nuw nsw i64 %4, 1
%16 = icmp eq i64 %15, 64
br i1 %16, label %17, label %3
17: ; preds = %14
ret i32* %0
}
void foo34() {}


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

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

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

LLVM IR (-O2):
define void @foo34() {
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void CRYPTOIntDisable(uint32_t ui32IntFlags) {

  ;
  (*((volatile unsigned long *)(0x40024000 + 0x00000784))) &= ~ui32IntFlags;
}


x86 assembly (clang, -O0):
<CRYPTOIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x40024784,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x40024784,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTOIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
not    %rax
and    %rax,0x40024784
40
ret

LLVM IR (-O0):
define void @CRYPTOIntDisable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1073891204 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1073891204 to i64*)
ret void
}

LLVM IR (-O2):
define void @CRYPTOIntDisable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1073891204 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1073891204 to i64*)
ret void
}
void limits() {}


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

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

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

LLVM IR (-O2):
define void @limits() {
ret void
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
char eatLineComment() {
  char e;
  while ((e = getchar()) != EOF && e != '\n')
    ;
  if (e == '\n')
    putchar(e);
  return e;
}


x86 assembly (clang, -O0):
<eatLineComment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%ecx
mov    0x2eac(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     1159 <eatLineComment+0x39>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1169 <eatLineComment+0x49>
jmp    116e <eatLineComment+0x4e>
jmp    1128 <eatLineComment+0x8>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1184 <eatLineComment+0x64>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eatLineComment>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    $0xa,%al
je     1142 <eatLineComment+0x22>
cmp    (%r14),%bl
jne    1130 <eatLineComment+0x10>
cmp    $0xa,%bl
jne    1151 <eatLineComment+0x31>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
define signext i8 @eatLineComment() {
%1 = alloca i8
br label %2
2: ; preds = %14, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = sext i8 %3 to i32
%5 = load i8, i8* @EOF
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %4, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 10
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ false, %2 ], [ %11, %8 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %2
15: ; preds = %12
%16 = load i8, i8* %1
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 10
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i8, i8* %1
%21 = call i32 @putchar(i8 signext %20)
br label %22
22: ; preds = %19, %15
%23 = load i8, i8* %1
ret i8 %23
}

LLVM IR (-O2):
@EOF = global i8 0
define signext i8 @eatLineComment() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = load i8, i8* @EOF
%4 = icmp ne i8 %2, %3
%5 = icmp ne i8 %2, 10
%6 = and i1 %5, %4
br i1 %6, label %1, label %7
7: ; preds = %1
%8 = icmp eq i8 %2, 10
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @putchar(i8 signext 10)
br label %11
11: ; preds = %9, %7
ret i8 %2
}