xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
unsigned long ftell(int /*<<< orphan*/ *);
unsigned long fileSizeF(char *filename) {
  FILE *fpText;
  unsigned long fsize;
  fpText = fopen(filename, "rb");
  fsize = 0;
  if (fpText) {
    fseek(fpText, 0, 2);
    fsize = ftell(fpText);
    fclose(fpText);
  }
  return fsize;
}


x86 assembly (clang, -O0):
<fileSizeF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1199 <fileSizeF+0x59>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileSizeF>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     117f <fileSizeF+0x3f>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14,%rax
jmp    1181 <fileSizeF+0x41>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i64 @fileSizeF(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @fseek(i32* %2, i32 0, i32 2)
%6 = tail call i64 @ftell(i32* %2)
%7 = tail call i32 @fclose(i32* %2)
br label %8
8: ; preds = %4, %1
%9 = phi i64 [ %6, %4 ], [ 0, %1 ]
ret i64 %9
}
short rgb2color(short c) { return 1000.0 * c / 0xff; }


x86 assembly (clang, -O0):
<rgb2color>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb2color>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define signext i16 @rgb2color(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = sitofp i32 %4 to double
%6 = fmul double 1.000000e+03, %5
%7 = fdiv double %6, 2.550000e+02
%8 = fptosi double %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define signext i16 @rgb2color(i16 signext %0) {
%2 = sitofp i16 %0 to double
%3 = fmul double %2, 1.000000e+03
%4 = fdiv double %3, 2.550000e+02
%5 = fptosi double %4 to i16
ret i16 %5
}
int _unimp_err(void) { return -141; }


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

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

LLVM IR (-O0):
define i32 @_unimp_err() {
ret i32 -141
}

LLVM IR (-O2):
define i32 @_unimp_err() {
ret i32 -141
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c;
  scanf("%d%d%d", &a, &b, &c);
  printf("%d", 1 + a + b + c);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
add    0x10(%rsp),%eax
mov    0xc(%rsp),%ecx
lea    (%rcx,%rax,1),%esi
add    $0x1,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%6 = load i32, i32* %2
%7 = add nsw i32 1, %6
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}
int start_func(void *arg) {
  int iarg = *(int *)arg;
  return iarg;
}


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

x86 assembly (clang, -O2):
<start_func>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @start_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @start_func(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int bitogray(int n) { return n ^ (n >> 1); }


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

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

LLVM IR (-O0):
define i32 @bitogray(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 1
%6 = xor i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @bitogray(i32 %0) {
%2 = ashr i32 %0, 1
%3 = xor i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: printf format [arguments ...]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"usage: printf format [arguments ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"usage: printf format [arguments ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void yyDeU8free(void *ptr) { free((char *)ptr); }


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

LLVM IR (-O0):
define void @yyDeU8free(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 @yyDeU8free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
unsigned getval_169() { return 3223375496U; }


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

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

LLVM IR (-O0):
define i32 @getval_169() {
ret i32 -1071591800
}

LLVM IR (-O2):
define i32 @getval_169() {
ret i32 -1071591800
}
/* Variables and functions */
int /*<<< orphan*/ field_swap(int, int);
void reverse(int left, int right) {
  for (; left < right; ++left, --right)
    field_swap(left, right);
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114c <reverse+0x3c>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <field_swap@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    111e <reverse+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbp
push   %rbx
push   %rax
cmp    %esi,%edi
jge    1133 <reverse+0x23>
mov    %esi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <field_swap@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    %ebx,%ebp
jl     1120 <reverse+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @reverse(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %1, %2 ]
%6 = phi i32 [ %8, %4 ], [ %0, %2 ]
%7 = tail call i32 @field_swap(i32 %6, i32 %5)
%8 = add nsw i32 %6, 1
%9 = add nsw i32 %5, -1
%10 = icmp slt i32 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %2
ret void
}
/* Type definitions */
struct mg_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mg_printf_http_chunk(struct mg_connection *, char *,
                                        char const *);
int /*<<< orphan*/ mg_send_http_chunk(struct mg_connection *, char *,
                                      int /*<<< orphan*/);
void send_error_result(struct mg_connection *nc, const char *msg) {
  mg_printf_http_chunk(nc, "Error: %s", msg);
  mg_send_http_chunk(nc, "", 0);
}


x86 assembly (clang, -O0):
<send_error_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rsi
call   1030 <mg_printf_http_chunk@plt>
mov    -0x8(%rbp),%rdi
lea    0xeba(%rip),%rsi
xor    %edx,%edx
call   1040 <mg_send_http_chunk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_error_result>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1030 <mg_printf_http_chunk@plt>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
pop    %rbx
jmp    1040 <mg_send_http_chunk@plt>

LLVM IR (-O0):
%struct.mg_connection = type { i32 }
@.str = [10 x i8] c"Error: %s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @send_error_result(%struct.mg_connection* %0, i8* %1) {
%3 = alloca %struct.mg_connection*
%4 = alloca i8*
store %struct.mg_connection* %0, %struct.mg_connection** %3
store i8* %1, i8** %4
%5 = load %struct.mg_connection*, %struct.mg_connection** %3
%6 = load i8*, i8** %4
%7 = call i32 @mg_printf_http_chunk(%struct.mg_connection* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load %struct.mg_connection*, %struct.mg_connection** %3
%9 = call i32 @mg_send_http_chunk(%struct.mg_connection* %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
%struct.mg_connection = type { i32 }
@.str = [10 x i8] c"Error: %s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @send_error_result(%struct.mg_connection* %0, i8* %1) {
%3 = tail call i32 @mg_printf_http_chunk(%struct.mg_connection* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @mg_send_http_chunk(%struct.mg_connection* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
float _nextafterf(float, float);
float nextafterf(float x, float y) { return _nextafterf(x, y); }


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

x86 assembly (clang, -O2):
<nextafterf>:
jmp    1030 <_nextafterf@plt>

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

LLVM IR (-O2):
define float @nextafterf(float %0, float %1) {
%3 = tail call float @_nextafterf(float %0, float %1)
ret float %3
}
/* Type definitions */
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double getTimeval() {
  struct timeval stTimeval;
  gettimeofday(&stTimeval, NULL);
  return stTimeval.tv_sec + (double)stTimeval.tv_usec * 1E-6;
}


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

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

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @getTimeval() {
%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 double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %4)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define double @getTimeval() {
%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 double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ omap_free_gpio(int);
int omap_get_gpio_datain(int);
int /*<<< orphan*/ omap_request_gpio(int);
int /*<<< orphan*/ omap_set_gpio_direction(int, int);
int omap_get_gpio(int gpio) {
  int value = -1;
  if (!omap_request_gpio(gpio)) {
    omap_set_gpio_direction(gpio, 1);
    value = omap_get_gpio_datain(gpio);
    omap_free_gpio(gpio);
  }
  return value;
}


x86 assembly (clang, -O0):
<omap_get_gpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <omap_request_gpio@plt>
cmp    $0x0,%eax
jne    1183 <omap_get_gpio+0x43>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <omap_set_gpio_direction@plt>
mov    -0x4(%rbp),%edi
call   1060 <omap_get_gpio_datain@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <omap_free_gpio@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omap_get_gpio>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <omap_request_gpio@plt>
test   %eax,%eax
je     1155 <omap_get_gpio+0x15>
mov    $0xffffffff,%eax
jmp    1173 <omap_get_gpio+0x33>
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <omap_set_gpio_direction@plt>
mov    %ebx,%edi
call   1060 <omap_get_gpio_datain@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <omap_free_gpio@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @omap_get_gpio(i32 %0) {
%2 = tail call i32 @omap_request_gpio(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @omap_set_gpio_direction(i32 %0, i32 1)
%6 = tail call i32 @omap_get_gpio_datain(i32 %0)
%7 = tail call i32 @omap_free_gpio(i32 %0)
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %6, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fn1() { printf("fn1\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"fn1\0A\00"
define void @fn1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"fn1\00"
define void @fn1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int foo(int, int);
int main() { return foo(2, 2); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x2,%edi
mov    $0x2,%esi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 2, i32 2)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 2, i32 2)
ret i32 %1
}
/* Variables and functions */
double log(double);
double fn(double x) { return (x == 0.0 ? 1.0 : log(1.0 + x) / x); }


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1147 <fn+0x37>
jp     1147 <fn+0x37>
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1163 <fn+0x53>
movsd  0xeb1(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
push   %rax
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    112b <fn+0x1b>
jp     112b <fn+0x1b>
movsd  0xed7(%rip),%xmm0
pop    %rax
ret
movsd  0xecd(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <log@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @fn(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fadd double %0, 1.000000e+00
%5 = tail call double @log(double %4)
%6 = fdiv double %5, %0
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 1.000000e+00, %1 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int l1, Al;
  printf("Insira o valor de um dos lados do quadrado: \n");
  scanf("%i", &l1);
  Al = l1 * l1;
  printf("A área do quadrado é %i e seu dobro é %i\n", Al, (Al * 2));
  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    0xeea(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
lea    0xeca(%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    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
imul   %esi,%esi
lea    (%rsi,%rsi,1),%edx
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Insira o valor de um dos lados do quadrado: \0A\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [45 x i8] c"A \C3\A1rea do quadrado \C3\A9 %i e seu dobro \C3\A9 %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 ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [45 x i8] c"A \C3\A1rea do quadrado \C3\A9 %i e seu dobro \C3\A9 %i\0A\00"
@str = [45 x i8] c"Insira o valor de um dos lados do quadrado: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, %5
%7 = shl nuw nsw i32 %6, 1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
void sws_subVec() {}


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

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

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

LLVM IR (-O2):
define void @sws_subVec() {
ret void
}
void nfsd4_free_slabs(void) {}


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

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

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

LLVM IR (-O2):
define void @nfsd4_free_slabs() {
ret void
}
/* Variables and functions */
int Cos(float);
float VectorX(int len, float angle) { return Cos(angle) * len; }


x86 assembly (clang, -O0):
<VectorX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <Cos@plt>
imul   -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VectorX>:
push   %rbx
mov    %edi,%ebx
call   1030 <Cos@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @VectorX(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = call i32 @Cos(float %5)
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = sitofp i32 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @VectorX(i32 %0, float %1) {
%3 = tail call i32 @Cos(float %1)
%4 = mul nsw i32 %3, %0
%5 = sitofp i32 %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ VirtualizeTimerC__0__Timer__stop(unsigned int);
void SensorControlP__Timer0__stop(void) {
  VirtualizeTimerC__0__Timer__stop(0U);
}


x86 assembly (clang, -O0):
<SensorControlP__Timer0__stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <VirtualizeTimerC__0__Timer__stop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorControlP__Timer0__stop>:
xor    %edi,%edi
jmp    1030 <VirtualizeTimerC__0__Timer__stop@plt>

LLVM IR (-O0):
define void @SensorControlP__Timer0__stop() {
%1 = call i32 @VirtualizeTimerC__0__Timer__stop(i32 0)
ret void
}

LLVM IR (-O2):
define void @SensorControlP__Timer0__stop() {
%1 = tail call i32 @VirtualizeTimerC__0__Timer__stop(i32 0)
ret void
}
void RTDbgModSymbolByAddr(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgModSymbolByAddr() {
ret void
}
/* Variables and functions */
double log(int /*<<< orphan*/);
int /*<<< orphan*/ tan(double);
double inverse_gudermannian_i1924(const double x) {
  const double x_r = x / 180.0 * 3.14159265358979323846;
  const double guder = log(tan(3.14159265358979323846 / 4.0 + x_r / 2.0));
  return guder * 6378388.0;
}


x86 assembly (clang, -O0):
<inverse_gudermannian_i1924>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xeb4(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xea0(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <tan@plt>
mov    %eax,%edi
call   1040 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xe7b(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse_gudermannian_i1924>:
push   %rax
divsd  0xed7(%rip),%xmm0
mulsd  0xed7(%rip),%xmm0
mulsd  0xed7(%rip),%xmm0
addsd  0xed7(%rip),%xmm0
call   1030 <tan@plt>
mov    %eax,%edi
call   1040 <log@plt>
mulsd  0xecb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @inverse_gudermannian_i1924(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fdiv double %5, 1.800000e+02
%7 = fmul double %6, 0x400921FB54442D18
store double %7, double* %3
%8 = load double, double* %3
%9 = fdiv double %8, 2.000000e+00
%10 = fadd double 0x3FE921FB54442D18, %9
%11 = call i32 @tan(double %10)
%12 = call double @log(i32 %11)
store double %12, double* %4
%13 = load double, double* %4
%14 = fmul double %13, 0x415854E500000000
ret double %14
}

LLVM IR (-O2):
define double @inverse_gudermannian_i1924(double %0) {
%2 = fdiv double %0, 1.800000e+02
%3 = fmul double %2, 0x400921FB54442D18
%4 = fmul double %3, 5.000000e-01
%5 = fadd double %4, 0x3FE921FB54442D18
%6 = tail call i32 @tan(double %5)
%7 = tail call double @log(i32 %6)
%8 = fmul double %7, 0x415854E500000000
ret double %8
}
void pm8921_charger_unregister_vbus_sn(void (*callback)(int)) {}


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

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

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

LLVM IR (-O2):
define void @pm8921_charger_unregister_vbus_sn(void (i32)* nocapture %0) {
ret void
}
int c40_dsint(c40)
int c40;
{ return (ioctl(c40, (_IO('v', 4)), 0)); }


x86 assembly (clang, -O0):
<c40_dsint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x76,%edi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c40_dsint>:
push   %rbx
mov    %edi,%ebx
mov    $0x76,%edi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @c40_dsint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @_IO to i32 (i32, i32, ...)*)(i32 118, i32 4)
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32, ...)*)(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @c40_dsint(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @_IO to i32 (i32, i32, ...)*)(i32 118, i32 4)
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
bool nrf52_errata_218(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_218() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 10;
  do {
    if (a < 15) {
      a++;
      continue;
    }
    printf("value of a: %d\n", a);
    a++;
  } while (a < 20);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jge    113e <main+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <main+0x46>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jl     1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xf,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"value of a: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 15)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 16)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 17)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 18)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 19)
ret i32 0
}
int test_imm_ECint64_lowword_reg(long long val) {
  return ((val) & (0xEC << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_ECint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 236
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ hal_io_set_amp(int);
void hal_cc25xx_enter_txmode(void) { hal_io_set_amp(1); }


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

x86 assembly (clang, -O2):
<hal_cc25xx_enter_txmode>:
mov    $0x1,%edi
jmp    1030 <hal_io_set_amp@plt>

LLVM IR (-O0):
define void @hal_cc25xx_enter_txmode() {
%1 = call i32 @hal_io_set_amp(i32 1)
ret void
}

LLVM IR (-O2):
define void @hal_cc25xx_enter_txmode() {
%1 = tail call i32 @hal_io_set_amp(i32 1)
ret void
}
int fb_ConsoleGetMaxRow(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fb_ConsoleGetMaxRow() {
ret i32 0
}
const char *eapol_sm_get_method_name(struct eapol_sm *sm) { return 0; }


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

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

LLVM IR (-O0):
%struct.eapol_sm = type opaque
define i8* @eapol_sm_get_method_name(%struct.eapol_sm* %0) {
%2 = alloca %struct.eapol_sm*
store %struct.eapol_sm* %0, %struct.eapol_sm** %2
ret i8* null
}

LLVM IR (-O2):
%struct.eapol_sm = type opaque
define noalias i8* @eapol_sm_get_method_name(%struct.eapol_sm* nocapture readnone %0) {
ret i8* null
}
void f_sizeof(void *x, void *y, int *size) {
  *size = ((char *)y) - ((char *)x);
}


x86 assembly (clang, -O0):
<f_sizeof>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_sizeof>:
sub    %edi,%esi
mov    %esi,(%rdx)
ret

LLVM IR (-O0):
define void @f_sizeof(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
%13 = load i32*, i32** %6
store i32 %12, i32* %13
ret void
}

LLVM IR (-O2):
define void @f_sizeof(i8* %0, i8* %1, i32* nocapture writeonly %2) {
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
ret void
}
/* Type definitions */
struct stree {
  int dummy;
};
struct node {
  int dummy;
};

/* Variables and functions */
int kTstree_walk(struct stree *, int /*<<< orphan*/, int /*<<< orphan*/,
                 char const *, int, struct node **, int *);
int /*<<< orphan*/ stree_get_root(struct stree *);
int kTstree_match(struct stree *tree, const char *T, int N,
                  struct node **node_out, int *pos_out) {
  return kTstree_walk(tree, stree_get_root(tree), 0, T, N, node_out, pos_out);
}


x86 assembly (clang, -O0):
<kTstree_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <stree_get_root@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    -0x28(%rbp),%rax
xor    %edx,%edx
mov    %rax,(%rsp)
call   1030 <kTstree_walk@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kTstree_match>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r8,%rbx
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%r12
mov    %rdi,%rbp
call   1040 <stree_get_root@plt>
mov    %rbx,(%rsp)
mov    %rbp,%rdi
mov    %eax,%esi
xor    %edx,%edx
mov    %r12,%rcx
mov    %r15d,%r8d
mov    %r14,%r9
call   1030 <kTstree_walk@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stree = type { i32 }
%struct.node = type { i32 }
define i32 @kTstree_match(%struct.stree* %0, i8* %1, i32 %2, %struct.node** %3, i32* %4) {
%6 = alloca %struct.stree*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca %struct.node**
%10 = alloca i32*
store %struct.stree* %0, %struct.stree** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store %struct.node** %3, %struct.node*** %9
store i32* %4, i32** %10
%11 = load %struct.stree*, %struct.stree** %6
%12 = load %struct.stree*, %struct.stree** %6
%13 = call i32 @stree_get_root(%struct.stree* %12)
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = load %struct.node**, %struct.node*** %9
%17 = load i32*, i32** %10
%18 = call i32 @kTstree_walk(%struct.stree* %11, i32 %13, i32 0, i8* %14, i32 %15, %struct.node** %16, i32* %17)
ret i32 %18
}

LLVM IR (-O2):
%struct.stree = type { i32 }
%struct.node = type { i32 }
define i32 @kTstree_match(%struct.stree* %0, i8* %1, i32 %2, %struct.node** %3, i32* %4) {
%6 = tail call i32 @stree_get_root(%struct.stree* %0)
%7 = tail call i32 @kTstree_walk(%struct.stree* %0, i32 %6, i32 0, i8* %1, i32 %2, %struct.node** %3, i32* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *title) {
  printf("Usage: %s <source> <event-name> [-is <value>]\n", title);
  printf("        -i           - int event_name\n");
  printf("        -s           - string event_name\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Usage: %s <source> <event-name> [-is <value>]\0A\00"
@.str.1 = [39 x i8] c" -i - int event_name\0A\00"
@.str.2 = [42 x i8] c" -s - string event_name\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [47 x i8] c"Usage: %s <source> <event-name> [-is <value>]\0A\00"
@str = [38 x i8] c" -i - int event_name\00"
@str.3 = [41 x i8] c" -s - string event_name\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ isprint(char);
int /*<<< orphan*/ isspace(char);
int is_printable(char ch) { return isprint(ch) && !isspace(ch); }


x86 assembly (clang, -O0):
<is_printable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
je     115d <is_printable+0x3d>
movsbl -0x1(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_printable>:
push   %rbx
mov    %edi,%ebx
call   1040 <isprint@plt>
test   %rax,%rax
je     1140 <is_printable+0x20>
movsbl %bl,%edi
call   1030 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_printable(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isprint(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i32 @isspace(i8 signext %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_printable(i8 signext %0) {
%2 = tail call i64 @isprint(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @isspace(i8 signext %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: wordints dict1 dict2\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: wordints dict1 dict2\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: wordints dict1 dict2\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ execl(int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getenv(char *);
int main() {
  execl(getenv("SCRIPT_FILENAME"), getenv("SCRIPT_FILENAME"), NULL);
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,-0x8(%rbp)
lea    0xeab(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <execl@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
mov    %eax,%esi
xor    %edx,%edx
call   1050 <execl@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"SCRIPT_FILENAME\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @execl(i32 %2, i32 %3, i32* null)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"SCRIPT_FILENAME\00"
define i32 @main() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @execl(i32 %1, i32 %1, i32* null)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void md_from_user_action(void) {}


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

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

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

LLVM IR (-O2):
define void @md_from_user_action() {
ret void
}