xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double, int);
int main(int argc, const char *argv[]) {
  struct {
    int a;
    float b;
    int c;
  } myst;
  myst.a = 4;
  myst.b = 3.37;
  myst.c = 8;
  printf("a = %d, b = %f, c = %d\n", myst.a, myst.b, myst.c);
  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   $0x4,-0x20(%rbp)
movss  0xecb(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x8,-0x18(%rbp)
mov    -0x20(%rbp),%esi
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x18(%rbp),%edx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.anon = type { i32, float, i32 }
@.str = [24 x i8] c"a = %d, b = %f, c = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.anon
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
store i32 4, i32* %7
%8 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 1
store float 0x400AF5C280000000, float* %8
%9 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 2
store i32 8, i32* %9
%10 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 1
%13 = load float, float* %12
%14 = fpext float %13 to double
%15 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 2
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %11, double %14, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"a = %d, b = %f, c = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 4, double 0x400AF5C280000000, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char *s;
  printf("s: ");
  scanf("%s", s);
  printf("s: %s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"s: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [7 x i8] c"s: %s\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* undef)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* undef)
ret i32 0
}
int maxValue(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<maxValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <maxValue+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <maxValue+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxValue>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @maxValue(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @maxValue(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *);
int /*<<< orphan*/ stdout;
void PrintCaseInfo(int caseId, const char *signatureString) {
  fprintf(stdout, "f%d(\t%s", caseId, signatureString);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<PrintCaseInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintCaseInfo>:
push   %rbx
mov    %rsi,%rcx
mov    %edi,%edx
mov    0x2eb3(%rip),%rbx
mov    (%rbx),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"f%d(\09%s\00"
define void @PrintCaseInfo(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"f%d(\09%s\00"
define void @PrintCaseInfo(i32 %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  for (i = 0; i < 1024; i++)
    printf("%d\n", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x400,-0x8(%rbp)
jge    1150 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x400,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1024
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
main() {
  typedef int i_td;
  typedef __typeof(i_td) b;
  i_td *a;
  q(a == (char *)0);
  a = (short *)5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <q@plt>
mov    $0x5,%eax
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = icmp eq i32* %2, null
%4 = zext i1 %3 to i32
%5 = call i32 (i32, ...) bitcast (i32 (...)* @q to i32 (i32, ...)*)(i32 %4)
store i32* inttoptr (i64 5 to i32*), i32** %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @q to i32 (i32, ...)*)(i32 0)
ret i32 0
}
int bar(char c) {
  int i = c << 1;
  return i > 1000;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bar(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = shl i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 1000
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @bar(i8 signext %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ match(char);
void variables() { match('v'); }


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

x86 assembly (clang, -O2):
<variables>:
mov    $0x76,%edi
jmp    1030 <match@plt>

LLVM IR (-O0):
define void @variables() {
%1 = call i32 @match(i8 signext 118)
ret void
}

LLVM IR (-O2):
define void @variables() {
%1 = tail call i32 @match(i8 signext 118)
ret void
}
void LexEntryStatsEnd() {}


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

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

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

LLVM IR (-O2):
define void @LexEntryStatsEnd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void nrerror(char *message) {
  fprintf(stderr, "\n%s\n", message);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<nrerror>:
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):
<nrerror>:
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 = [5 x i8] c"\0A%s\0A\00"
@EXIT_SUCCESS = global i32 0
define void @nrerror(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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"\0A%s\0A\00"
@EXIT_SUCCESS = global i32 0
define void @nrerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dcs_input();
char const *skip_prefix_2(int /*<<< orphan*/, char const *);
const char *skip_dcs_2(const char *input) {
  if ((unsigned char)*input == 0220) {
    return input + 1;
  }
  return skip_prefix_2(dcs_input(), input);
}


x86 assembly (clang, -O0):
<skip_dcs_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x90,%eax
jne    114f <skip_dcs_2+0x2f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <skip_dcs_2+0x45>
mov    $0x0,%al
call   1030 <dcs_input@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <skip_prefix_2@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_dcs_2>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x90,(%rdi)
jne    1132 <skip_dcs_2+0x12>
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <dcs_input@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <skip_prefix_2@plt>

LLVM IR (-O0):
define i8* @skip_dcs_2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 144
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %2
br label %15
11: ; preds = %1
%12 = call i32 (...) @dcs_input()
%13 = load i8*, i8** %3
%14 = call i8* @skip_prefix_2(i32 %12, i8* %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %11, %8
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @skip_dcs_2(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, -112
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
br label %9
6: ; preds = %1
%7 = tail call i32 (...) @dcs_input()
%8 = tail call i8* @skip_prefix_2(i32 %7, i8* %0)
br label %9
9: ; preds = %6, %4
%10 = phi i8* [ %5, %4 ], [ %8, %6 ]
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ pbkdf2_sha512(int /*<<< orphan*/ const *, size_t,
                                 int /*<<< orphan*/ const *, size_t,
                                 int /*<<< orphan*/, int /*<<< orphan*/ *,
                                 size_t);
void fastpbkdf2_hmac_sha512(const uint8_t *pw, size_t npw, const uint8_t *salt,
                            size_t nsalt, uint32_t iterations, uint8_t *out,
                            size_t nout) {
  pbkdf2_sha512(pw, npw, salt, nsalt, iterations, out, nout);
}


x86 assembly (clang, -O0):
<fastpbkdf2_hmac_sha512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <pbkdf2_sha512@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastpbkdf2_hmac_sha512>:
jmp    1030 <pbkdf2_sha512@plt>

LLVM IR (-O0):
define void @fastpbkdf2_hmac_sha512(i32* %0, i64 %1, i32* %2, i64 %3, i32 %4, i32* %5, i64 %6) {
%8 = alloca i32*
%9 = alloca i64
%10 = alloca i32*
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i64
store i32* %0, i32** %8
store i64 %1, i64* %9
store i32* %2, i32** %10
store i64 %3, i64* %11
store i32 %4, i32* %12
store i32* %5, i32** %13
store i64 %6, i64* %14
%15 = load i32*, i32** %8
%16 = load i64, i64* %9
%17 = load i32*, i32** %10
%18 = load i64, i64* %11
%19 = load i32, i32* %12
%20 = load i32*, i32** %13
%21 = load i64, i64* %14
%22 = call i32 @pbkdf2_sha512(i32* %15, i64 %16, i32* %17, i64 %18, i32 %19, i32* %20, i64 %21)
ret void
}

LLVM IR (-O2):
define void @fastpbkdf2_hmac_sha512(i32* %0, i64 %1, i32* %2, i64 %3, i32 %4, i32* %5, i64 %6) {
%8 = tail call i32 @pbkdf2_sha512(i32* %0, i64 %1, i32* %2, i64 %3, i32 %4, i32* %5, i64 %6)
ret void
}
int test_imm_66int32_mem(int *val) {
  return ((*val) & (0x66 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_66int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 102
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int i2d_RSA_NET(int /*<<< orphan*/ const *, unsigned char **,
                int (*)(char *, int, char const *, int), int /*<<< orphan*/);
int i2d_Netscape_RSA(const RSA *a, unsigned char **pp,
                     int (*cb)(char *buf, int len, const char *prompt,
                               int verify)) {
  return i2d_RSA_NET(a, pp, cb, 0);
}


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

x86 assembly (clang, -O2):
<i2d_Netscape_RSA>:
xor    %ecx,%ecx
jmp    1030 <i2d_RSA_NET@plt>

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

LLVM IR (-O2):
define i32 @i2d_Netscape_RSA(i32* %0, i8** %1, i32 (i8*, i32, i8*, i32)* %2) {
%4 = tail call i32 @i2d_RSA_NET(i32* %0, i8** %1, i32 (i8*, i32, i8*, i32)* %2, i32 0)
ret i32 %4
}
void gtk_scrolled_window_set_shadow_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_scrolled_window_set_shadow_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void bin(int n) {
  if (n > 1) {
    bin(n / 2);
  }
  printf("%d", n % 2);
}


x86 assembly (clang, -O0):
<bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1147 <bin+0x27>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <bin@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jl     1131 <bin+0x11>
mov    %ebx,%edi
shr    %edi
call   1030 <bin@plt>
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
and    $0xfffffffe,%eax
sub    %eax,%ebx
lea    0xebc(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @bin(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i32 %0, 1
tail call void @bin(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = srem i32 %0, 2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
void processOutput(fd_set *wrSet) {}


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

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

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

LLVM IR (-O2):
define void @processOutput(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mms100_ISC_set_ready();
void mms100_ISC_reboot_mcs(void) { mms100_ISC_set_ready(); }


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

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

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

LLVM IR (-O2):
define void @mms100_ISC_reboot_mcs() {
%1 = tail call i32 (...) @mms100_ISC_set_ready()
ret void
}
/* Variables and functions */
int tun_open_common0(char *, int);
int tun_open(char *dev) { return tun_open_common0(dev, 1); }


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

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

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

LLVM IR (-O2):
define i32 @tun_open(i8* %0) {
%2 = tail call i32 @tun_open_common0(i8* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ funzionePacman(int);
int /*<<< orphan*/ perror(char *);
void generaPacman(int pipeAlControllo[]) {
  switch (fork()) {
  case -1:
    perror("ERRORE 007: la fork non e' stata eseguita correttamente.");
    exit(1);
  case 0:
    funzionePacman(pipeAlControllo[1]);
  }
}


x86 assembly (clang, -O0):
<generaPacman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
call   1060 <fork@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
sub    $0xffffffff,%eax
je     1176 <generaPacman+0x36>
jmp    1166 <generaPacman+0x26>
mov    -0xc(%rbp),%eax
test   %eax,%eax
je     118c <generaPacman+0x4c>
jmp    1198 <generaPacman+0x58>
lea    0xe83(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <funzionePacman@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generaPacman>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <fork@plt>
test   %eax,%eax
je     1156 <generaPacman+0x16>
cmp    $0xffffffff,%eax
je     115f <generaPacman+0x1f>
pop    %rbx
ret
mov    0x4(%rbx),%edi
pop    %rbx
jmp    1030 <funzionePacman@plt>
lea    0xe9a(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"ERRORE 007: la fork non e' stata eseguita correttamente.\00"
define void @generaPacman(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @fork()
switch i32 %3, label %12 [
i32 -1, label %4
i32 0, label %7
]
4: ; preds = %1
%5 = call i32 @perror(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = call i32 @funzionePacman(i32 %10)
br label %12
12: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"ERRORE 007: la fork non e' stata eseguita correttamente.\00"
define void @generaPacman(i32* nocapture %0) {
%2 = tail call i32 (...) @fork()
switch i32 %2, label %10 [
i32 -1, label %3
i32 0, label %6
]
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = tail call i32 @funzionePacman(i32 %8)
br label %10
10: ; preds = %6, %1
ret void
}
double MPStoMPH(double MPS) {
  double MPH = 2.23694 * MPS;
  return MPH;
}


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

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

LLVM IR (-O0):
define double @MPStoMPH(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 2.236940e+00, %4
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @MPStoMPH(double %0) {
%2 = fmul double %0, 2.236940e+00
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printMenu() {
  printf("\n(1) Search Movie. \n");
  printf("\n(2) Return Movie. \n");
  printf("\n(3) Locate Movie. \n");
}


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

x86 assembly (clang, -O2):
<printMenu>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"\0A(1) Search Movie. \0A\00"
@.str.1 = [21 x i8] c"\0A(2) Return Movie. \0A\00"
@.str.2 = [21 x i8] c"\0A(3) Locate Movie. \0A\00"
define void @printMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0A(1) Search Movie. \00"
@str.3 = [20 x i8] c"\0A(2) Return Movie. \00"
@str.4 = [20 x i8] c"\0A(3) Locate Movie. \00"
define void @printMenu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nc_advise(char *, int const, char *, int);
int nc_del_att(int, int, char const *);
int ncattdel(int ncid, int varid, const char *name) {
  const int status = nc_del_att(ncid, varid, name);
  if (status != 0) {
    nc_advise("ncattdel", status, "ncid %d", ncid);
    return -1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<ncattdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <nc_del_att@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1173 <ncattdel+0x53>
mov    -0x1c(%rbp),%esi
mov    -0x8(%rbp),%ecx
lea    0xea5(%rip),%rdi
lea    0xea7(%rip),%rdx
call   1040 <nc_advise@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <ncattdel+0x5a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncattdel>:
push   %rbx
mov    %edi,%ebx
call   1030 <nc_del_att@plt>
test   %eax,%eax
je     114a <ncattdel+0x2a>
lea    0xecd(%rip),%rdi
lea    0xecf(%rip),%rdx
mov    %eax,%esi
mov    %ebx,%ecx
call   1040 <nc_advise@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"ncattdel\00"
@.str.1 = [8 x i8] c"ncid %d\00"
define i32 @ncattdel(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @nc_del_att(i32 %0, i32 %1, i8* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @nc_advise(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ -1, %6 ], [ 1, %3 ]
ret i32 %9
}
/* Variables and functions */
int get_speed_ref(int, int);
int get_time_slot(int /*<<< orphan*/);
int roadmap_line_speed_get(int, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int roadmap_line_speed_get_speed(int line, int against_dir) {
  int time_slot;
  int speed_ref = get_speed_ref(line, against_dir);
  if (speed_ref == 0xFFFF)
    return 0;
  time_slot = get_time_slot(time(NULL));
  return roadmap_line_speed_get(speed_ref, time_slot);
}


x86 assembly (clang, -O0):
<roadmap_line_speed_get_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <get_speed_ref@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffff,-0x14(%rbp)
jne    1175 <roadmap_line_speed_get_speed+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1196 <roadmap_line_speed_get_speed+0x56>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1060 <get_time_slot@plt>
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <roadmap_line_speed_get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_line_speed_get_speed>:
push   %rbx
call   1030 <get_speed_ref@plt>
cmp    $0xffff,%eax
jne    1151 <roadmap_line_speed_get_speed+0x11>
xor    %eax,%eax
pop    %rbx
ret
mov    %eax,%ebx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1060 <get_time_slot@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <roadmap_line_speed_get@plt>

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

LLVM IR (-O2):
define i32 @roadmap_line_speed_get_speed(i32 %0, i32 %1) {
%3 = tail call i32 @get_speed_ref(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 65535
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @time(i32* null)
%7 = tail call i32 @get_time_slot(i32 %6)
%8 = tail call i32 @roadmap_line_speed_get(i32 %3, i32 %7)
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
double floor(double);
double dd_nint(double d) {
  if (d == floor(d))
    return d;
  return floor(d + 0.5);
}


x86 assembly (clang, -O0):
<dd_nint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    1158 <dd_nint+0x48>
jp     1158 <dd_nint+0x48>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116f <dd_nint+0x5f>
movsd  0xea0(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_nint>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
movsd  (%rsp),%xmm1
ucomisd %xmm1,%xmm0
movapd %xmm1,%xmm0
jne    112e <dd_nint+0x1e>
jp     112e <dd_nint+0x1e>
pop    %rax
ret
addsd  0xeca(%rip),%xmm0
pop    %rax
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @dd_nint(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = load double, double* %3
%6 = call double @llvm.floor.f64(double %5)
%7 = fcmp oeq double %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load double, double* %3
store double %9, double* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fadd double %11, 5.000000e-01
%13 = call double @llvm.floor.f64(double %12)
store double %13, double* %2
br label %14
14: ; preds = %10, %8
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @dd_nint(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fcmp oeq double %2, %0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = fadd double %0, 5.000000e-01
%6 = tail call double @llvm.floor.f64(double %5)
br label %7
7: ; preds = %1, %4
%8 = phi double [ %6, %4 ], [ %0, %1 ]
ret double %8
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long long quot;
  long long rem;
};
typedef TYPE_1__ lldiv_t;

/* Variables and functions */
lldiv_t lldiv(long long int numer, long long int denom) {
  lldiv_t rc;
  rc.quot = numer / denom;
  rc.rem = numer % denom;
  return rc;
}


x86 assembly (clang, -O0):
<lldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<lldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <lldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define { i64, i64 } @lldiv(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = sdiv i64 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = srem i64 %10, %11
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i64 %12, i64* %13
%14 = bitcast %struct.TYPE_3__* %3 to { i64, i64 }*
%15 = load { i64, i64 }, { i64, i64 }* %14
ret { i64, i64 } %15
}

LLVM IR (-O2):
define { i64, i64 } @lldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = srem i64 %0, %1
%5 = insertvalue { i64, i64 } poison, i64 %3, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
unsigned long insert_bdm(unsigned long insn, long value, const char **errmsg) {
  if ((value & 0x8000) != 0)
    insn |= 1 << 21;
  return insn | (value & 0xfffc);
}


x86 assembly (clang, -O0):
<insert_bdm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x8000,%rax
cmp    $0x0,%rax
je     1132 <insert_bdm+0x32>
mov    -0x8(%rbp),%rax
or     $0x200000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0xfffc,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_bdm>:
mov    %esi,%eax
shl    $0x6,%eax
and    $0x200000,%eax
and    $0xfffc,%esi
or     %rdi,%rsi
or     %rsi,%rax
ret

LLVM IR (-O0):
define i64 @insert_bdm(i64 %0, i64 %1, i8** %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8**
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%7 = load i64, i64* %5
%8 = and i64 %7, 32768
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i64, i64* %4
%12 = or i64 %11, 2097152
store i64 %12, i64* %4
br label %13
13: ; preds = %10, %3
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = and i64 %15, 65532
%17 = or i64 %14, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @insert_bdm(i64 %0, i64 %1, i8** nocapture readnone %2) {
%4 = shl i64 %1, 6
%5 = and i64 %4, 2097152
%6 = and i64 %1, 65532
%7 = or i64 %6, %0
%8 = or i64 %7, %5
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char name[] = "Martin";
  printf("My name is %s.\n", name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xb(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x6e6974,0x3(%rsp)
movl   $0x7472614d,(%rsp)
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.name = [7 x i8] c"Martin\00"
@.str = [16 x i8] c"My name is %s.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
store i32 0, i32* %1
%3 = bitcast [7 x i8]* %2 to i8*
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.name = [7 x i8] c"Martin\00"
@.str = [16 x i8] c"My name is %s.\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_exit() { printf("my_exit func\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"my_exit func\00"
define void @my_exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
double SFMMPCToFPS(double mpc) {
  return (mpc * (3.280833 * (double)(1000 * 1000) / 1000000.0));
}


x86 assembly (clang, -O0):
<SFMMPCToFPS>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @SFMMPCToFPS(double %0) {
%2 = fmul double %0, 0x400A3F255F3519BD
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int get_int32(FILE *fp) {
  return (fgetc(fp) | (fgetc(fp) << 8) | (fgetc(fp) << 16) | (fgetc(fp) << 24));
}


x86 assembly (clang, -O0):
<get_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x18,%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int32>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <fgetc@plt>
mov    %eax,%r14d
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
or     %r14d,%ebp
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
mov    %r15,%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
or     %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_int32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fgetc(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
%7 = shl i32 %6, 8
%8 = or i32 %4, %7
%9 = load i32*, i32** %2
%10 = call i32 @fgetc(i32* %9)
%11 = shl i32 %10, 16
%12 = or i32 %8, %11
%13 = load i32*, i32** %2
%14 = call i32 @fgetc(i32* %13)
%15 = shl i32 %14, 24
%16 = or i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_int32(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @fgetc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
%6 = tail call i32 @fgetc(i32* %0)
%7 = shl i32 %6, 16
%8 = or i32 %5, %7
%9 = tail call i32 @fgetc(i32* %0)
%10 = shl i32 %9, 24
%11 = or i32 %8, %10
ret i32 %11
}
void gtk_tool_item_set_homogeneous() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_item_set_homogeneous() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inc_count(int *);
int main() {
  int count = 0;
  while (count < 10)
    inc_count(&count);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    113e <main+0x2e>
lea    -0x8(%rbp),%rdi
call   1030 <inc_count@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <inc_count@plt>
cmpl   $0xa,0xc(%rsp)
jl     1130 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @inc_count(i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 10
br i1 %6, label %3, label %7
7: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ im_a_minion_01();
int /*<<< orphan*/ im_a_minion_02();
int /*<<< orphan*/ im_a_minion_03();
void testFuncStatementsinmple(void) {
  int int1 = 1U;
  int int2 = 2U;
  int int3 = 3U;
  int1 = int2 + int3;
  int2 = int1 + int2;
  int3 = int2 + int3;
  im_a_minion_01();
  im_a_minion_02();
  im_a_minion_03();
}


x86 assembly (clang, -O0):
<testFuncStatementsinmple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <im_a_minion_01@plt>
mov    $0x0,%al
call   1050 <im_a_minion_02@plt>
mov    $0x0,%al
call   1030 <im_a_minion_03@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFuncStatementsinmple>:
push   %rax
xor    %eax,%eax
call   1040 <im_a_minion_01@plt>
xor    %eax,%eax
call   1050 <im_a_minion_02@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <im_a_minion_03@plt>

LLVM IR (-O0):
define void @testFuncStatementsinmple() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
store i32 %12, i32* %3
%13 = call i32 (...) @im_a_minion_01()
%14 = call i32 (...) @im_a_minion_02()
%15 = call i32 (...) @im_a_minion_03()
ret void
}

LLVM IR (-O2):
define void @testFuncStatementsinmple() {
%1 = tail call i32 (...) @im_a_minion_01()
%2 = tail call i32 (...) @im_a_minion_02()
%3 = tail call i32 (...) @im_a_minion_03()
ret void
}
int test(int a, int b, int sum) {
  sum += ((a - b) > 0 ? (a - b) : -(a - b));
  return sum;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
jle    112a <test+0x2a>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <test+0x37>
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    %esi,%edi
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %0, %1
%5 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = add nsw i32 %5, %2
ret i32 %6
}