xunge/DecIR huggingface dataset:
int re_assemble_21(int as21) {
  return (((as21 & 0x100000) >> 20) | ((as21 & 0x0ffe00) >> 8) |
          ((as21 & 0x000180) << 7) | ((as21 & 0x00007c) << 14) |
          ((as21 & 0x000003) << 12));
}


x86 assembly (clang, -O0):
<re_assemble_21>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x100000,%eax
sar    $0x14,%eax
mov    -0x4(%rbp),%ecx
and    $0xffe00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x180,%ecx
shl    $0x7,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x7c,%ecx
shl    $0xe,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
shl    $0xc,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_assemble_21>:
mov    %edi,%eax
shr    $0x14,%eax
and    $0x1,%eax
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0xffe,%ecx
or     %eax,%ecx
mov    %edi,%edx
shl    $0x7,%edx
and    $0xc000,%edx
or     %ecx,%edx
mov    %edi,%eax
and    $0x7c,%eax
shl    $0xe,%eax
or     %edx,%eax
and    $0x3,%edi
shl    $0xc,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @re_assemble_21(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1048576
%5 = ashr i32 %4, 20
%6 = load i32, i32* %2
%7 = and i32 %6, 1048064
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 384
%12 = shl i32 %11, 7
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 124
%16 = shl i32 %15, 14
%17 = or i32 %13, %16
%18 = load i32, i32* %2
%19 = and i32 %18, 3
%20 = shl i32 %19, 12
%21 = or i32 %17, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @re_assemble_21(i32 %0) {
%2 = lshr i32 %0, 20
%3 = and i32 %2, 1
%4 = lshr i32 %0, 8
%5 = and i32 %4, 4094
%6 = or i32 %3, %5
%7 = shl i32 %0, 7
%8 = and i32 %7, 49152
%9 = or i32 %6, %8
%10 = shl i32 %0, 14
%11 = and i32 %10, 2031616
%12 = or i32 %9, %11
%13 = shl i32 %0, 12
%14 = and i32 %13, 12288
%15 = or i32 %12, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ tolower(int);
void uninivar_tolower(void) {
  int c;
  (void)tolower(c);
}


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

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

LLVM IR (-O0):
define void @uninivar_tolower() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @tolower(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninivar_tolower() {
ret void
}
trim_quotes(string) char *string;
{
  char *next;
  next = string + 1;
  while ((*next) && (*next != '\''))
    *string++ = *next++;
  *string = '\0';
}


x86 assembly (clang, -O0):
<trim_quotes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1139 <trim_quotes+0x39>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1149 <trim_quotes+0x49>
jmp    1170 <trim_quotes+0x70>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1114 <trim_quotes+0x14>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_quotes>:
movzbl 0x1(%rdi),%eax
test   %al,%al
je     1114 <trim_quotes+0x14>
cmp    $0x27,%al
je     1114 <trim_quotes+0x14>
mov    %al,(%rdi)
add    $0x1,%rdi
jmp    1100 <trim_quotes>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @trim_quotes(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %4, %6 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %7
i8 39, label %7
]
6: ; preds = %2
store i8 %5, i8* %3
br label %2
7: ; preds = %2, %2
store i8 0, i8* %3
ret i32 undef
}
/* Variables and functions */
double SIM_power_gatecap(double, int);
double SIM_array_column_select_cap(void) {
  return SIM_power_gatecap((10.0 * 0.0875), 1);
}


x86 assembly (clang, -O0):
<SIM_array_column_select_cap>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_array_column_select_cap>:
movsd  0xee8(%rip),%xmm0
mov    $0x1,%edi
jmp    1030 <SIM_power_gatecap@plt>

LLVM IR (-O0):
define double @SIM_array_column_select_cap() {
%1 = call double @SIM_power_gatecap(double 8.750000e-01, i32 1)
ret double %1
}

LLVM IR (-O2):
define double @SIM_array_column_select_cap() {
%1 = tail call double @SIM_power_gatecap(double 8.750000e-01, i32 1)
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ printf(char *, char *);
void free_int(int *i) {
  printf("%s\n", "free_int");
  free(i);
}


x86 assembly (clang, -O0):
<free_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_int>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"free_int\00"
define void @free_int(i32* nocapture %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @free(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void draw(const char *str) { printf("%s\n", str); }


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

x86 assembly (clang, -O2):
<draw>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @draw(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void ScaleRowDown34_0_Box_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_0_Box_Any_SSSE3() {
ret void
}
/* Type definitions */
struct BitMatrix {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BitMatrixCopy(struct BitMatrix *, struct BitMatrix *);
int /*<<< orphan*/ BitMatrixFree(struct BitMatrix *);
struct BitMatrix *BitMatrixMulMatrix(struct BitMatrix *, struct BitMatrix *);
void BitMatrixMulMatrixRight(struct BitMatrix *mat1, struct BitMatrix *mat2) {
  struct BitMatrix *matTmp = BitMatrixMulMatrix(mat1, mat2);
  BitMatrixCopy(mat1, matTmp);
  BitMatrixFree(matTmp);
}


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

x86 assembly (clang, -O2):
<BitMatrixMulMatrixRight>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <BitMatrixMulMatrix@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <BitMatrixCopy@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <BitMatrixFree@plt>

LLVM IR (-O0):
%struct.BitMatrix = type { i32 }
define void @BitMatrixMulMatrixRight(%struct.BitMatrix* %0, %struct.BitMatrix* %1) {
%3 = alloca %struct.BitMatrix*
%4 = alloca %struct.BitMatrix*
%5 = alloca %struct.BitMatrix*
store %struct.BitMatrix* %0, %struct.BitMatrix** %3
store %struct.BitMatrix* %1, %struct.BitMatrix** %4
%6 = load %struct.BitMatrix*, %struct.BitMatrix** %3
%7 = load %struct.BitMatrix*, %struct.BitMatrix** %4
%8 = call %struct.BitMatrix* @BitMatrixMulMatrix(%struct.BitMatrix* %6, %struct.BitMatrix* %7)
store %struct.BitMatrix* %8, %struct.BitMatrix** %5
%9 = load %struct.BitMatrix*, %struct.BitMatrix** %3
%10 = load %struct.BitMatrix*, %struct.BitMatrix** %5
%11 = call i32 @BitMatrixCopy(%struct.BitMatrix* %9, %struct.BitMatrix* %10)
%12 = load %struct.BitMatrix*, %struct.BitMatrix** %5
%13 = call i32 @BitMatrixFree(%struct.BitMatrix* %12)
ret void
}

LLVM IR (-O2):
%struct.BitMatrix = type { i32 }
define void @BitMatrixMulMatrixRight(%struct.BitMatrix* %0, %struct.BitMatrix* %1) {
%3 = tail call %struct.BitMatrix* @BitMatrixMulMatrix(%struct.BitMatrix* %0, %struct.BitMatrix* %1)
%4 = tail call i32 @BitMatrixCopy(%struct.BitMatrix* %0, %struct.BitMatrix* %3)
%5 = tail call i32 @BitMatrixFree(%struct.BitMatrix* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_sleep_all();
void operation_sleep_noirqreset(void) {
  mbus_sleep_all();
  delay(100 * 100);
  mbus_sleep_all();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<operation_sleep_noirqreset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <mbus_sleep_all@plt>
mov    $0x2710,%edi
call   1030 <delay@plt>
mov    $0x0,%al
call   1040 <mbus_sleep_all@plt>
jmp    113c <operation_sleep_noirqreset+0x1c>

x86 assembly (clang, -O2):
<operation_sleep_noirqreset>:
push   %rax
xor    %eax,%eax
call   1040 <mbus_sleep_all@plt>
mov    $0x2710,%edi
call   1030 <delay@plt>
xor    %eax,%eax
call   1040 <mbus_sleep_all@plt>
nopl   0x0(%rax)
jmp    1140 <operation_sleep_noirqreset+0x20>

LLVM IR (-O0):
define void @operation_sleep_noirqreset() {
%1 = call i32 (...) @mbus_sleep_all()
%2 = call i32 @delay(i32 10000)
%3 = call i32 (...) @mbus_sleep_all()
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define void @operation_sleep_noirqreset() {
%1 = tail call i32 (...) @mbus_sleep_all()
%2 = tail call i32 @delay(i32 10000)
%3 = tail call i32 (...) @mbus_sleep_all()
br label %4
4: ; preds = %0, %4
br label %4
}
__attribute__((no, noclone)) signed __int128 t113_4sub(signed __int128 x) {
  signed __int128 y =
      (((signed __int128)(((unsigned __int128)1 << (16 * 8 - 1)) - 1)));
  signed __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t113_4sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x38(%rbp)
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
sub    %rsi,%rdx
sbb    %rax,%rcx
seto   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    1174 <t113_4sub+0x64>
jmp    117b <t113_4sub+0x6b>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t113_4sub>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0x1,%r14
movabs $0x8000000000000000,%rbx
adc    %rsi,%rbx
jno    1131 <t113_4sub+0x21>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t113_4sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 170141183460469231731687303715884105727, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t113_4sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %6, i128 -170141183460469231731687303715884105727)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XCrossingEvent;

/* Variables and functions */
void set_XCrossingEvent_type(void *_p, int _v) {
  ((XCrossingEvent *)_p)->type = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XCrossingEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
dice_roll(number, faces) int number, faces;
{
  int i, total = 0;
  for (i = number; i > 0; i--)
    total += rand() % faces + 1;
  return total;
}


x86 assembly (clang, -O0):
<dice_roll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1159 <dice_roll+0x49>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <dice_roll+0x1b>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dice_roll>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    114a <dice_roll+0x3a>
mov    %esi,%r14d
mov    %edi,%ebp
add    $0x1,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %r14d
add    %edx,%ebx
add    $0x1,%ebx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <dice_roll+0x20>
jmp    114c <dice_roll+0x3c>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @dice_roll(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %11, %4 ], [ %0, %2 ]
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, %1
%9 = add i32 %5, 1
%10 = add i32 %9, %8
%11 = add nsw i32 %6, -1
%12 = icmp ugt i32 %6, 1
br i1 %12, label %4, label %13
13: ; preds = %4, %2
%14 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sfs_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @sfs_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int main(int argc, char **argv) {
  volatile uint32_t i = 0x01234567;
  return (*((uint8_t *)(&i))) == 0x67;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1234567,-0x14(%rbp)
cmpl   $0x67,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x1234567,-0x4(%rsp)
01
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile i32 19088743, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 103
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 19088743, i32* %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GetNewLine();
void StartActions() { GetNewLine(); }


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

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

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

LLVM IR (-O2):
define void @StartActions() {
%1 = tail call i32 (...) @GetNewLine()
ret void
}
int lock_component_pretake() {}


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

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

LLVM IR (-O0):
define i32 @lock_component_pretake() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @lock_component_pretake() {
ret i32 undef
}
struct _query *index_searcher_rewrite(struct _index_searcher *is,
                                      struct _query *original) {
  struct _query *query = original;
  struct _query *rewritten_qry;
  return query;
}


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

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

LLVM IR (-O0):
%struct._index_searcher = type opaque
%struct._query = type opaque
define %struct._query* @index_searcher_rewrite(%struct._index_searcher* %0, %struct._query* %1) {
%3 = alloca %struct._index_searcher*
%4 = alloca %struct._query*
%5 = alloca %struct._query*
%6 = alloca %struct._query*
store %struct._index_searcher* %0, %struct._index_searcher** %3
store %struct._query* %1, %struct._query** %4
%7 = load %struct._query*, %struct._query** %4
store %struct._query* %7, %struct._query** %5
%8 = load %struct._query*, %struct._query** %5
ret %struct._query* %8
}

LLVM IR (-O2):
%struct._index_searcher = type opaque
%struct._query = type opaque
define %struct._query* @index_searcher_rewrite(%struct._index_searcher* nocapture readnone %0, %struct._query* readnone returned %1) {
ret %struct._query* %1
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int nthreads, tid;
#pragma omp parallel private(nthreads, tid)
  {
    tid = omp_get_thread_num();
    printf("Hello, world! I am thread %d\n", tid);
#pragma omp barrier
    if (tid == 0) {
      nthreads = omp_get_num_threads();
      printf("Number of threads = %d\n", nthreads);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    117b <main+0x4b>
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
test   %ebx,%ebx
jne    1161 <main+0x31>
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Hello, world! I am thread %d\0A\00"
@.str.1 = [24 x i8] c"Number of threads = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @omp_get_thread_num()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = call i32 (...) @omp_get_num_threads()
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Hello, world! I am thread %d\0A\00"
@.str.1 = [24 x i8] c"Number of threads = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 (...) @omp_get_num_threads()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %0
ret i32 0
}
double A(int i, int j) { return ((i + j) * (i + j + 1) / 2 + i + 1); }


x86 assembly (clang, -O0):
<A>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<A>:
lea    (%rsi,%rdi,1),%eax
lea    (%rsi,%rdi,1),%ecx
add    $0x1,%ecx
imul   %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
add    %edi,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @A(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 = add nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = mul nsw i32 %7, %11
%13 = sdiv i32 %12, 2
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
%16 = add nsw i32 %15, 1
%17 = sitofp i32 %16 to double
ret double %17
}

LLVM IR (-O2):
define double @A(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = add nsw i32 %3, 1
%5 = mul nsw i32 %4, %3
%6 = sdiv i32 %5, 2
%7 = add i32 %0, 1
%8 = add i32 %7, %6
%9 = sitofp i32 %8 to double
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *info) {
  fprintf(stderr, "%s\n", info);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
scalar_t__ fputc(unsigned char, int /*<<< orphan*/ *);
int IO_Write_UBYTE(unsigned char value, FILE *fp) {
  assert(fp);
  return (fputc(value, fp) != EOF);
}


x86 assembly (clang, -O0):
<IO_Write_UBYTE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1030 <fputc@plt>
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IO_Write_UBYTE>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <assert@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    0x2ea7(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @IO_Write_UBYTE(i8 zeroext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
store i8 %0, i8* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @assert(i32* %5)
%7 = load i8, i8* %3
%8 = load i32*, i32** %4
%9 = call i64 @fputc(i8 zeroext %7, i32* %8)
%10 = load i64, i64* @EOF
%11 = icmp ne i64 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @IO_Write_UBYTE(i8 zeroext %0, i32* %1) {
%3 = tail call i32 @assert(i32* %1)
%4 = tail call i64 @fputc(i8 zeroext %0, i32* %1)
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
__attribute__((always_)) void init_copy_desc_masks(struct irq_desc *old_desc,
                                                   struct irq_desc *new_desc) {}


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

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

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

LLVM IR (-O2):
%struct.irq_desc = type opaque
define void @init_copy_desc_masks(%struct.irq_desc* nocapture %0, %struct.irq_desc* nocapture %1) {
ret void
}
int iswhitespace(char c) {
  if (c == '\t' || c == '\r' || c == '\f' || c == '\n' || c == '\v' ||
      c == ' ' || c == ',')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<iswhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     1165 <iswhitespace+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
je     1165 <iswhitespace+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0xc,%eax
je     1165 <iswhitespace+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1165 <iswhitespace+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0xb,%eax
je     1165 <iswhitespace+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1165 <iswhitespace+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x2c,%eax
jne    1171 <iswhitespace+0x71>
movl   $0x1,-0x4(%rbp)
jmp    1178 <iswhitespace+0x78>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswhitespace>:
cmp    $0x2c,%dil
ja     1120 <iswhitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100100003e00,%rdx
bt     %rcx,%rdx
jae    1120 <iswhitespace+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @iswhitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 44, label %3
i8 32, label %3
i8 13, label %3
i8 12, label %3
i8 11, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
char decchar(int x) { return '0' + (x % 10); }


x86 assembly (clang, -O0):
<decchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decchar>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
ret

LLVM IR (-O0):
define signext i8 @decchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 10
%5 = add nsw i32 48, %4
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @decchar(i32 %0) {
%2 = srem i32 %0, 10
%3 = trunc i32 %2 to i8
%4 = add nsw i8 %3, 48
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
void baz2(int n) {
  for (int i = 0; i < n; i++) {
    foo();
    bar();
  }
}


x86 assembly (clang, -O0):
<baz2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115a <baz2+0x3a>
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <baz2+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz2>:
push   %rbx
test   %edi,%edi
jle    1143 <baz2+0x23>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
call   1030 <bar@plt>
add    $0xffffffff,%ebx
jne    1130 <baz2+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @baz2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = call i32 (...) @foo()
%10 = call i32 (...) @bar()
br label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @baz2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = tail call i32 (...) @foo()
%7 = tail call i32 (...) @bar()
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void idbr_rx_done(void) {
  int timeout = 1000;
  while (timeout &&
         (((*((volatile unsigned int *)(0x40301698))) & 0x0080) == 0)) {
    udelay(10);
    timeout--;
  }
  (*((volatile unsigned int *)(0x40301698))) = 0x0080;
}


x86 assembly (clang, -O0):
<idbr_rx_done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3e8,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1143 <idbr_rx_done+0x33>
mov    $0x40301698,%eax
mov    (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1153 <idbr_rx_done+0x43>
jmp    116b <idbr_rx_done+0x5b>
mov    $0xa,%edi
call   1030 <udelay@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <idbr_rx_done+0xf>
mov    $0x40301698,%eax
movl   $0x80,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idbr_rx_done>:
push   %rbx
mov    $0xfffffc18,%ebx
cs nopw 0x0(%rax,%rax,1)
testl  $0x80,0x40301698
jne    113b <idbr_rx_done+0x2b>
mov    $0xa,%edi
call   1030 <udelay@plt>
inc    %ebx
jne    1120 <idbr_rx_done+0x10>
movl   $0x80,0x40301698
pop    %rbx
ret

LLVM IR (-O0):
define void @idbr_rx_done() {
%1 = alloca i32
store i32 1000, i32* %1
br label %2
2: ; preds = %11, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load volatile i32, i32* inttoptr (i64 1076893336 to i32*)
%7 = and i32 %6, 128
%8 = icmp eq i32 %7, 0
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %15
11: ; preds = %9
%12 = call i32 @udelay(i32 10)
%13 = load i32, i32* %1
%14 = add nsw i32 %13, -1
store i32 %14, i32* %1
br label %2
15: ; preds = %9
store volatile i32 128, i32* inttoptr (i64 1076893336 to i32*)
ret void
}

LLVM IR (-O2):
define void @idbr_rx_done() {
br label %1
1: ; preds = %0, %6
%2 = phi i32 [ 1000, %0 ], [ %8, %6 ]
%3 = load volatile i32, i32* inttoptr (i64 1076893336 to i32*)
%4 = and i32 %3, 128
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 @udelay(i32 10)
%8 = add nsw i32 %2, -1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %1
10: ; preds = %6, %1
store volatile i32 128, i32* inttoptr (i64 1076893336 to i32*)
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_22(uint64_t x) {
  __asm__("rolq $22, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_22>:
mov    %rdi,%rax
rol    $0x16,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_22(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$22, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_22(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$22, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int get_monotonic(struct timeval *tp) { return gettimeofday(tp, NULL); }


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

x86 assembly (clang, -O2):
<get_monotonic>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @get_monotonic(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @get_monotonic(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret i32 %2
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double curr_time(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1e6 + (double)tv.tv_usec;
}


x86 assembly (clang, -O0):
<curr_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl -0x10(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xec8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curr_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
cvtsi2sdq 0x10(%rsp),%xmm1
mulsd  0xecb(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define double @curr_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sitofp i32 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+06, double %8)
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define double @curr_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e+06, double %9)
ret double %10
}
int main(int argc, char *argv[]) {
  int a[5] = {1, 2, 3, 4, 5};
  int i;
  for (i = 0; i < 5; i++) {
    printf("%d\n", i[a]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    117a <main+0x6a>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    114c <main+0x3c>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
main(void) {
  int iArr[10];
  int *iPtr1, *iPtr2;
  iPtr1 = &iArr[1];
  iPtr2 = &iArr[7];
  printf("iPtr1 = %x, iPtr2 = %x\n", iPtr1, iPtr2);
  printf("Difference is\n");
  printf("iPtr2 - iPtr1 = %x\n", (iPtr2 - iPtr1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rax
add    $0x1c,%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
sub    %rax,%rsi
sar    $0x2,%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0x4(%rsp),%rsi
lea    0x1c(%rsp),%rdx
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"iPtr1 = %x, iPtr2 = %x\0A\00"
@.str.1 = [15 x i8] c"Difference is\0A\00"
@.str.2 = [20 x i8] c"iPtr2 - iPtr1 = %x\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32*
%3 = alloca i32*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
store i32* %4, i32** %2
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
store i32* %5, i32** %3
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32*, i32** %3
%11 = load i32*, i32** %2
%12 = ptrtoint i32* %10 to i64
%13 = ptrtoint i32* %11 to i64
%14 = sub i64 %12, %13
%15 = sdiv exact i64 %14, 4
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"iPtr1 = %x, iPtr2 = %x\0A\00"
@.str.2 = [20 x i8] c"iPtr2 - iPtr1 = %x\0A\00"
@str = [14 x i8] c"Difference is\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ local_mcu_Pin1_makeOutput__E();
int /*<<< orphan*/ pollen_parts_Led1_off__E();
void pollen_parts_Led1_targetInit__E() {
  local_mcu_Pin1_makeOutput__E();
  pollen_parts_Led1_off__E();
}


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

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

LLVM IR (-O0):
define void @pollen_parts_Led1_targetInit__E() {
%1 = call i32 (...) @local_mcu_Pin1_makeOutput__E()
%2 = call i32 (...) @pollen_parts_Led1_off__E()
ret void
}

LLVM IR (-O2):
define void @pollen_parts_Led1_targetInit__E() {
%1 = tail call i32 (...) @local_mcu_Pin1_makeOutput__E()
%2 = tail call i32 (...) @pollen_parts_Led1_off__E()
ret void
}
int create_distance() {}


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

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

LLVM IR (-O0):
define i32 @create_distance() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @create_distance() {
ret i32 undef
}