xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ S_Reload();
void CL_Snd_Reload_f(void) { S_Reload(); }


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

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

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

LLVM IR (-O2):
define void @CL_Snd_Reload_f() {
%1 = tail call i32 (...) @S_Reload()
ret void
}
/* Variables and functions */
void test_retire(void *user_data) {
  if (user_data != NULL) {
    *((int *)user_data) *= -1;
  }
}


x86 assembly (clang, -O0):
<test_retire>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111c <test_retire+0x1c>
mov    -0x8(%rbp),%rax
imul   $0xffffffff,(%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_retire>:
test   %rdi,%rdi
je     1107 <test_retire+0x7>
negl   (%rdi)
ret

LLVM IR (-O0):
define void @test_retire(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 %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, -1
store i32 %9, i32* %7
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @test_retire(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = sub nsw i32 0, %5
store i32 %6, i32* %4
br label %7
7: ; preds = %3, %1
ret void
}
unsigned long int Log2Floor(unsigned long int Value) {
  unsigned long int val, bit = 0;
  do {
    bit++;
    val = 1 << bit;
  } while (val && Value > val);
  if (val != Value)
    bit--;
  return bit;
}


x86 assembly (clang, -O0):
<Log2Floor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x19(%rbp)
je     114d <Log2Floor+0x4d>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1110 <Log2Floor+0x10>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1172 <Log2Floor+0x72>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log2Floor>:
mov    $0xffffffffffffffff,%rdx
nopw   0x0(%rax,%rax,1)
lea    0x2(%rdx),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
add    $0x1,%rdx
cmp    %rdi,%rcx
jb     1110 <Log2Floor+0x10>
lea    0x1(%rdx),%rax
cmp    %rdi,%rcx
cmovne %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @Log2Floor(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %4, %2 ]
%4 = add i64 %3, 1
%5 = trunc i64 %4 to i32
%6 = shl nuw i32 1, %5
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, %0
br i1 %8, label %2, label %9
9: ; preds = %2
%10 = icmp eq i64 %7, %0
%11 = select i1 %10, i64 %4, i64 %3
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *const);
void _write_tabs(FILE *const file, const size_t tabs) {
  for (size_t i = 0; i < tabs; i++)
    fputs("\t", file);
}


x86 assembly (clang, -O0):
<_write_tabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1157 <_write_tabs+0x47>
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <_write_tabs+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write_tabs>:
push   %r14
push   %rbx
push   %rax
test   %rsi,%rsi
je     1133 <_write_tabs+0x23>
mov    %rsi,%rbx
mov    %rdi,%r14
nop
mov    $0x9,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <_write_tabs+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
define void @_write_tabs(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %13, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %11)
br label %13
13: ; preds = %10
%14 = load i64, i64* %5
%15 = add i64 %14, 1
store i64 %15, i64* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @_write_tabs(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @fputc(i32 9, i32* %0)
%8 = add nuw i64 %6, 1
%9 = icmp eq i64 %8, %1
br i1 %9, label %4, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_subs_pu16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_subs_pu16(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_subs_pu16@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_subs_pu16(i32 %0, i32 %1)
ret i32 %3
}
float Noise(int x, int y) {
  long n;
  n = x + y * 57;
  n = (n << 13) ^ n;
  return (1.0 - ((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) /
                    1073741824.0);
}


x86 assembly (clang, -O0):
<Noise>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x39,-0x8(%rbp),%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0xd,%rax
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   -0x10(%rbp),%rcx
imul   $0x3d73,%rcx,%rcx
add    $0xc0ae5,%rcx
imul   %rcx,%rax
add    $0x5208dd0d,%rax
and    $0x7fffffff,%rax
cvtsi2sd %rax,%xmm1
movsd  0xea7(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe93(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Noise>:
imul   $0x39,%esi,%eax
add    %edi,%eax
mov    %eax,%ecx
shl    $0xd,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
imul   %ecx,%eax
imul   $0x3d73,%eax,%eax
add    $0xc0ae5,%eax
imul   %ecx,%eax
add    $0x5208dd0d,%eax
and    $0x7fffffff,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  0xecb(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @Noise(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 57
%9 = add nsw i32 %6, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = shl i64 %11, 13
%13 = load i64, i64* %5
%14 = xor i64 %12, %13
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = load i64, i64* %5
%17 = load i64, i64* %5
%18 = mul nsw i64 %16, %17
%19 = mul nsw i64 %18, 15731
%20 = add nsw i64 %19, 789221
%21 = mul nsw i64 %15, %20
%22 = add nsw i64 %21, 1376312589
%23 = and i64 %22, 2147483647
%24 = sitofp i64 %23 to double
%25 = fdiv double %24, 0x41D0000000000000
%26 = fsub double 1.000000e+00, %25
%27 = fptrunc double %26 to float
ret float %27
}

LLVM IR (-O2):
define float @Noise(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 57
%4 = add nsw i32 %3, %0
%5 = sext i32 %4 to i64
%6 = shl nsw i64 %5, 13
%7 = xor i64 %6, %5
%8 = mul nsw i64 %7, 15731
%9 = mul i64 %8, %7
%10 = add nuw nsw i64 %9, 789221
%11 = mul nsw i64 %10, %7
%12 = add nsw i64 %11, 1376312589
%13 = and i64 %12, 2147483647
%14 = sitofp i64 %13 to double
%15 = fmul double %14, 0x3E10000000000000
%16 = fsub double 1.000000e+00, %15
%17 = fptrunc double %16 to float
ret float %17
}
double som(double a) {
  if (a > 0)
    return a + som(a - 1);
  else
    return 0;
}


x86 assembly (clang, -O0):
<som>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1165 <som+0x55>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <som@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116d <som+0x5d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<som>:
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jbe    113e <som+0x2e>
push   %rax
movsd  0xed9(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <som@plt>
addsd  (%rsp),%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define double @som(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fsub double %8, 1.000000e+00
%10 = call double @som(double %9)
%11 = fadd double %7, %10
store double %11, double* %2
br label %13
12: ; preds = %1
store double 0.000000e+00, double* %2
br label %13
13: ; preds = %12, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @som(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1, %5
%4 = phi double [ %8, %5 ], [ 0.000000e+00, %1 ]
ret double %4
5: ; preds = %1
%6 = fadd double %0, -1.000000e+00
%7 = tail call double @som(double %6)
%8 = fadd double %7, %0
br label %3
}
/* Variables and functions */
void *_malloc(size_t);
void *malloc(size_t size) { return _malloc(size); }


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

x86 assembly (clang, -O2):
<malloc>:
jmp    1030 <_malloc@plt>

LLVM IR (-O0):
define i8* @malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @_malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @malloc(i64 %0) {
%2 = tail call i8* @_malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
int /*<<< orphan*/ mbrtowc(int /*<<< orphan*/ *, char const *, size_t,
                           int /*<<< orphan*/ *);
void uninivar_mbrtowc(void) {
  wchar_t *pwc;
  const char *pmb;
  size_t max;
  mbstate_t *ps;
  (void)mbrtowc(pwc, pmb, max, ps);
}


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

x86 assembly (clang, -O2):
<uninivar_mbrtowc>:
jmp    1030 <mbrtowc@plt>

LLVM IR (-O0):
define void @uninivar_mbrtowc() {
%1 = alloca i32*
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32*
%5 = load i32*, i32** %1
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = load i32*, i32** %4
%9 = call i32 @mbrtowc(i32* %5, i8* %6, i64 %7, i32* %8)
ret void
}

LLVM IR (-O2):
define void @uninivar_mbrtowc() {
%1 = tail call i32 @mbrtowc(i32* undef, i8* undef, i64 undef, i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *, int);
int /*<<< orphan*/ hexdump(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ uart16550_init(int, int);
void main(void) {
  uart16550_init((115200 / 115200), 0x3 | 0 | 0x0);
  while (1) {
    char buf[16] = "";
    puts("\e[31mr3k.vhdl%\e[0m ");
    gets(buf, sizeof buf);
    puts("You wrote: \n");
    hexdump(buf, sizeof buf);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x3,%esi
call   1070 <uart16550_init@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    0xe82(%rip),%rdi
call   1030 <puts@plt>
lea    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1050 <gets@plt>
lea    0xe7c(%rip),%rdi
call   1030 <puts@plt>
lea    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1060 <hexdump@plt>
jmp    1167 <main+0x17>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x3,%esi
call   1060 <uart16550_init@plt>
lea    0xeb1(%rip),%r14
mov    %rsp,%rbx
lea    0xebb(%rip),%r15
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <gets@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1050 <hexdump@plt>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@.str = [20 x i8] c"\1B[31mr3k.vhdl%\1B[0m \00"
@.str.1 = [13 x i8] c"You wrote: \0A\00"
define void @main() {
%1 = alloca [16 x i8]
%2 = call i32 @uart16550_init(i32 1, i32 3)
br label %3
3: ; preds = %0, %3
%4 = bitcast [16 x i8]* %1 to i8*
%5 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%7 = call i32 @gets(i8* %6, i32 16)
%8 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%10 = call i32 @hexdump(i8* %9, i32 16)
br label %3
}

LLVM IR (-O2):
@.str = [20 x i8] c"\1B[31mr3k.vhdl%\1B[0m \00"
@.str.1 = [13 x i8] c"You wrote: \0A\00"
define void @main() {
%1 = alloca [16 x i8]
%2 = tail call i32 @uart16550_init(i32 1, i32 3)
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
br label %4
4: ; preds = %0, %4
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @gets(i8* %3, i32 16)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @hexdump(i8* %3, i32 16)
br label %4
}
int isNthBitSet(unsigned char c, int n) {
  static unsigned char mask[] = {1, 2, 4, 8, 16, 32, 63, 128};
  return ((c & mask[n]) != 0);
}


x86 assembly (clang, -O0):
<isNthBitSet>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
movslq -0x8(%rbp),%rdx
lea    0x2f04(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNthBitSet>:
movslq %esi,%rcx
lea    0xef6(%rip),%rdx
xor    %eax,%eax
test   %dil,(%rcx,%rdx,1)
setne  %al
ret

LLVM IR (-O0):
@isNthBitSet.mask = internal global [8 x i8] c"\01\02\04\08\10 ?\80"
define i32 @isNthBitSet(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [8 x i8], [8 x i8]* @isNthBitSet.mask, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %6, %11
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@isNthBitSet.mask = internal unnamed_addr constant [8 x i8] c"\01\02\04\08\10 ?\80"
define i32 @isNthBitSet(i8 zeroext %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [8 x i8], [8 x i8]* @isNthBitSet.mask, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = and i8 %5, %0
%7 = icmp ne i8 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
int func1(int var, __attribute__((unused)) int test) {
  int t;
  t = sizeof(var);
  return (t);
}


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

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

LLVM IR (-O0):
define i32 @func1(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 4, i32* %5
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @func1(i32 %0, i32 %1) {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ calc_disc(double, double, double);
double sqrt(int /*<<< orphan*/);
double calc_2root1(double a, double b, double c) {
  double root1;
  root1 = (-b + sqrt(calc_disc(a, b, c))) / (2 * a);
  return root1;
}


x86 assembly (clang, -O0):
<calc_2root1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <calc_disc@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_2root1>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <calc_disc@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
subsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @calc_2root1(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %5
%9 = fneg double %8
%10 = load double, double* %4
%11 = load double, double* %5
%12 = load double, double* %6
%13 = call i32 @calc_disc(double %10, double %11, double %12)
%14 = call double @sqrt(i32 %13)
%15 = fadd double %9, %14
%16 = load double, double* %4
%17 = fmul double 2.000000e+00, %16
%18 = fdiv double %15, %17
store double %18, double* %7
%19 = load double, double* %7
ret double %19
}

LLVM IR (-O2):
define double @calc_2root1(double %0, double %1, double %2) {
%4 = tail call i32 @calc_disc(double %0, double %1, double %2)
%5 = tail call double @sqrt(i32 %4)
%6 = fsub double %5, %1
%7 = fmul double %0, 2.000000e+00
%8 = fdiv double %6, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ ActuatorCommandHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void ActuatorCommandRequestUpdate() {
  UAVObjRequestUpdate(ActuatorCommandHandle());
}


x86 assembly (clang, -O0):
<ActuatorCommandRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ActuatorCommandHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ActuatorCommandRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1040 <ActuatorCommandHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @ActuatorCommandRequestUpdate() {
%1 = call i32 (...) @ActuatorCommandHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ActuatorCommandRequestUpdate() {
%1 = tail call i32 (...) @ActuatorCommandHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256;

/* Variables and functions */
__m256 _avx_neg(__m256 x) { return -x; }


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

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

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

LLVM IR (-O2):
define i32 @_avx_neg(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
int GenInitParams(int argc, char **argv, int *idx) {
  (void)argc;
  (void)argv;
  (void)idx;
  return 0;
}


x86 assembly (clang, -O0):
<GenInitParams>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @GenInitParams(i32 %0, i8** nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fetch();
void discard(void) { fetch(); }


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

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

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

LLVM IR (-O2):
define void @discard() {
%1 = tail call i32 (...) @fetch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_GREEN_LED_PIN() { clear_io_bit(0x34, 1); }


x86 assembly (clang, -O0):
<TOSH_CLR_GREEN_LED_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
mov    $0x1,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_GREEN_LED_PIN>:
mov    $0x34,%edi
mov    $0x1,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_GREEN_LED_PIN() {
%1 = call i32 @clear_io_bit(i32 52, i32 1)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_GREEN_LED_PIN() {
%1 = tail call i32 @clear_io_bit(i32 52, i32 1)
ret void
}
/* Type definitions */
struct sock_fprog {
  int dummy;
};
struct sk_filter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ show_error_and_die(char *);
scalar_t__ sk_unattached_filter_create(struct sk_filter **,
                                       struct sock_fprog *);
struct sk_filter *compile_filter(struct sock_fprog *program) {
  struct sk_filter *ret = NULL;
  if (sk_unattached_filter_create(&ret, program))
    show_error_and_die("compile_jit_filter: bpf: check failed: parse error");
  return ret;
}


x86 assembly (clang, -O0):
<compile_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   1030 <sk_unattached_filter_create@plt>
cmp    $0x0,%rax
je     1157 <compile_filter+0x37>
lea    0xeae(%rip),%rdi
call   1040 <show_error_and_die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compile_filter>:
push   %rax
mov    %rdi,%rsi
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <sk_unattached_filter_create@plt>
test   %rax,%rax
je     1145 <compile_filter+0x25>
lea    0xec0(%rip),%rdi
call   1040 <show_error_and_die@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sk_filter = type { i32 }
%struct.sock_fprog = type { i32 }
@.str = [51 x i8] c"compile_jit_filter: bpf: check failed: parse error\00"
define %struct.sk_filter* @compile_filter(%struct.sock_fprog* %0) {
%2 = alloca %struct.sock_fprog*
%3 = alloca %struct.sk_filter*
store %struct.sock_fprog* %0, %struct.sock_fprog** %2
store %struct.sk_filter* null, %struct.sk_filter** %3
%4 = load %struct.sock_fprog*, %struct.sock_fprog** %2
%5 = call i64 @sk_unattached_filter_create(%struct.sk_filter** %3, %struct.sock_fprog* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @show_error_and_die(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load %struct.sk_filter*, %struct.sk_filter** %3
ret %struct.sk_filter* %10
}

LLVM IR (-O2):
%struct.sk_filter = type { i32 }
%struct.sock_fprog = type { i32 }
@.str = [51 x i8] c"compile_jit_filter: bpf: check failed: parse error\00"
define %struct.sk_filter* @compile_filter(%struct.sock_fprog* %0) {
%2 = alloca %struct.sk_filter*
%3 = bitcast %struct.sk_filter** %2 to i8*
store %struct.sk_filter* null, %struct.sk_filter** %2
%4 = call i64 @sk_unattached_filter_create(%struct.sk_filter** %2, %struct.sock_fprog* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @show_error_and_die(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load %struct.sk_filter*, %struct.sk_filter** %2
ret %struct.sk_filter* %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void blueLEDOn(void) { (*((volatile uint32_t *)0x40025010)) |= 0x04; }


x86 assembly (clang, -O0):
<blueLEDOn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40025010,%eax
mov    (%rax),%ecx
or     $0x4,%ecx
mov    $0x40025010,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<blueLEDOn>:
orl    $0x4,0x40025010
04
ret

LLVM IR (-O0):
define void @blueLEDOn() {
%1 = load volatile i32, i32* inttoptr (i64 1073893392 to i32*)
%2 = or i32 %1, 4
store volatile i32 %2, i32* inttoptr (i64 1073893392 to i32*)
ret void
}

LLVM IR (-O2):
define void @blueLEDOn() {
%1 = load volatile i32, i32* inttoptr (i64 1073893392 to i32*)
%2 = or i32 %1, 4
store volatile i32 %2, i32* inttoptr (i64 1073893392 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mintaka_merge();
void mintaka_merge_() { mintaka_merge(); }


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

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

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

LLVM IR (-O2):
define void @mintaka_merge_() {
%1 = tail call i32 (...) @mintaka_merge()
ret void
}
unsigned xrop3_146_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = D | T;
  stk3 = S & stk4;
  stk2 = T ^ stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_146_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_146_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = or i32 %24, %25
store i32 %26, i32* %11
%27 = load i32, i32* %6
%28 = load i32, i32* %11
%29 = and i32 %27, %28
store i32 %29, i32* %10
%30 = load i32, i32* %7
%31 = load i32, i32* %10
%32 = xor i32 %30, %31
store i32 %32, i32* %9
%33 = load i32, i32* %5
%34 = load i32, i32* %9
%35 = xor i32 %33, %34
store i32 %35, i32* %8
%36 = load i32, i32* %8
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %7
%41 = xor i32 %40, -1
%42 = and i32 %39, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %6
%45 = and i32 %43, %44
%46 = or i32 %42, %45
%47 = load i32, i32* %5
%48 = load i32, i32* %7
%49 = and i32 %47, %48
%50 = or i32 %46, %49
ret i32 %50
}

LLVM IR (-O2):
define i32 @xrop3_146_1_1(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
float test_remainderf(float x, float y) { return __builtin_remainderf(x, y); }


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

x86 assembly (clang, -O2):
<test_remainderf>:
jmp    1030 <remainderf@plt>

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

LLVM IR (-O2):
define float @test_remainderf(float %0, float %1) {
%3 = tail call float @remainderf(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ ptable_list();
int builtin_jobs(int argc, char **argv) {
  ((void)(argc));
  ((void)(argv));
  ptable_list();
  return 0;
}


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

x86 assembly (clang, -O2):
<builtin_jobs>:
push   %rax
xor    %eax,%eax
call   1030 <ptable_list@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @builtin_jobs(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ptable_list()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ PBKDF2PARAM;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ PBKDF2PARAM_it;
void PBKDF2PARAM_free(PBKDF2PARAM *a) {
  ASN1_item_free((ASN1_VALUE *)a, &PBKDF2PARAM_it);
}


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

x86 assembly (clang, -O2):
<PBKDF2PARAM_free>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@PBKDF2PARAM_it = global i32 0
define void @PBKDF2PARAM_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @PBKDF2PARAM_it)
ret void
}

LLVM IR (-O2):
@PBKDF2PARAM_it = global i32 0
define void @PBKDF2PARAM_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @PBKDF2PARAM_it)
ret void
}
int position(const char *string, char ch) {
  int i;
  if (string)
    for (i = 1; *string; string++, i++) {
      if (*string == ch)
        return (i);
    }
  return (-1);
}


x86 assembly (clang, -O0):
<position>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116f <position+0x6f>
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116a <position+0x6a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114b <position+0x4b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <position+0x76>
jmp    1150 <position+0x50>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1120 <position+0x20>
jmp    116f <position+0x6f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<position>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     1131 <position+0x31>
mov    (%rdi),%dl
test   %dl,%dl
je     1131 <position+0x31>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %sil,%dl
je     1132 <position+0x32>
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <position+0x20>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @position(i8* %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %4, %12
%8 = phi i8 [ %15, %12 ], [ %5, %4 ]
%9 = phi i32 [ %14, %12 ], [ 1, %4 ]
%10 = phi i8* [ %13, %12 ], [ %0, %4 ]
%11 = icmp eq i8 %8, %1
br i1 %11, label %17, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = add nuw nsw i32 %9, 1
%15 = load i8, i8* %13
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %12, %4, %2
%18 = phi i32 [ -1, %2 ], [ -1, %4 ], [ %9, %7 ], [ -1, %12 ]
ret i32 %18
}
int test_imm_D4uint32_reg(unsigned int val) {
  return ((val) & (0xD4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D4uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xd4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D4uint32_reg(i32 %0) {
%2 = and i32 %0, 212
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void init_array(int *a) {
  a[0] = 4;
  a[1] = 2;
  a[2] = 5;
  a[3] = 1;
  a[4] = 3;
}


x86 assembly (clang, -O0):
<init_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x5,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_array>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movl   $0x3,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @init_array(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 4, i32 2, i32 5, i32 1>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 3, i32* %3
ret void
}
unsigned long long baddu4(unsigned long long a, unsigned long long b) {
  unsigned long long c = (unsigned char)(a + b);
  return c + 1;
}


x86 assembly (clang, -O0):
<baddu4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
movzbl %al,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baddu4>:
add    %edi,%esi
movzbl %sil,%eax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @baddu4(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = and i64 %3, 255
%5 = add nuw nsw i64 %4, 1
ret i64 %5
}
int test_imm_1Cint64_midword_reg(long long val) {
  return ((val >> 16) & (0x1C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Cint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x1c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Cint64_midword_reg>:
test   $0x1c0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Cint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 28
%6 = icmp ne i64 %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_1Cint64_midword_reg(i64 %0) {
%2 = and i64 %0, 1835008
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct CMD {
  int dummy;
};

/* Variables and functions */
int creer_lien(char *, char *);
int /*<<< orphan*/ perreur(char *);
int /*<<< orphan*/ scanf(char *, char *, char *);
void ln(struct CMD *c) {
  char nouveau_lien[300], cible[300];
  scanf("%s%s", cible, nouveau_lien);
  if (creer_lien(nouveau_lien, cible) == -1)
    perreur("creer_lien()");
}


x86 assembly (clang, -O0):
<ln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x270(%rbp),%rsi
lea    -0x140(%rbp),%rdx
lea    0xeac(%rip),%rdi
call   1030 <scanf@plt>
lea    -0x140(%rbp),%rdi
lea    -0x270(%rbp),%rsi
call   1040 <creer_lien@plt>
cmp    $0xffffffff,%eax
jne    1181 <ln+0x51>
lea    0xe89(%rip),%rdi
call   1050 <perreur@plt>
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln>:
push   %r14
push   %rbx
sub    $0x268,%rsp
lea    0xebf(%rip),%rdi
mov    %rsp,%r14
lea    0x130(%rsp),%rbx
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <creer_lien@plt>
cmp    $0xffffffff,%eax
jne    1173 <ln+0x43>
lea    0xe97(%rip),%rdi
call   1050 <perreur@plt>
add    $0x268,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.CMD = type { i32 }
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [13 x i8] c"creer_lien()\00"
define void @ln(%struct.CMD* %0) {
%2 = alloca %struct.CMD*
%3 = alloca [300 x i8]
%4 = alloca [300 x i8]
store %struct.CMD* %0, %struct.CMD** %2
%5 = getelementptr inbounds [300 x i8], [300 x i8]* %4, i64 0, i64 0
%6 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [300 x i8], [300 x i8]* %4, i64 0, i64 0
%10 = call i32 @creer_lien(i8* %8, i8* %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 @perreur(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
%struct.CMD = type { i32 }
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [13 x i8] c"creer_lien()\00"
define void @ln(%struct.CMD* nocapture readnone %0) {
%2 = alloca [300 x i8]
%3 = alloca [300 x i8]
%4 = getelementptr inbounds [300 x i8], [300 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %4)
%7 = call i32 @creer_lien(i8* %4, i8* %5)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perreur(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
int command_version(int argc, char *argv[]) {
  fprintf(
      stdout,
      "%s (SimpleECDSA) %s\nCopyright (C) 2007 Jonas F. Jensen.\nThis is free "
      "software. You may redistribute copies of it under the terms of\nthe GNU "
      "General Public License <http://www.gnu.org/licenses/gpl.html>.\nThere "
      "is NO WARRANTY, to the extent permitted by law.\n\nWritten by Jonas F. "
      "Jensen <Jopsen@gmail.com>.\n",
      argv[0], "1.0.0");
  return 0;
}


x86 assembly (clang, -O0):
<command_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeca(%rip),%rsi
lea    0xff5(%rip),%rcx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_version>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xedc(%rip),%rsi
lea    0x1007(%rip),%rcx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [306 x i8] c"%s (SimpleECDSA) %s\0ACopyright (C) 2007 Jonas F. Jensen.\0AThis is free software. You may redistribute copies of it under the terms of\0Athe GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\0AWritten by Jonas F. Jensen <Jopsen@gmail.com>.\0A\00"
@.str.1 = [6 x i8] c"1.0.0\00"
define i32 @command_version(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stdout
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([306 x i8], [306 x i8]* @.str, i64 0, i64 0), i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [306 x i8] c"%s (SimpleECDSA) %s\0ACopyright (C) 2007 Jonas F. Jensen.\0AThis is free software. You may redistribute copies of it under the terms of\0Athe GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\0AWritten by Jonas F. Jensen <Jopsen@gmail.com>.\0A\00"
@.str.1 = [6 x i8] c"1.0.0\00"
define i32 @command_version(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([306 x i8], [306 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int bitwise_rshift(int x, int y) { return x >> y; }


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

x86 assembly (clang, -O2):
<bitwise_rshift>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @bitwise_rshift(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
/* Variables and functions */
scalar_t__ ft_isalpha(int);
scalar_t__ ft_isdigit(int);
int ft_isalnum(int c) {
  int res;
  res = 1;
  if (ft_isalpha(c) || ft_isdigit(c))
    return (res);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <ft_isalpha@plt>
cmp    $0x0,%rax
jne    1156 <ft_isalnum+0x36>
mov    -0x8(%rbp),%edi
call   1030 <ft_isdigit@plt>
cmp    $0x0,%rax
je     1161 <ft_isalnum+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <ft_isalnum+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <ft_isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <ft_isalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <ft_isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_isalnum(i32 %0) {
%2 = tail call i64 @ft_isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ft_isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}