xunge/DecIR huggingface dataset:
/* Type definitions */
struct ac_buffer {
  int dummy;
};

/* Variables and functions */
int _buffer_read(struct ac_buffer *, char *, int);
int buffer_read_char(struct ac_buffer *buffer, char *value) {
  return _buffer_read(buffer, value, sizeof(char));
}


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

x86 assembly (clang, -O2):
<buffer_read_char>:
mov    $0x1,%edx
jmp    1030 <_buffer_read@plt>

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

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define i32 @buffer_read_char(%struct.ac_buffer* %0, i8* %1) {
%3 = tail call i32 @_buffer_read(%struct.ac_buffer* %0, i8* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int globMatch(char *, char *, char, char);
int sqlMatchLike(char *wildCard, char *string) {
  return globMatch(wildCard, string, '_', '%');
}


x86 assembly (clang, -O0):
<sqlMatchLike>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5f,%edx
mov    $0x25,%ecx
call   1030 <globMatch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlMatchLike>:
mov    $0x5f,%edx
mov    $0x25,%ecx
jmp    1030 <globMatch@plt>

LLVM IR (-O0):
define i32 @sqlMatchLike(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @globMatch(i8* %5, i8* %6, i8 signext 95, i8 signext 37)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sqlMatchLike(i8* %0, i8* %1) {
%3 = tail call i32 @globMatch(i8* %0, i8* %1, i8 signext 95, i8 signext 37)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpunord_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpunord_pd(__m128d __a, __m128d __b) {
  return _mm_cmpunord_pd(__a, __b);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpunord_pd>:
jmp    1030 <_mm_cmpunord_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpunord_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpunord_pd(i32 %0, i32 %1)
ret i32 %3
}
int f() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 1
}
unsigned short int foo5(int x) { return x; }


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

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

LLVM IR (-O0):
define zeroext i16 @foo5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @foo5(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int i;
  for (i = 1; i <= 100; i++) {
    printf("%3d ", i);
    if (i % 10 == 0)
      printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1176 <main+0x66>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1163 <main+0x53>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1168 <main+0x58>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xecd(%rip),%r14
jmp    1148 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
cmp    $0x65,%ebx
je     117b <main+0x5b>
movzbl %bl,%r15d
imul   $0xcd,%r15d,%eax
shr    $0xa,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,4),%ebp
neg    %ebp
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    %bpl,%r15b
jne    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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


x86 assembly (clang, -O0):
<jumper>:
push   %rbp
mov    %rsp,%rbp
call   fffffffffffffffc <completed.0+0xffffffffffffbfdc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jumper>:
call   fffffffffffffffc <completed.0+0xffffffffffffbfdc>
ret

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

LLVM IR (-O2):
define void @jumper() {
tail call void asm sideeffect "call -4", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void UI_create_method(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_create_method() {
ret void
}
int ands_si_test1(int a, int b, int c) {
  int d = a & b;
  if (d == 0)
    return a + c;
  else
    return d;
}


x86 assembly (clang, -O0):
<ands_si_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    112e <ands_si_test1+0x2e>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <ands_si_test1+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ands_si_test1>:
and    %edi,%esi
lea    (%rdx,%rdi,1),%eax
test   %esi,%esi
cmovne %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @ands_si_test1(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = icmp eq i32 %4, 0
%6 = add nsw i32 %2, %0
%7 = select i1 %5, i32 %6, i32 %4
ret i32 %7
}
float kmRadiansToDegrees(float radians) { return radians * 57.295779f; }


x86 assembly (clang, -O0):
<kmRadiansToDegrees>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmRadiansToDegrees>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @kmRadiansToDegrees(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x404CA5DC20000000
ret float %4
}

LLVM IR (-O2):
define float @kmRadiansToDegrees(float %0) {
%2 = fmul float %0, 0x404CA5DC20000000
ret float %2
}
cbuf13(f, n) int f, n;
{ cbuf(f, n, 13); }


x86 assembly (clang, -O0):
<cbuf13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0xd,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf13>:
mov    $0xd,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf13(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 13)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf13(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 13)
ret i32 undef
}
int stun_msg2type(int class, int method) {
  return ((class & 1) << 4) | ((class & 2) << 7) | (method & 0x000f) |
         ((method & 0x0070) << 1) | ((method & 0x0f800) << 2);
}


x86 assembly (clang, -O0):
<stun_msg2type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0x2,%ecx
shl    $0x7,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0x70,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xf800,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stun_msg2type>:
mov    %edi,%eax
shl    $0x4,%eax
and    $0x10,%eax
and    $0x2,%edi
shl    $0x7,%edi
or     %eax,%edi
mov    %esi,%eax
and    $0xf,%eax
or     %edi,%eax
mov    %esi,%ecx
and    $0x70,%ecx
lea    (%rax,%rcx,2),%eax
and    $0xf800,%esi
lea    (%rax,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @stun_msg2type(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 = and i32 %5, 1
%7 = shl i32 %6, 4
%8 = load i32, i32* %3
%9 = and i32 %8, 2
%10 = shl i32 %9, 7
%11 = or i32 %7, %10
%12 = load i32, i32* %4
%13 = and i32 %12, 15
%14 = or i32 %11, %13
%15 = load i32, i32* %4
%16 = and i32 %15, 112
%17 = shl i32 %16, 1
%18 = or i32 %14, %17
%19 = load i32, i32* %4
%20 = and i32 %19, 63488
%21 = shl i32 %20, 2
%22 = or i32 %18, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @stun_msg2type(i32 %0, i32 %1) {
%3 = shl i32 %0, 4
%4 = and i32 %3, 16
%5 = shl i32 %0, 7
%6 = and i32 %5, 256
%7 = or i32 %4, %6
%8 = and i32 %1, 15
%9 = or i32 %7, %8
%10 = shl i32 %1, 1
%11 = and i32 %10, 224
%12 = or i32 %9, %11
%13 = shl i32 %1, 2
%14 = and i32 %13, 253952
%15 = or i32 %12, %14
ret i32 %15
}
int test_imm_62uint8_reg(unsigned char val) {
  return ((val) & (-0x62 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_62uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -98
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void yy_1_ParagraphTextMore(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_1_ParagraphTextMore(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @yy_1_ParagraphTextMore(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
scalar_t__ _getReg(int);
float getTemp() {
  int16_t ret;
  ret = _getReg(0x00);
  return (float)ret / 256.;
}


x86 assembly (clang, -O0):
<getTemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <_getReg@plt>
mov    %rax,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecb(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTemp>:
push   %rax
xor    %edi,%edi
call   1030 <_getReg@plt>
cvtsi2ss %rax,%xmm0
mulss  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @getTemp() {
%1 = alloca i64
%2 = call i64 @_getReg(i32 0)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = sitofp i64 %3 to float
%5 = fpext float %4 to double
%6 = fdiv double %5, 2.560000e+02
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @getTemp() {
%1 = tail call i64 @_getReg(i32 0)
%2 = sitofp i64 %1 to float
%3 = fmul float %2, 3.906250e-03
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_get_read_index() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_get_read_index"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [44 x i8] c"NOT IMPLEMENTED:pa_memblockq_get_read_index\00"
define i32 @pa_memblockq_get_read_index() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int twice(int x) { return 2 * x; }


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

x86 assembly (clang, -O2):
<twice>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @twice(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
struct passwd *getpwent();
int main(void) {
  struct passwd *pw;
  pw = getpwent();
  if (pw)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpwent@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1141 <main+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1148 <main+0x38>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpwent@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.passwd*
store i32 0, i32* %1
%3 = call %struct.passwd* (...) @getpwent()
store %struct.passwd* %3, %struct.passwd** %2
%4 = load %struct.passwd*, %struct.passwd** %2
%5 = icmp ne %struct.passwd* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %8
7: ; preds = %0
store i32 1, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i32 @main() {
%1 = tail call %struct.passwd* (...) @getpwent()
%2 = icmp eq %struct.passwd* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}
void foo661(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo661(i32 %0) {
ret void
}
int lower(int c) { return c >= 'A' && c <= 'Z' ? (c + 'a' - 'A') : c; }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112c <lower+0x2c>
cmpl   $0x5a,-0x4(%rbp)
jg     112c <lower+0x2c>
mov    -0x4(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <lower+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @lower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 97
%11 = sub nsw i32 %10, 65
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ drv_FW8888_send_cmd(int);
void __attribute__((unused)) drv_FW8888_display_on_cursor_off(void) {
  drv_FW8888_send_cmd(0x0C);
}


x86 assembly (clang, -O0):
<drv_FW8888_display_on_cursor_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
call   1030 <drv_FW8888_send_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_FW8888_display_on_cursor_off>:
mov    $0xc,%edi
jmp    1030 <drv_FW8888_send_cmd@plt>

LLVM IR (-O0):
define void @drv_FW8888_display_on_cursor_off() {
%1 = call i32 @drv_FW8888_send_cmd(i32 12)
ret void
}

LLVM IR (-O2):
define void @drv_FW8888_display_on_cursor_off() {
%1 = tail call i32 @drv_FW8888_send_cmd(i32 12)
ret void
}
/* Variables and functions */
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ str_rev(char *, char *);
bool is_palindrome(int num) {
  char buff[20];
  char buff2[20];
  sprintf(buff, "%d", num);
  return num == atoi(str_rev(buff2, buff));
}


x86 assembly (clang, -O0):
<is_palindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb7(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <str_rev@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_palindrome>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %edi,%ebx
lea    0xec0(%rip),%rsi
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1050 <sprintf@plt>
mov    %rsp,%rdi
mov    %r14,%rsi
call   1030 <str_rev@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @is_palindrome(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = alloca [20 x i8]
store i32 %0, i32* %2
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%11 = call i32 @str_rev(i8* %9, i8* %10)
%12 = call i32 @atoi(i32 %11)
%13 = icmp eq i32 %8, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @is_palindrome(i32 %0) {
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 @str_rev(i8* %5, i8* %4)
%8 = call i32 @atoi(i32 %7)
%9 = icmp eq i32 %8, %0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ small_frame();
void big_frame() {
  char S[524188];
  small_frame();
}


x86 assembly (clang, -O0):
<big_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7ffa0,%rsp
mov    $0x0,%al
call   1030 <small_frame@plt>
add    $0x7ffa0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @big_frame() {
%1 = alloca [524188 x i8]
%2 = call i32 (...) @small_frame()
ret void
}

LLVM IR (-O2):
define void @big_frame() {
%1 = tail call i32 (...) @small_frame()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ rate;

/* Variables and functions */
int /*<<< orphan*/ FifoProtocol_memcpy(int /*<<< orphan*/ *, void const *, int);
uint32_t inv_fifo_protocol_helper_decode_clockrate(const void *in,
                                                   uint16_t len) {
  uint32_t rate;
  FifoProtocol_memcpy((&rate), (in), (sizeof(rate)));
  (void)len;
  return rate;
}


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

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

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

LLVM IR (-O2):
define i32 @inv_fifo_protocol_helper_decode_clockrate(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @FifoProtocol_memcpy(i32* %3, i8* %0, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t byte_read_be_uint16(const char *samplePtr) {
  uint16_t val;
  {
    uint8_t b1 = *samplePtr++;
    uint8_t b2 = *samplePtr++;
    val = (b1 << 8) | b2;
  };
  return val;
}


x86 assembly (clang, -O0):
<byte_read_be_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_read_be_uint16>:
movsbl (%rdi),%eax
movsbl 0x1(%rdi),%ecx
shl    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @byte_read_be_uint16(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
store i32 %9, i32* %4
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = shl i32 %14, 8
%16 = load i32, i32* %5
%17 = or i32 %15, %16
store i32 %17, i32* %3
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @byte_read_be_uint16(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = shl nsw i32 %4, 8
%8 = or i32 %7, %6
ret i32 %8
}
int execute_getcpu() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_getcpu() {
ret i32 0
}
/* Variables and functions */
int get_hex_digit_value(char const, int *);
bool assemble_codepoint(const char *c, int n, int *id) {
  bool ok;
  int v;
  ok = get_hex_digit_value(*c, &v);
  if (!ok) {
    return false;
  }
  *id += v << (4 * (3 - n));
  return true;
}


x86 assembly (clang, -O0):
<assemble_codepoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
lea    -0x28(%rbp),%rsi
movsbl (%rax),%edi
call   1030 <get_hex_digit_value@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    114c <assemble_codepoint+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    116d <assemble_codepoint+0x5d>
mov    -0x28(%rbp),%eax
mov    $0x3,%ecx
sub    -0x14(%rbp),%ecx
shl    $0x2,%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemble_codepoint>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
movsbl (%rdi),%edi
lea    0x4(%rsp),%rsi
call   1030 <get_hex_digit_value@plt>
test   %eax,%eax
je     1141 <assemble_codepoint+0x31>
mov    0x4(%rsp),%eax
shl    $0x2,%bpl
mov    $0xc,%cl
sub    %bpl,%cl
shl    %cl,%eax
add    %eax,(%rbx)
mov    $0x1,%eax
jmp    1143 <assemble_codepoint+0x33>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @assemble_codepoint(i8* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = call i32 @get_hex_digit_value(i8 signext %11, i32* %9)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %3
store i32 0, i32* %4
br label %25
16: ; preds = %3
%17 = load i32, i32* %9
%18 = load i32, i32* %6
%19 = sub nsw i32 3, %18
%20 = mul nsw i32 4, %19
%21 = shl i32 %17, %20
%22 = load i32*, i32** %7
%23 = load i32, i32* %22
%24 = add nsw i32 %23, %21
store i32 %24, i32* %22
store i32 1, i32* %4
br label %25
25: ; preds = %16, %15
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @assemble_codepoint(i8* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i8, i8* %0
%7 = call i32 @get_hex_digit_value(i8 signext %6, i32* %4)
%8 = icmp eq i32 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %3
%10 = load i32, i32* %4
%11 = mul i32 %1, -4
%12 = add i32 %11, 12
%13 = shl i32 %10, %12
%14 = load i32, i32* %2
%15 = add nsw i32 %14, %13
store i32 %15, i32* %2
br label %16
16: ; preds = %3, %9
%17 = phi i32 [ 1, %9 ], [ 0, %3 ]
ret i32 %17
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_start_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(253, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<copy_dobldobl_start_system_to_container>:
mov    $0xfd,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @copy_dobldobl_start_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 253, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
scalar_t__ loadCharacter(int *, int);
int stringLength(int *s) {
  int i;
  i = 0;
  while (loadCharacter(s, i) != 0)
    i = i + 1;
  return i;
}


x86 assembly (clang, -O0):
<stringLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <loadCharacter@plt>
cmp    $0x0,%rax
je     1147 <stringLength+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <stringLength+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLength>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xffffffff,%ebx
nopl   0x0(%rax)
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <loadCharacter@plt>
test   %rax,%rax
jne    1120 <stringLength+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @stringLength(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = tail call i64 @loadCharacter(i32* %0, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i32 %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void modulo_unsigned_short_Good(uint16_t i) {
  char arr[5];
  arr[i % 5] = 123;
}


x86 assembly (clang, -O0):
<modulo_unsigned_short_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movb   $0x7b,-0x9(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @modulo_unsigned_short_Good(i32 %0) {
%2 = alloca i32
%3 = alloca [5 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 5
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 %6
store i8 123, i8* %7
ret void
}

LLVM IR (-O2):
define void @modulo_unsigned_short_Good(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M24_f(char *s) {
  debug("M24_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M24_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    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"M24_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M24_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 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 = [46 x i8] c"M24_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M24_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 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 */
scalar_t__ test_hmac_md5();
int main(void) {
  int r = 0;
  if (test_hmac_md5())
    r = -1;
  return r;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <test_hmac_md5@plt>
cmp    $0x0,%rax
je     113e <main+0x2e>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_hmac_md5@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @test_hmac_md5()
%2 = icmp ne i64 %1, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
long double powl(long double, long double);
long double sinl(long double);
long double f_bonus(long double x) { return powl(x - 4.0L, 2.0L) * sinl(x); }


x86 assembly (clang, -O0):
<f_bonus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xec9(%rip)
faddp  %st,%st(1)
mov    %rsp,%rax
flds   0xec2(%rip)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1040 <powl@plt>
fstpt  -0x1c(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
fldt   -0x1c(%rbp)
fmulp  %st,%st(1)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bonus>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fadds  0xee0(%rip)
fmul   %st,%st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
call   1030 <sinl@plt>
fldt   0x1c(%rsp)
fmulp  %st,%st(1)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @f_bonus(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fsub x86_fp80 %3, 0xK40018000000000000000
%5 = call x86_fp80 @powl(x86_fp80 %4, x86_fp80 0xK40008000000000000000)
%6 = load x86_fp80, x86_fp80* %2
%7 = call x86_fp80 @sinl(x86_fp80 %6)
%8 = fmul x86_fp80 %5, %7
ret x86_fp80 %8
}

LLVM IR (-O2):
define x86_fp80 @f_bonus(x86_fp80 %0) {
%2 = fadd x86_fp80 %0, 0xKC0018000000000000000
%3 = fmul x86_fp80 %2, %2
%4 = tail call x86_fp80 @sinl(x86_fp80 %0)
%5 = fmul x86_fp80 %3, %4
ret x86_fp80 %5
}
unsigned int hash(char *s) {
  unsigned int hashval;
  for (hashval = 0; s != '\0'; s++) {
    hashval = *s + 31 * hashval;
  }
  return hashval % 101;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113b <hash+0x3b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x65,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = load i32, i32* %3
%12 = mul i32 31, %11
%13 = add i32 %10, %12
store i32 %13, i32* %3
br label %14
14: ; preds = %7
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %2
br label %4
17: ; preds = %4
%18 = load i32, i32* %3
%19 = urem i32 %18, 101
ret i32 %19
}

LLVM IR (-O2):
define i32 @hash(i8* %0) {
%2 = icmp eq i8* %0, null
ret i32 0
}
int ml_factorise(int n1, int *factors, int *exponent) {
  factors[0] = 3;
  exponent[0] = 1;
  factors[1] = 78;
  exponent[1] = 1;
  factors[2] = 31;
  exponent[2] = 1;
  return 1;
}


x86 assembly (clang, -O0):
<ml_factorise>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x4e,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1f,0x8(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,0x8(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ml_factorise>:
movl   $0x3,(%rsi)
movl   $0x1,(%rdx)
movl   $0x4e,0x4(%rsi)
movl   $0x1,0x4(%rdx)
movl   $0x1f,0x8(%rsi)
movl   $0x1,0x8(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ml_factorise(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %5
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 3, i32* %8
%9 = load i32*, i32** %6
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 1, i32* %10
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 78, i32* %12
%13 = load i32*, i32** %6
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 1, i32* %14
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 31, i32* %16
%17 = load i32*, i32** %6
%18 = getelementptr inbounds i32, i32* %17, i64 2
store i32 1, i32* %18
ret i32 1
}

LLVM IR (-O2):
define i32 @ml_factorise(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 3, i32* %1
store i32 1, i32* %2
%4 = getelementptr inbounds i32, i32* %1, i64 1
store i32 78, i32* %4
%5 = getelementptr inbounds i32, i32* %2, i64 1
store i32 1, i32* %5
%6 = getelementptr inbounds i32, i32* %1, i64 2
store i32 31, i32* %6
%7 = getelementptr inbounds i32, i32* %2, i64 2
store i32 1, i32* %7
ret i32 1
}
/* Variables and functions */
int crypto_sign_ed25519_detached(unsigned char *, unsigned long long *,
                                 unsigned char const *, unsigned long long,
                                 unsigned char const *);
int crypto_sign_detached(unsigned char *sig, unsigned long long *siglen_p,
                         const unsigned char *m, unsigned long long mlen,
                         const unsigned char *sk) {
  return crypto_sign_ed25519_detached(sig, siglen_p, m, mlen, sk);
}


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

x86 assembly (clang, -O2):
<crypto_sign_detached>:
jmp    1030 <crypto_sign_ed25519_detached@plt>

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

LLVM IR (-O2):
define i32 @crypto_sign_detached(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4) {
%6 = tail call i32 @crypto_sign_ed25519_detached(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4)
ret i32 %6
}
mod(a, b) { return ((a % b) + b) % b; }


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    -0x8(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rdx,%rsi,1),%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @mod(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 = srem i32 %5, %6
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = srem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = add nsw i32 %3, %1
%5 = srem i32 %4, %1
ret i32 %5
}
unsigned xrop3_181_0_0(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;
  stk3 = S | D;
  stk2 = T & stk3;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_181_0_0>:
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    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_181_0_0>:
shl    $0x8,%edi
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
lea    0xff(%rdi),%eax
and    %ecx,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_181_0_0(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
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_181_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %4, 255
%8 = and i32 %6, %7
%9 = xor i32 %8, -256
ret i32 %9
}
void adc_unregister(struct adc_client *client) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *malloc(size_t);
void *rtbst_malloc(struct libavl_allocator *allocator, size_t size) {
  assert(allocator != NULL && size > 0);
  return malloc(size);
}


x86 assembly (clang, -O0):
<rtbst_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <rtbst_malloc+0x2b>
cmpq   $0x0,-0x10(%rbp)
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtbst_malloc>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <malloc@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define i8* @rtbst_malloc(%struct.libavl_allocator* %0, i64 %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i64
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i64 %1, i64* %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %4
%9 = icmp ugt i64 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i64, i64* %4
%15 = call i8* @malloc(i64 %14)
ret i8* %15
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define noalias i8* @rtbst_malloc(%struct.libavl_allocator* readnone %0, i64 %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i8* @malloc(i64 %1)
ret i8* %8
}