xunge/DecIR huggingface dataset:
/* Variables and functions */
int musmidi_pause();
int mus_midi_pause(void) { return musmidi_pause(); }


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

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

LLVM IR (-O0):
define i32 @mus_midi_pause() {
%1 = call i32 (...) @musmidi_pause()
ret i32 %1
}

LLVM IR (-O2):
define i32 @mus_midi_pause() {
%1 = tail call i32 (...) @musmidi_pause()
ret i32 %1
}
void TIM8_CC_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @TIM8_CC_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int stub1(int, char *, int);
int displaystr(int i_fh, int (*getProc)(int, char *, int), char *name) {
  char field[256];
  if ((*getProc)(i_fh, field, 255) == 0)
    return 0;
  printf("%-12s %s\n", name, field);
  return 1;
}


x86 assembly (clang, -O0):
<displaystr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%edi
lea    -0x120(%rbp),%rsi
mov    $0xff,%edx
call   *%rax
cmp    $0x0,%eax
jne    1150 <displaystr+0x40>
movl   $0x0,-0x4(%rbp)
jmp    116e <displaystr+0x5e>
mov    -0x18(%rbp),%rsi
lea    -0x120(%rbp),%rdx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displaystr>:
push   %rbx
sub    $0x100,%rsp
mov    %rdx,%rbx
mov    %rsi,%rax
mov    %rsp,%rsi
mov    $0xff,%edx
call   *%rax
test   %eax,%eax
je     1145 <displaystr+0x35>
lea    0xecd(%rip),%rdi
mov    %rsp,%rdx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
jmp    1147 <displaystr+0x37>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%-12s %s\0A\00"
define i32 @displaystr(i32 %0, i32 (i32, i8*, i32)* nocapture %1, i8* %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = call i32 %1(i32 %0, i8* %5, i32 255)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %5)
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ 1, %8 ], [ 0, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void randomNumbers(int *A) {
  time_t t;
  srand((unsigned)time(&t));
  for (int i = 0; i < 1000000; i++) {
    A[i] = rand() % 1000000;
  }
}


x86 assembly (clang, -O0):
<randomNumbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0xf4240,-0x10(%rbp)
jge    1188 <randomNumbers+0x58>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1153 <randomNumbers+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomNumbers>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x4(%rsp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0xf4240,%rbx
jne    1150 <randomNumbers+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @randomNumbers(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = call i64 @time(i32* %3)
%6 = trunc i64 %5 to i32
%7 = call i32 @srand(i32 %6)
store i32 0, i32* %4
br label %8
8: ; preds = %18, %1
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 1000000
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = call i32 (...) @rand()
%13 = srem i32 %12, 1000000
%14 = load i32*, i32** %2
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 %13, i32* %17
br label %18
18: ; preds = %11
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %8
21: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @randomNumbers(i32* nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i64 @time(i32* %2)
%5 = trunc i64 %4 to i32
%6 = call i32 @srand(i32 %5)
br label %8
7: ; preds = %8
ret void
8: ; preds = %1, %8
%9 = phi i64 [ 0, %1 ], [ %13, %8 ]
%10 = call i32 (...) @rand()
%11 = srem i32 %10, 1000000
%12 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %11, i32* %12
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, 1000000
br i1 %14, label %7, label %8
}
/* Variables and functions */
scalar_t__ strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int is_docid_name(char *fname) {
  return strlen(fname) > 0 && strncmp(fname, "+", 1) == 0;
}


x86 assembly (clang, -O0):
<is_docid_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jle    1166 <is_docid_name+0x46>
mov    -0x8(%rbp),%rdi
lea    0xeae(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_docid_name>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
test   %rax,%rax
jle    114f <is_docid_name+0x2f>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"+\00"
define i32 @is_docid_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%9 = icmp eq i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"+\00"
define i32 @is_docid_name(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = icmp eq i64 %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*/ STDOUT_FILENO;
int dwrite_log(int /*<<< orphan*/, char const *);
int write_log(const char *msg) { return dwrite_log(STDOUT_FILENO, msg); }


x86 assembly (clang, -O0):
<write_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <dwrite_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_log>:
mov    %rdi,%rsi
mov    0x2ed6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <dwrite_log@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define i32 @write_log(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i8*, i8** %2
%5 = call i32 @dwrite_log(i32 %3, i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define i32 @write_log(i8* %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @dwrite_log(i32 %2, i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *s) {
  fprintf(stderr, "usage: %s < MANIFEST\n", s);
  exit(EXIT_FAILURE);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"usage: %s < MANIFEST\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void free_all() {}


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

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

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

LLVM IR (-O2):
define void @free_all() {
ret void
}
/* Variables and functions */
char *capitalize_safe(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char *name = "anubhav saini!";
  printf("%s capitalized %s\n", name, capitalize_safe(name));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <capitalize_safe@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <capitalize_safe@plt>
lea    0xed8(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"anubhav saini!\00"
@.str.1 = [19 x i8] c"%s capitalized %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @capitalize_safe(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"anubhav saini!\00"
@.str.1 = [19 x i8] c"%s capitalized %s\0A\00"
define i32 @main() {
%1 = tail call i8* @capitalize_safe(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
opt_S() { int i; }


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

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

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

LLVM IR (-O2):
define i32 @opt_S() {
ret i32 undef
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int quaddobl_Newton_Laurent_step(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(328, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<quaddobl_Newton_Laurent_step>:
mov    $0x148,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @quaddobl_Newton_Laurent_step() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 328, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
struct _stor_fread_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _stor_fread_req *);
void stor_fread_req_free(struct _stor_fread_req *ptr) { osapi_free(ptr); }


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

x86 assembly (clang, -O2):
<stor_fread_req_free>:
jmp    1030 <osapi_free@plt>

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

LLVM IR (-O2):
%struct._stor_fread_req = type { i32 }
define void @stor_fread_req_free(%struct._stor_fread_req* %0) {
%2 = tail call i32 @osapi_free(%struct._stor_fread_req* %0)
ret void
}
float get_hour_angle(int hour, int min) {
  if (hour > 11)
    hour -= 12;
  return (hour * 30) + (min * 0.5);
}


x86 assembly (clang, -O0):
<get_hour_angle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xb,-0x4(%rbp)
jle    111d <get_hour_angle+0x1d>
mov    -0x4(%rbp),%eax
sub    $0xc,%eax
mov    %eax,-0x4(%rbp)
imul   $0x1e,-0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hour_angle>:
lea    -0xc(%rdi),%eax
cmp    $0xc,%edi
cmovl  %edi,%eax
mov    %eax,%ecx
shl    $0x5,%ecx
sub    %eax,%ecx
sub    %eax,%ecx
cvtsi2sd %ecx,%xmm0
cvtsi2sd %esi,%xmm1
mulsd  0xede(%rip),%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @get_hour_angle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 11
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 12
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 30
%13 = sitofp i32 %12 to double
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to double
%16 = call double @llvm.fmuladd.f64(double %15, double 5.000000e-01, double %13)
%17 = fptrunc double %16 to float
ret float %17
}

LLVM IR (-O2):
define float @get_hour_angle(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 11
%4 = add nsw i32 %0, -12
%5 = select i1 %3, i32 %4, i32 %0
%6 = mul nsw i32 %5, 30
%7 = sitofp i32 %6 to double
%8 = sitofp i32 %1 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 5.000000e-01, double %7)
%10 = fptrunc double %9 to float
ret float %10
}
int do_609() { return 609; }


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

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

LLVM IR (-O0):
define i32 @do_609() {
ret i32 609
}

LLVM IR (-O2):
define i32 @do_609() {
ret i32 609
}
int test_imm_54int8_mem(signed char *val) {
  return ((*val) & (-0x54 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_54int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -84
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage() {
  fprintf(stderr, "Usage: ./a.out -n mq_name prio\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    $0xffffffff,%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    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: ./a.out -n mq_name prio\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: ./a.out -n mq_name prio\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void dfile(unsigned int inumber) {
  int status;
  status = delete_ifile(inumber);
  fatal(!status, __func__, "erreur suppression fichier %d", inumber);
}


x86 assembly (clang, -O0):
<dfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <delete_ifile@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x4(%rbp),%ecx
lea    0xeb0(%rip),%rsi
lea    0xeaf(%rip),%rdx
mov    $0x0,%al
call   1040 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfile>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <delete_ifile@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xec7(%rip),%rsi
lea    0xec6(%rip),%rdx
mov    %ebx,%ecx
xor    %eax,%eax
pop    %rbx
jmp    1040 <fatal@plt>

LLVM IR (-O0):
@__func__.dfile = [6 x i8] c"dfile\00"
@.str = [30 x i8] c"erreur suppression fichier %d\00"
define void @dfile(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @delete_ifile to i32 (i32, ...)*)(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = load i32, i32* %2
%11 = call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @fatal to i32 (i32, i8*, i8*, i32, ...)*)(i32 %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.dfile, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@__func__.dfile = [6 x i8] c"dfile\00"
@.str = [30 x i8] c"erreur suppression fichier %d\00"
define void @dfile(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @delete_ifile to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 (i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @fatal to i32 (i32, i8*, i8*, i32, ...)*)(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.dfile, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void hash_digest_update(__attribute__((unused)) const void *buf,
                        __attribute__((unused)) int len) {}


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

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

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

LLVM IR (-O2):
define void @hash_digest_update(i8* nocapture %0, i32 %1) {
ret void
}
void d2i_ECPKParameters(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_ECPKParameters() {
ret void
}
/* Variables and functions */
void *crCalloc(unsigned int);
void *crCallocDebug(unsigned int nbytes, const char *file, int line) {
  return crCalloc(nbytes);
}


x86 assembly (clang, -O0):
<crCallocDebug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <crCalloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crCallocDebug>:
jmp    1030 <crCalloc@plt>

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

LLVM IR (-O2):
define i8* @crCallocDebug(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i8* @crCalloc(i32 %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void call_m32(unsigned int *m32) {
  put8(0xFF);
  put8(0x15);
  put32((unsigned int)(m32));
}


x86 assembly (clang, -O0):
<call_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xff,%edi
call   1030 <put8@plt>
mov    $0x15,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_m32>:
push   %rbx
mov    %rdi,%rbx
mov    $0xff,%edi
call   1030 <put8@plt>
mov    $0x15,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @call_m32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @put8(i32 255)
%4 = call i32 @put8(i32 21)
%5 = load i32*, i32** %2
%6 = ptrtoint i32* %5 to i32
%7 = call i32 @put32(i32 %6)
ret void
}

LLVM IR (-O2):
define void @call_m32(i32* %0) {
%2 = tail call i32 @put8(i32 255)
%3 = tail call i32 @put8(i32 21)
%4 = ptrtoint i32* %0 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @put32(i32 %5)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int create_multprec_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(522, a, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<create_multprec_homotopy>:
mov    $0x20a,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @create_multprec_homotopy() {
%1 = tail call i32 @_ada_use_c2phc(i32 522, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cTools_memFree(void *p) { free(p); }


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

LLVM IR (-O0):
define void @cTools_memFree(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 @cTools_memFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
float crealf(float __complex__ z) { return __real__ z; }


x86 assembly (clang, -O0):
<crealf>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @crealf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %3
%4 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%5 = load float, float* %4
ret float %5
}

LLVM IR (-O2):
define float @crealf(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 0
ret float %2
}
void dbg_dump_inode(struct ubifs_info *c, const struct inode *inode) { return; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
%struct.inode = type opaque
define void @dbg_dump_inode(%struct.ubifs_info* nocapture %0, %struct.inode* nocapture %1) {
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t l = 0;
  while (*s++)
    ++l;
  return l;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1139 <strlen+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ mgrSendMessageToLedController(char *);
int mgrTuningStopped(int code, void *arg1, void *arg2) {
  ;
  mgrSendMessageToLedController("/led/red/off");
  mgrSendMessageToLedController("/led/green/off");
  if (code != 0) {
    mgrSendMessageToLedController("/led/orange/blink/fast");
  }
  return 0;
}


x86 assembly (clang, -O0):
<mgrTuningStopped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
lea    0xed7(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
cmpl   $0x0,-0x4(%rbp)
je     1151 <mgrTuningStopped+0x41>
lea    0xed0(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgrTuningStopped>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
lea    0xee7(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
test   %ebx,%ebx
je     113b <mgrTuningStopped+0x2b>
lea    0xee6(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/led/red/off\00"
@.str.1 = [15 x i8] c"/led/green/off\00"
@.str.2 = [23 x i8] c"/led/orange/blink/fast\00"
define i32 @mgrTuningStopped(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %3
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"/led/red/off\00"
@.str.1 = [15 x i8] c"/led/green/off\00"
@.str.2 = [23 x i8] c"/led/orange/blink/fast\00"
define i32 @mgrTuningStopped(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %0, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int setvbuf(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int,
            int /*<<< orphan*/);
int os_set_buffering(FILE *stream, int mode) {
  return setvbuf(stream, NULL, mode, 0);
}


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

x86 assembly (clang, -O2):
<os_set_buffering>:
mov    %esi,%edx
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <setvbuf@plt>

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

LLVM IR (-O2):
define i32 @os_set_buffering(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @setvbuf(i32* %0, i32* null, i32 %1, i32 0)
ret i32 %3
}
void outb(unsigned short port, unsigned char data) {
  asm volatile("outb %1, %0" ::"Nd"(port), "a"(data));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x3(%rbp),%al
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
%6 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb $1, $0", "N{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i8 %1)
ret void
}
/* Type definitions */
union bpf_attr {
  int target_fd;
  int attach_type;
};
typedef enum bpf_attach_type {
  ____Placeholder_bpf_attach_type
} bpf_attach_type;
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_PROG_DETACH;
int /*<<< orphan*/ bzero(union bpf_attr *, int);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_prog_detach(int target_fd, enum bpf_attach_type type) {
  union bpf_attr attr;
  bzero(&attr, sizeof(attr));
  attr.target_fd = target_fd;
  attr.attach_type = type;
  return sys_bpf(BPF_PROG_DETACH, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_prog_detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1040 <bzero@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_prog_detach>:
push   %rax
mov    %esi,(%rsp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_PROG_DETACH = global i32 0
define i32 @bpf_prog_detach(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %union.bpf_attr
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @bzero(%union.bpf_attr* %5, i32 4)
%7 = load i32, i32* %3
%8 = bitcast %union.bpf_attr* %5 to i32*
store i32 %7, i32* %8
%9 = load i32, i32* %4
%10 = bitcast %union.bpf_attr* %5 to i32*
store i32 %9, i32* %10
%11 = load i32, i32* @BPF_PROG_DETACH
%12 = call i32 @sys_bpf(i32 %11, %union.bpf_attr* %5, i32 4)
ret i32 %12
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_PROG_DETACH = global i32 0
define i32 @bpf_prog_detach(i32 %0, i32 %1) {
%3 = alloca %union.bpf_attr
%4 = bitcast %union.bpf_attr* %3 to i8*
%5 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = load i32, i32* @BPF_PROG_DETACH
%7 = call i32 @sys_bpf(i32 %6, %union.bpf_attr* %3, i32 4)
ret i32 %7
}
void RTLockValidatorRecSharedCheckOrder(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @XtSetValues() {
ret void
}
long d2l(double d) { return *(long *)&d; }


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

x86 assembly (clang, -O2):
<d2l>:
movq   %xmm0,%rax
ret

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

LLVM IR (-O2):
define i64 @d2l(double %0) {
%2 = bitcast double %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int iproute_list(int, char **);
scalar_t__ strcmp(char *, char *);
int do_iproute(int argc, char **argv) {
  if (strcmp(*argv, "list") == 0)
    return iproute_list(argc - 1, argv + 1);
  exit(0);
}


x86 assembly (clang, -O0):
<do_iproute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1175 <do_iproute+0x45>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <iproute_list@plt>
add    $0x10,%rsp
pop    %rbp
ret
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<do_iproute>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
lea    0xebe(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1163 <do_iproute+0x33>
add    $0xffffffff,%ebp
add    $0x8,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <iproute_list@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"list\00"
define i32 @do_iproute(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = load i8*, i8** %5
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = call i32 @iproute_list(i32 %11, i8** %13)
ret i32 %14
15: ; preds = %2
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"list\00"
define i32 @do_iproute(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = tail call i32 @iproute_list(i32 %7, i8** %8)
ret i32 %9
10: ; preds = %2
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ closegraph();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getch();
void check() {
  if (27 == getch()) {
    closegraph();
    exit(0);
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,%ecx
mov    $0x1b,%eax
cmp    %ecx,%eax
jne    1158 <check+0x28>
mov    $0x0,%al
call   1030 <closegraph@plt>
xor    %edi,%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rax
xor    %eax,%eax
call   1040 <getch@plt>
cmp    $0x1b,%eax
je     113f <check+0xf>
pop    %rax
ret
xor    %eax,%eax
call   1030 <closegraph@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @check() {
%1 = call i32 (...) @getch()
%2 = icmp eq i32 27, %1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 (...) @closegraph()
%5 = call i32 @exit(i32 0)
unreachable
6: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @check() {
%1 = tail call i32 (...) @getch()
%2 = icmp eq i32 %1, 27
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @closegraph()
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %0
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *,
                            int);
const char *build_pruN_program_name(const char *output_mode_name,
                                    const char *output_mapping_name,
                                    uint8_t pruNum, char *out_pru_filename,
                                    int filename_len) {
  snprintf(out_pru_filename, filename_len, "pru/bin/%s-%s-pru%d.bin",
           output_mode_name, output_mapping_name, (int)pruNum);
  return out_pru_filename;
}


x86 assembly (clang, -O0):
<build_pruN_program_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%rax
mov    %eax,%r9d
lea    0xeb7(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_pruN_program_name>:
push   %rbx
mov    %rcx,%rbx
mov    %rdx,%r9
mov    %rsi,%rax
mov    %rdi,%rcx
lea    0xedc(%rip),%rdx
mov    %rbx,%rdi
mov    %r8d,%esi
mov    %rax,%r8
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"pru/bin/%s-%s-pru%d.bin\00"
define i8* @build_pruN_program_name(i8* %0, i8* %1, i64 %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %9
%12 = load i32, i32* %10
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = load i64, i64* %8
%16 = trunc i64 %15 to i32
%17 = call i32 @snprintf(i8* %11, i32 %12, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14, i32 %16)
%18 = load i8*, i8** %9
ret i8* %18
}

LLVM IR (-O2):
@.str = [24 x i8] c"pru/bin/%s-%s-pru%d.bin\00"
define i8* @build_pruN_program_name(i8* %0, i8* %1, i64 %2, i8* returned %3, i32 %4) {
%6 = trunc i64 %2 to i32
%7 = tail call i32 @snprintf(i8* %3, i32 %4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %6)
ret i8* %3
}
/* Variables and functions */
char *strchr(char *, char);
int strchrcount(char s[], char c) {
  char *cpnt = s;
  int count = 0;
  while ((cpnt = strchr(cpnt, c)) != NULL) {
    ++cpnt;
    ++count;
  }
  return count;
}


x86 assembly (clang, -O0):
<strchrcount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1166 <strchrcount+0x56>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1131 <strchrcount+0x21>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrcount>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1146 <strchrcount+0x36>
movsbl %bpl,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
add    $0x1,%ebx
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <strchrcount+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @strchrcount(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = add nuw nsw i32 %7, 1
%10 = tail call i8* @strchr(i8* dereferenceable(1) %8, i8 signext %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %9, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void goDown(int dy) { printf("\e[%dB", dy); }


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

x86 assembly (clang, -O2):
<goDown>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dB\00"
define void @goDown(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int top, score;
  top = score = -(2 + 5) * 6 + (4 + 3 * (2 + 3));
  printf("top = %d \n", top);
  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)
movl   $0xffffffe9,-0x18(%rbp)
movl   $0xffffffe9,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"top = %d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 -23)
ret i32 0
}