xunge/DecIR huggingface dataset:
int xmlUCSIsBoxDrawing(int code) {
  return (((code >= 0x2500) && (code <= 0x257F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsBoxDrawing>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x2500,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsBoxDrawing+0x26>
cmpl   $0x257f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsBoxDrawing>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x2500,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsBoxDrawing(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 9472
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 9599
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsBoxDrawing(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 9472
%4 = zext i1 %3 to i32
ret i32 %4
}
void RTThreadGetType(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct BCHCode *);
void BCHCode_Delete(struct BCHCode *BCHCode_data) { free(BCHCode_data); }


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

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

LLVM IR (-O2):
%struct.BCHCode = type { i32 }
define void @BCHCode_Delete(%struct.BCHCode* nocapture %0) {
%2 = tail call i32 @free(%struct.BCHCode* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char str_a[20];
  char *pointer;
  char *pointer2;
  strcpy(str_a, "Hello World!\n");
  pointer = str_a;
  printf(pointer);
  pointer2 = pointer + 2;
  printf(pointer2);
  strcpy(pointer2, "y you guys!\n");
  printf(pointer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xed2(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
lea    0x2(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [13 x i8] c"y you guys!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* %8)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 2
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = call i32 @printf(i8* %12)
%14 = load i8*, i8** %4
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%16 = load i8*, i8** %3
%17 = call i32 @printf(i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [13 x i8] c"y you guys!\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %2)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 2
%6 = call i32 @printf(i8* %5)
%7 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* %2)
ret i32 0
}
/* Variables and functions */
float M_PI;
int cos(float);
float sineIn(float fraction, float start, float delta) {
  return delta * (1 - cos(fraction * M_PI / 2)) + start;
}


x86 assembly (clang, -O0):
<sineIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2eab(%rip),%rax
mulss  (%rax),%xmm0
movss  0xeb7(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <cos@plt>
movss  -0x10(%rbp),%xmm0
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sineIn>:
push   %rax
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
mov    0x2ec5(%rip),%rax
mulss  (%rax),%xmm0
mulss  0xed1(%rip),%xmm0
call   1030 <cos@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @sineIn(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %4
%9 = load float, float* @M_PI
%10 = fmul float %8, %9
%11 = fdiv float %10, 2.000000e+00
%12 = call i32 @cos(float %11)
%13 = sub nsw i32 1, %12
%14 = sitofp i32 %13 to float
%15 = load float, float* %5
%16 = call float @llvm.fmuladd.f32(float %7, float %14, float %15)
ret float %16
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @sineIn(float %0, float %1, float %2) {
%4 = load float, float* @M_PI
%5 = fmul float %4, %0
%6 = fmul float %5, 5.000000e-01
%7 = tail call i32 @cos(float %6)
%8 = sub nsw i32 1, %7
%9 = sitofp i32 %8 to float
%10 = tail call float @llvm.fmuladd.f32(float %2, float %9, float %1)
ret float %10
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t get_now_ms() {
  struct timeval t0;
  gettimeofday(&t0, NULL);
  return t0.tv_sec * 1000 + t0.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<get_now_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_now_ms>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @get_now_ms() {
%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 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @get_now_ms() {
%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 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ starMemInitFort();
void starmem_init_() { starMemInitFort(); }


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

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

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

LLVM IR (-O2):
define void @starmem_init_() {
%1 = tail call i32 (...) @starMemInitFort()
ret void
}
void ble_evt_gap_mode_changed(
    const struct ble_msg_gap_mode_changed_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_gap_mode_changed_evt_t = type opaque
define void @ble_evt_gap_mode_changed(%struct.ble_msg_gap_mode_changed_evt_t* nocapture %0) {
ret void
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int /*<<< orphan*/ rot1(char);
int main(int argc, char *argv[]) {
  char c;
  c = getchar();
  while (c != EOF) {
    putchar(rot1(c));
    c = getchar();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    0x2e8d(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1185 <main+0x55>
movsbl -0x11(%rbp),%edi
call   1040 <rot1@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x11(%rbp)
jmp    1150 <main+0x20>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea9(%rip),%rbx
cmp    (%rbx),%al
je     116a <main+0x3a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1040 <rot1@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%al
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call signext i8 (...) @getchar()
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %10, %6 ], [ %3, %2 ]
%8 = tail call i32 @rot1(i8 signext %7)
%9 = tail call i32 @putchar(i32 %8)
%10 = tail call signext i8 (...) @getchar()
%11 = load i8, i8* @EOF
%12 = icmp eq i8 %10, %11
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
int detect(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @detect() {
ret i32 1
}
double campoy(double z, double Bx) { return 2; }


x86 assembly (clang, -O0):
<campoy>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @campoy(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 2.000000e+00
}

LLVM IR (-O2):
define double @campoy(double %0, double %1) {
ret double 2.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ stderr;
FILE *check_popen(char *command, char *mode) {
  FILE *res = popen(command, mode);
  if (res == NULL) {
    fprintf(stderr, "[Error] Failed to start command %s!\n", command);
    exit(1);
  }
  return res;
}


x86 assembly (clang, -O0):
<check_popen>:
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   1040 <popen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <check_popen+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_popen>:
push   %rbx
mov    %rdi,%rbx
call   1040 <popen@plt>
test   %rax,%rax
je     1140 <check_popen+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"[Error] Failed to start command %s!\0A\00"
define i32* @check_popen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @popen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"[Error] Failed to start command %s!\0A\00"
define noalias i32* @check_popen(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @popen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_usage(const char *prog_name) {
  fprintf(stderr, "pem2c "
                  "1.0.1"
                  "\n");
  fprintf(stderr, "usage: %s [-i in.pem] [-o out.h] <x509|pubkey> <macro>\n",
          prog_name);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xed4(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"pem2c 1.0.1\0A\00"
@.str.1 = [56 x i8] c"usage: %s [-i in.pem] [-o out.h] <x509|pubkey> <macro>\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"pem2c 1.0.1\0A\00"
@.str.1 = [56 x i8] c"usage: %s [-i in.pem] [-o out.h] <x509|pubkey> <macro>\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void MergeOperatorDestroy(void *arg) { (void)arg; }


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

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

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

LLVM IR (-O2):
define void @MergeOperatorDestroy(i8* nocapture %0) {
ret void
}
void ccm_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @ccm_iomux_config() {
ret void
}
int security_task_getscheduler(struct task_struct *p) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @security_task_getscheduler(%struct.task_struct* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
int main(void) {
  const int IDEAL_METRIC_METER = 1;
  const float PI = 3.14;
  const char CHAR = 'A';
  printf("%d\n", IDEAL_METRIC_METER);
  printf("%f\n", PI);
  printf("%c\n", CHAR);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movb   $0x41,-0xd(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca i8
store i32 0, i32* %1
store i32 1, i32* %2
store float 0x40091EB860000000, float* %3
store i8 65, i8* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 1)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 3)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext 65)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 3)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext 65)
ret i32 0
}
void lidt(volatile void *idtr) {
  __asm__ volatile("lidt (%0)" ::"r"(idtr));
  do {
    asm volatile("" ::: "memory");
  } while (0);
}


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

x86 assembly (clang, -O2):
<lidt>:
lidt   (%rdi)
ret

LLVM IR (-O0):
define void @lidt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
br label %4
4: ; preds = %1
br label %5
5: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @lidt(i8* %0) {
tail call void asm sideeffect "lidt ($0)", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int usage() {
  printf("usage: jrep [-cHnov] [pattern] [file]\n");
  return 0;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"usage: jrep [-cHnov] [pattern] [file]\0A\00"
define i32 @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [38 x i8] c"usage: jrep [-cHnov] [pattern] [file]\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(char const *, int, size_t, int /*<<< orphan*/ *);
void write_buffer(char *file_name, const char *buffer, size_t buffer_size) {
  FILE *f;
  f = fopen(file_name, "w+");
  if (buffer)
    fwrite(buffer, 1, buffer_size, f);
  fclose(f);
}


x86 assembly (clang, -O0):
<write_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1179 <write_buffer+0x49>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_buffer>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
lea    0xebe(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %r15,%r15
je     1162 <write_buffer+0x32>
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"w+\00"
define void @write_buffer(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = load i32*, i32** %7
%16 = call i32 @fwrite(i8* %13, i32 1, i64 %14, i32* %15)
br label %17
17: ; preds = %12, %3
%18 = load i32*, i32** %7
%19 = call i32 @fclose(i32* %18)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"w+\00"
define void @write_buffer(i8* nocapture %0, i8* %1, i64 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %1, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @fwrite(i8* %1, i32 1, i64 %2, i32* %4)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @fclose(i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int firstVal, secondVal;
  printf("Please enter two integers for dividing by module: ");
  scanf("%i%i", &firstVal, &secondVal);
  printf("%i %% %i = %i\n", firstVal, secondVal, firstVal % secondVal);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%ecx
mov    -0x10(%rbp),%edx
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%r8d
mov    %esi,%eax
cltd
idiv   %r8d
mov    %edx,%ecx
lea    0xede(%rip),%rdi
mov    %r8d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Please enter two integers for dividing by module: \00"
@.str.1 = [5 x i8] c"%i%i\00"
@.str.2 = [15 x i8] c"%i %% %i = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = srem i32 %8, %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %7, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"Please enter two integers for dividing by module: \00"
@.str.1 = [5 x i8] c"%i%i\00"
@.str.2 = [15 x i8] c"%i %% %i = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = srem i32 %7, %8
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}
int test_imm_35uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x35 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_35uint64_lowword_mem>:
testb  $0x35,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_35uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 53
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int hash(char *sz) {
  int i;
  for (i = 0; *sz; sz++)
    i += *sz;
  return i;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113a <hash+0x3a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <hash+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
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 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
br label %14
14: ; preds = %8
%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
ret i32 %18
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = add nsw i32 %6, %8
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sscanf(char *, char *, int *);
void answer_ping(char *c) {
  int tmp;
  if (sscanf(c, "ping %d", &tmp) == 1)
    printf("pong %d\n", tmp);
}


x86 assembly (clang, -O0):
<answer_ping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    1158 <answer_ping+0x38>
mov    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<answer_ping>:
push   %rax
lea    0xed8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    1147 <answer_ping+0x27>
mov    0x4(%rsp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"ping %d\00"
@.str.1 = [9 x i8] c"pong %d\0A\00"
define void @answer_ping(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"ping %d\00"
@.str.1 = [9 x i8] c"pong %d\0A\00"
define void @answer_ping(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BlinkC__Leds__led2Toggle();
void BlinkC__Timer2__fired(void) {
  ;
  BlinkC__Leds__led2Toggle();
}


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

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

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

LLVM IR (-O2):
define void @BlinkC__Timer2__fired() {
%1 = tail call i32 (...) @BlinkC__Leds__led2Toggle()
ret void
}
int fixdfsi(double d) { return d; }


x86 assembly (clang, -O0):
<fixdfsi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixdfsi>:
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @fixdfsi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @fixdfsi(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
int is_smark(char c) {
  int mark[] = {33, 34, 44, 58, 59, 63, 96};
  register int i;
  for (i = 0; i < sizeof(mark) / sizeof(int); i++)
    if (c == mark[i])
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_smark>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee9(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee7(%rip),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x34(%rbp)
movslq -0x34(%rbp),%rax
cmp    $0x7,%rax
jae    117a <is_smark+0x7a>
movsbl -0x5(%rbp),%eax
movslq -0x34(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jne    1167 <is_smark+0x67>
movl   $0x1,-0x4(%rbp)
jmp    1181 <is_smark+0x81>
jmp    116c <is_smark+0x6c>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    113b <is_smark+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_smark>:
add    $0xdf,%dil
cmp    $0x3f,%dil
ja     1124 <is_smark+0x24>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x8000000046000803,%rdx
bt     %rcx,%rdx
jae    1124 <is_smark+0x24>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@__const.is_smark.mark = [7 x i32] [i32 33, i32 34, i32 44, i32 58, i32 59, i32 63, i32 96]
define i32 @is_smark(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca [7 x i32]
%5 = alloca i32
store i8 %0, i8* %3
%6 = bitcast [7 x i32]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %21, %1
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = icmp ult i64 %9, 7
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = icmp eq i32 %13, %17
br i1 %18, label %19, label %20
19: ; preds = %11
store i32 1, i32* %2
br label %25
20: ; preds = %11
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %7
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_smark(i8 signext %0) {
switch i8 %0, label %2 [
i8 33, label %3
i8 34, label %3
i8 44, label %3
i8 58, label %3
i8 59, label %3
i8 63, label %3
i8 96, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %1 ], [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void cleanup(void) { remove("conf.log"); }


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <remove@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"conf.log\00"
define void @cleanup() {
%1 = call i32 @remove(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"conf.log\00"
define void @cleanup() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned g(unsigned y) { return y + 2; }


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

x86 assembly (clang, -O2):
<g>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = add i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fcitx_utils_free(void *ptr) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<fcitx_utils_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <fcitx_utils_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcitx_utils_free>:
test   %rdi,%rdi
je     111a <fcitx_utils_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @fcitx_utils_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
__attribute__((no, noclone)) void f(short b) {
  __builtin_setjmp(0);
  f(0);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %di,%ax
mov    %ax,-0x2a(%rbp)
mov    %rbp,%rcx
xor    %eax,%eax
mov    %rcx,(%rax)
mov    %rsp,%rcx
xor    %eax,%eax
mov    %rcx,0x10(%rax)
lea    0x26(%rip),%rax
mov    %rax,0x8
xor    %eax,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
xor    %edi,%edi
call   1030 <f@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    114a <f+0x3a>

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @f(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i8* @llvm.frameaddress.p0i8(i32 0)
store i8* %3, i8** null
%4 = call i8* @llvm.stacksave()
store i8* %4, i8** getelementptr inbounds (i8*, i8** null, i64 2)
%5 = call i32 @llvm.eh.sjlj.setjmp(i8* null)
ret void
}

LLVM IR (-O2):
int aleatorio(void) { __asm__ __volatile__("rdtsc"); }


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

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

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

LLVM IR (-O2):
define i32 @aleatorio() {
tail call void asm sideeffect "rdtsc", "~{dirflag},~{fpsr},~{flags}"()
ret i32 undef
}
float raw_tanh_derivative_at(float y) { return 1.0 - y * y; }


x86 assembly (clang, -O0):
<raw_tanh_derivative_at>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_tanh_derivative_at>:
mulss  %xmm0,%xmm0
movss  0xef4(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @raw_tanh_derivative_at(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = fsub double 1.000000e+00, %6
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @raw_tanh_derivative_at(float %0) {
%2 = fmul float %0, %0
%3 = fsub float 1.000000e+00, %2
ret float %3
}
/* Variables and functions */
int say_hello();
int main(int argc, char **argv) { return say_hello(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @say_hello()
ret i32 %3
}
/* Type definitions */
struct udevice {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, int);
int vidconsole_memmove(struct udevice *dev, void *dst, const void *src,
                       int size) {
  memmove(dst, src, size);
  return 0;
}


x86 assembly (clang, -O0):
<vidconsole_memmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memmove@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vidconsole_memmove>:
push   %rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <memmove@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.udevice = type { i32 }
define i32 @vidconsole_memmove(%struct.udevice* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.udevice*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.udevice* %0, %struct.udevice** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @memmove(i8* %9, i8* %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
%struct.udevice = type { i32 }
define i32 @vidconsole_memmove(%struct.udevice* nocapture readnone %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @memmove(i8* %1, i8* %2, i32 %3)
ret i32 0
}
int mIsRussiaState(int ccode) { return (ccode >= 411 && ccode <= 493); }


x86 assembly (clang, -O0):
<mIsRussiaState>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x19b,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <mIsRussiaState+0x26>
cmpl   $0x1ed,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mIsRussiaState>:
add    $0xfffffe65,%edi
xor    %eax,%eax
cmp    $0x53,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @mIsRussiaState(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 411
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 493
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mIsRussiaState(i32 %0) {
%2 = add i32 %0, -411
%3 = icmp ult i32 %2, 83
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SYS_open;
int syscall(int /*<<< orphan*/, int);
int open(const char *path, int oflag, ...) { return syscall(SYS_open, oflag); }


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@SYS_open = global i32 0
define i32 @open(i8* nocapture readnone %0, i32 %1, ...) {
%3 = load i32, i32* @SYS_open
%4 = tail call i32 @syscall(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
long drand48();
long intrand(long max) { return (long)(drand48() * max); }


x86 assembly (clang, -O0):
<intrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <drand48@plt>
imul   -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intrand>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <drand48@plt>
imul   %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @intrand(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @drand48()
%4 = load i64, i64* %2
%5 = mul nsw i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @intrand(i64 %0) {
%2 = tail call i64 (...) @drand48()
%3 = mul nsw i64 %2, %0
ret i64 %3
}
/* Type definitions */
struct tfCommand {
  int dummy;
};

/* Variables and functions */
int sesSCSIResponse(struct tfCommand *, int);
int sesSCSIReadLaterWrite(struct tfCommand *cmd) {
  return sesSCSIResponse(cmd, 1);
}


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

x86 assembly (clang, -O2):
<sesSCSIReadLaterWrite>:
mov    $0x1,%esi
jmp    1030 <sesSCSIResponse@plt>

LLVM IR (-O0):
%struct.tfCommand = type { i32 }
define i32 @sesSCSIReadLaterWrite(%struct.tfCommand* %0) {
%2 = alloca %struct.tfCommand*
store %struct.tfCommand* %0, %struct.tfCommand** %2
%3 = load %struct.tfCommand*, %struct.tfCommand** %2
%4 = call i32 @sesSCSIResponse(%struct.tfCommand* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.tfCommand = type { i32 }
define i32 @sesSCSIReadLaterWrite(%struct.tfCommand* %0) {
%2 = tail call i32 @sesSCSIResponse(%struct.tfCommand* %0, i32 1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ regmatch_t;
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
scalar_t__ regexec(int /*<<< orphan*/ *, char const *, int,
                   int /*<<< orphan*/ *, int /*<<< orphan*/);
int match(regex_t *re, const char *line) {
  regmatch_t matches;
  return 0 == regexec(re, line, 1, &matches, 0);
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
lea    -0x14(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <regexec@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
push   %rax
lea    0x4(%rsp),%rcx
mov    $0x1,%edx
xor    %r8d,%r8d
call   1030 <regexec@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @match(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i32*, i32** %3
%7 = load i8*, i8** %4
%8 = call i64 @regexec(i32* %6, i8* %7, i32 1, i32* %5, i32 0)
%9 = icmp eq i64 0, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @match(i32* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @regexec(i32* %0, i8* %1, i32 1, i32* %3, i32 0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}