xunge/DecIR huggingface dataset:
int main(void) {
  int *zeiger;
  int zahl;
  zeiger = &zahl;
  *zeiger = 12;
  printf("Zahl = %d\n", zahl);
  printf("Adresse auf die Zeiger zeigt (hex- Format) = %x \n", &zeiger);
  printf(
      "Zahl die unter der Adresse gespeichert ist auf die Zeiger zeigt = %d\n",
      *zeiger);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xc,(%rax)
mov    -0x14(%rbp),%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rax
mov    %rax,0x10(%rsp)
movl   $0xc,0xc(%rsp)
lea    0xed3(%rip),%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rax
mov    (%rax),%esi
lea    0xee3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Zahl = %d\0A\00"
@.str.1 = [50 x i8] c"Adresse auf die Zeiger zeigt (hex- Format) = %x \0A\00"
@.str.2 = [70 x i8] c"Zahl die unter der Adresse gespeichert ist auf die Zeiger zeigt = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
store i32* %3, i32** %2
%4 = load i32*, i32** %2
store i32 12, i32* %4
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32** %2)
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Zahl = %d\0A\00"
@.str.1 = [50 x i8] c"Adresse auf die Zeiger zeigt (hex- Format) = %x \0A\00"
@.str.2 = [70 x i8] c"Zahl die unter der Adresse gespeichert ist auf die Zeiger zeigt = %d\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = bitcast i32** %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32* %2, i32** %1
store i32 12, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 12)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32** %1)
%7 = load i32*, i32** %1
%8 = load i32, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
double exp(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double x;
  double result;
  printf("x: ");
  scanf("%lf", &x);
  result = exp(x);
  printf("exp(%lf) = %lf\n", x, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe8b(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
lea    0xea1(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"x: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [16 x i8] c"exp(%lf) = %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call double @exp(double %5)
%7 = load double, double* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %7, double %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ptext(char *);
int /*<<< orphan*/ ptextln(char *);
int /*<<< orphan*/ put_crlf();
void ansi_report_help(void) {
  ptext("Begin ANSI status report testing. ");
  ptext(" Parity bit set will be displayed in reverse video. ");
  ptext(" If the terminal hangs, hit any alphabetic key. ");
  ptextln(" Use n to continue testing.  Use q to quit.");
  put_crlf();
}


x86 assembly (clang, -O0):
<ansi_report_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <ptext@plt>
lea    0xedc(%rip),%rdi
call   1040 <ptext@plt>
lea    0xf05(%rip),%rdi
call   1040 <ptext@plt>
lea    0xf2a(%rip),%rdi
call   1030 <ptextln@plt>
mov    $0x0,%al
call   1050 <put_crlf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ansi_report_help>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <ptext@plt>
lea    0xedf(%rip),%rdi
call   1040 <ptext@plt>
lea    0xf08(%rip),%rdi
call   1040 <ptext@plt>
lea    0xf2d(%rip),%rdi
call   1030 <ptextln@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <put_crlf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Begin ANSI status report testing. \00"
@.str.1 = [53 x i8] c" Parity bit set will be displayed in reverse video. \00"
@.str.2 = [49 x i8] c" If the terminal hangs, hit any alphabetic key. \00"
@.str.3 = [44 x i8] c" Use n to continue testing. Use q to quit.\00"
define void @ansi_report_help() {
%1 = call i32 @ptext(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @ptext(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @ptext(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @ptextln(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 (...) @put_crlf()
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Begin ANSI status report testing. \00"
@.str.1 = [53 x i8] c" Parity bit set will be displayed in reverse video. \00"
@.str.2 = [49 x i8] c" If the terminal hangs, hit any alphabetic key. \00"
@.str.3 = [44 x i8] c" Use n to continue testing. Use q to quit.\00"
define void @ansi_report_help() {
%1 = tail call i32 @ptext(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ptext(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @ptext(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @ptextln(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 (...) @put_crlf()
ret void
}
void pr6013_6035_test(void *p) {
  unsigned int foo;
  foo = ((long)(p));
  (void)foo;
}


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

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

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

LLVM IR (-O2):
define void @pr6013_6035_test(i8* nocapture %0) {
ret void
}
long char_a2d(string, number)
char string[];
double *number;
{
  long status;
  double a2d();
  *number = a2d(string, &status);
  return (status);
}


x86 assembly (clang, -O0):
<char_a2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <a2d@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_a2d>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <a2d@plt>
movsd  %xmm0,(%rbx)
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @char_a2d(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
%5 = alloca i64
store i8* %0, i8** %3
store double* %1, double** %4
%6 = load i8*, i8** %3
%7 = call double (i8*, i64*, ...) bitcast (double (...)* @a2d to double (i8*, i64*, ...)*)(i8* %6, i64* %5)
%8 = load double*, double** %4
store double %7, double* %8
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @char_a2d(i8* %0, double* nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call double (i8*, i64*, ...) bitcast (double (...)* @a2d to double (i8*, i64*, ...)*)(i8* %0, i64* %3)
store double %5, double* %1
%6 = load i64, i64* %3
ret i64 %6
}
void PATMR3AllowPatching(void) {}


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

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

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

LLVM IR (-O2):
define void @PATMR3AllowPatching() {
ret void
}
double power6(double a, double b) { return __builtin_copysign(a, b); }


x86 assembly (clang, -O0):
<power6>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<power6>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @power6(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.copysign.f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @power6(double %0, double %1) {
%3 = tail call double @llvm.copysign.f64(double %0, double %1)
ret double %3
}
/* Variables and functions */
double atof(char *);
double exp(double);
double e(void (*f)(char *)) {
  char tmp[10];
  double x;
  f(tmp);
  x = atof(tmp);
  return exp(x);
}


x86 assembly (clang, -O0):
<e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    -0x12(%rbp),%rdi
call   *%rax
lea    -0x12(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rax
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   *%rax
mov    %rbx,%rdi
call   1030 <atof@plt>
call   1040 <exp@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @e(void (i8*)* %0) {
%2 = alloca void (i8*)*
%3 = alloca [10 x i8]
%4 = alloca double
store void (i8*)* %0, void (i8*)** %2
%5 = load void (i8*)*, void (i8*)** %2
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = call double @atof(i8* %7)
store double %8, double* %4
%9 = load double, double* %4
%10 = call double @exp(double %9)
ret double %10
}

LLVM IR (-O2):
define double @e(void (i8*)* nocapture %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call double @atof(i8* %3)
%5 = call double @exp(double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ loop();
int /*<<< orphan*/ setup();
void main() {
  initialize();
  setup();
  for (;;)
    loop();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initialize@plt>
mov    $0x0,%al
call   1050 <setup@plt>
mov    $0x0,%al
call   1030 <loop@plt>
jmp    1142 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <initialize@plt>
xor    %eax,%eax
call   1050 <setup@plt>
nop
xor    %eax,%eax
call   1030 <loop@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @initialize()
%2 = call i32 (...) @setup()
br label %3
3: ; preds = %3, %0
%4 = call i32 (...) @loop()
br label %3
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @initialize()
%2 = tail call i32 (...) @setup()
br label %3
3: ; preds = %3, %0
%4 = tail call i32 (...) @loop()
br label %3
}
int foo() { int x = 5; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
void CursorColumn(HowMuch) int HowMuch;
{
  char Str[10];
  if (HowMuch == 0)
    return;
  sprintf(Str, "\033[%dG", HowMuch);
  WRITETEST(Str);
}


x86 assembly (clang, -O0):
<CursorColumn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <CursorColumn+0x1a>
jmp    115a <CursorColumn+0x3a>
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0xe(%rbp),%rdi
mov    $0x0,%al
call   1030 <WRITETEST@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CursorColumn>:
test   %edi,%edi
je     1150 <CursorColumn+0x30>
push   %rbx
sub    $0x10,%rsp
mov    %edi,%edx
lea    0xece(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <WRITETEST@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dG\00"
define void @CursorColumn(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %13
7: ; preds = %1
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %11)
br label %13
13: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dG\00"
define void @CursorColumn(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = icmp eq i32 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %3)
br label %8
8: ; preds = %1, %5
ret void
}
int test_imm_41int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x41 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_41int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 65
%7 = icmp ne i64 %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_41int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 279172874240
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double erf(double);
double sqrt(double);
double normal(double x, double mu, double sigma) {
  return .5 + .5 * erf((x - mu) / (sqrt(2.0) * sigma));
}


x86 assembly (clang, -O0):
<normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeba(%rip),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1040 <erf@plt>
movsd  0xe8f(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal>:
push   %rax
subsd  %xmm1,%xmm0
mulsd  0xee3(%rip),%xmm2
divsd  %xmm2,%xmm0
call   1030 <erf@plt>
movsd  0xeda(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @normal(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = call double @sqrt(double 2.000000e+00)
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = fdiv double %9, %12
%14 = call double @erf(double %13)
%15 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %14, double 5.000000e-01)
ret double %15
}

LLVM IR (-O2):
define double @normal(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fmul double %2, 0x3FF6A09E667F3BCD
%6 = fdiv double %4, %5
%7 = tail call double @erf(double %6)
%8 = tail call double @llvm.fmuladd.f64(double %7, double 5.000000e-01, double 5.000000e-01)
ret double %8
}
/* Variables and functions */
unsigned int strlen(const char *str) {
  register const char *s;
  for (s = str; *s; ++s)
    ;
  return (unsigned int)((int)s - (int)str);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <strlen+0x33>
jmp    1122 <strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = trunc i64 %8 to i32
%10 = ptrtoint i8* %0 to i64
%11 = trunc i64 %10 to i32
%12 = sub nsw i32 %9, %11
ret i32 %12
}
int mumps_numa_return() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mumps_numa_return() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ transfer(int, int);
void f_int(void) { transfer(0x98000000, 2); }


x86 assembly (clang, -O0):
<f_int>:
push   %rbp
mov    %rsp,%rbp
mov    $0x98000000,%edi
mov    $0x2,%esi
call   1030 <transfer@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f_int() {
%1 = call i32 @transfer(i32 -1744830464, i32 2)
ret void
}

LLVM IR (-O2):
define void @f_int() {
%1 = tail call i32 @transfer(i32 -1744830464, i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ os_snprintf(char *, int, char *, int /*<<< orphan*/);
char *os_GetErrorString(int e) {
  static char buf[64];
  os_snprintf(buf, sizeof(buf), "Error %d", errno);
  return buf;
}


x86 assembly (clang, -O0):
<os_GetErrorString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%ecx
lea    0x2f15(%rip),%rdi
mov    $0x40,%esi
lea    0xec9(%rip),%rdx
call   1030 <os_snprintf@plt>
lea    0x2efd(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_GetErrorString>:
push   %rbx
mov    0x2ec8(%rip),%rax
mov    (%rax),%ecx
lea    0x2f1f(%rip),%rbx
lea    0xed8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <os_snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@os_GetErrorString.buf = internal global [64 x i8] zeroinitializer
@.str = [9 x i8] c"Error %d\00"
@errno = global i32 0
define i8* @os_GetErrorString(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @errno
%4 = call i32 @os_snprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @os_GetErrorString.buf, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @os_GetErrorString.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@os_GetErrorString.buf = internal global [64 x i8] zeroinitializer
@.str = [9 x i8] c"Error %d\00"
@errno = global i32 0
define i8* @os_GetErrorString(i32 %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @os_snprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @os_GetErrorString.buf, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @os_GetErrorString.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ scroll(int /*<<< orphan*/);
int /*<<< orphan*/ scrollok(int /*<<< orphan*/, int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int /*<<< orphan*/ stdscr;
void sigint_handler(int dummy) {
  signal(SIGINT, sigint_handler);
  scrollok(stdscr, 1);
  scroll(stdscr);
  refresh();
  endwin();
  exit(1);
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    0x2e55(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1050 <scrollok@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
call   1080 <scroll@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rbx
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    0x2e5f(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e63(%rip),%rbx
mov    (%rbx),%edi
mov    $0x1,%esi
call   1050 <scrollok@plt>
mov    (%rbx),%edi
call   1080 <scroll@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@stdscr = global i32 0
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGINT
%4 = call i32 @signal(i32 %3, void (i32)* @sigint_handler)
%5 = load i32, i32* @stdscr
%6 = call i32 @scrollok(i32 %5, i32 1)
%7 = load i32, i32* @stdscr
%8 = call i32 @scroll(i32 %7)
%9 = call i32 (...) @refresh()
%10 = call i32 (...) @endwin()
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@SIGINT = global i32 0
@stdscr = global i32 0
define void @sigint_handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = tail call i32 @signal(i32 %2, void (i32)* @sigint_handler)
%4 = load i32, i32* @stdscr
%5 = tail call i32 @scrollok(i32 %4, i32 1)
%6 = load i32, i32* @stdscr
%7 = tail call i32 @scroll(i32 %6)
%8 = tail call i32 (...) @refresh()
%9 = tail call i32 (...) @endwin()
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void ctrlC_signal_handler(int sig) {
  printf("Ctrl-C pressed\n");
  printf("Bye Bye\n");
  exit(0);
}


x86 assembly (clang, -O0):
<ctrlC_signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ctrlC_signal_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Ctrl-C pressed\0A\00"
@.str.1 = [9 x i8] c"Bye Bye\0A\00"
define void @ctrlC_signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [15 x i8] c"Ctrl-C pressed\00"
@str.2 = [8 x i8] c"Bye Bye\00"
define void @ctrlC_signal_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_DETACH;
int ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
           int /*<<< orphan*/);
int ptrace_detach(pid_t pid) { return ptrace(PTRACE_DETACH, pid, NULL, 0); }


x86 assembly (clang, -O0):
<ptrace_detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_detach>:
mov    %edi,%esi
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
@PTRACE_DETACH = global i32 0
define i32 @ptrace_detach(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PTRACE_DETACH
%4 = load i32, i32* %2
%5 = call i32 @ptrace(i32 %3, i32 %4, i32* null, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@PTRACE_DETACH = global i32 0
define i32 @ptrace_detach(i32 %0) {
%2 = load i32, i32* @PTRACE_DETACH
%3 = tail call i32 @ptrace(i32 %2, i32 %0, i32* null, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ acquire();
int d2mce_acq() {
  acquire();
  return 1;
}


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

x86 assembly (clang, -O2):
<d2mce_acq>:
push   %rax
xor    %eax,%eax
call   1030 <acquire@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @d2mce_acq() {
%1 = tail call i32 (...) @acquire()
ret i32 1
}
/* Variables and functions */
scalar_t__ pr_random();
double pr_random_f(double range) {
  return ((double)pr_random() / (double)714025) * range;
}


x86 assembly (clang, -O0):
<pr_random_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <pr_random@plt>
cvtsi2sd %rax,%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_random_f>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <pr_random@plt>
cvtsi2sd %rax,%xmm1
divsd  0xed6(%rip),%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @pr_random_f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i64 (...) @pr_random()
%4 = sitofp i64 %3 to double
%5 = fdiv double %4, 7.140250e+05
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @pr_random_f(double %0) {
%2 = tail call i64 (...) @pr_random()
%3 = sitofp i64 %2 to double
%4 = fdiv double %3, 7.140250e+05
%5 = fmul double %4, %0
ret double %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int hexadecimal = 0xFE;
  printf("%d\n", hexadecimal);
  return (EXIT_SUCCESS);
}


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   $0xfe,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 254)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char name[10];
  scanf("%s", name);
  printf("hello, %s\n", name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0xe(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0x6(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"hello, %s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
unsigned int UINT_MAX;
unsigned int sat_add(unsigned int x, unsigned int y) {
  return x + y >= x ? x + y : UINT_MAX;
}


x86 assembly (clang, -O0):
<sat_add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jb     1127 <sat_add+0x27>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <sat_add+0x33>
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sat_add>:
mov    %edi,%eax
add    %esi,%eax
jae    110f <sat_add+0xf>
mov    0x2edb(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
define i32 @sat_add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add i32 %5, %6
%8 = load i32, i32* %3
%9 = icmp uge i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = add i32 %11, %12
br label %16
14: ; preds = %2
%15 = load i32, i32* @UINT_MAX
br label %16
16: ; preds = %14, %10
%17 = phi i32 [ %13, %10 ], [ %15, %14 ]
ret i32 %17
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
define i32 @sat_add(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = icmp ult i32 %3, %0
%5 = load i32, i32* @UINT_MAX
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
void huawei_reserve(void) {}


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

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

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

LLVM IR (-O2):
define void @huawei_reserve() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ss2sfra(float);
void ss2sfra_(float *rot) { ss2sfra(*rot); }


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

x86 assembly (clang, -O2):
<ss2sfra_>:
movss  (%rdi),%xmm0
jmp    1030 <ss2sfra@plt>

LLVM IR (-O0):
define void @ss2sfra_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = call i32 @ss2sfra(float %4)
ret void
}

LLVM IR (-O2):
define void @ss2sfra_(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call i32 @ss2sfra(float %2)
ret void
}
const char *ls_cost_nm3_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_cost_nm3_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_cost_nm3_name_out+0x2b>
jmp    111a <ls_cost_nm3_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_cost_nm3_name_out+0x3b>
jmp    114b <ls_cost_nm3_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm3_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm3_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm3_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_cost_nm3_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_cost_nm3_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void bit() {
  char a = 'a';
  printf("%c", a & 0x4F);
  printf("%c", a | 0x4F);
  printf("%c", a ^ 0x4F);
  printf("%c", (a ^ 0x4F) ^ 0x4F);
  printf("\n");
}


x86 assembly (clang, -O0):
<bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0x1(%rbp)
movsbl -0x1(%rbp),%esi
and    $0x4f,%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%esi
or     $0x4f,%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%esi
xor    $0x4f,%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%esi
xor    $0x4f,%esi
xor    $0x4f,%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit>:
push   %rax
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @bit() {
%1 = alloca i8
store i8 97, i8* %1
%2 = load i8, i8* %1
%3 = sext i8 %2 to i32
%4 = and i32 %3, 79
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = or i32 %7, 79
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = xor i32 %11, 79
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i8, i8* %1
%15 = sext i8 %14 to i32
%16 = xor i32 %15, 79
%17 = xor i32 %16, 79
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @bit() {
%1 = tail call i32 @putchar(i32 65)
%2 = tail call i32 @putchar(i32 111)
%3 = tail call i32 @putchar(i32 46)
%4 = tail call i32 @putchar(i32 97)
%5 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_mainloop_prepare() {
  printf("NOT IMPLEMENTED:"
         "pa_mainloop_prepare"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"NOT IMPLEMENTED:pa_mainloop_prepare\0A\00"
define i32 @pa_mainloop_prepare() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_mainloop_prepare\00"
define i32 @pa_mainloop_prepare() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void viper_callback_del_event(void *data, void *anything) {
  free(data);
  (void)anything;
  return;
}


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

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

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

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

/* Variables and functions */
int epoll_wait(int, struct epoll_event *, int, int);
int /*<<< orphan*/ err_sys(char *);
int vn_epoll_wait(int epfd, struct epoll_event *events, int maxevents,
                  int timeout) {
  int nready;
  if ((nready = epoll_wait(epfd, events, maxevents, timeout)) < 0) {
    err_sys("[vn_epoll_wait] epoll_wait error");
  }
  return nready;
}


x86 assembly (clang, -O0):
<vn_epoll_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <epoll_wait@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    115f <vn_epoll_wait+0x3f>
lea    0xea6(%rip),%rdi
call   1030 <err_sys@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vn_epoll_wait>:
push   %rbx
call   1040 <epoll_wait@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <vn_epoll_wait+0x18>
lea    0xecd(%rip),%rdi
call   1030 <err_sys@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
@.str = [33 x i8] c"[vn_epoll_wait] epoll_wait error\00"
define i32 @vn_epoll_wait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.epoll_event*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store %struct.epoll_event* %1, %struct.epoll_event** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load %struct.epoll_event*, %struct.epoll_event** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @epoll_wait(i32 %10, %struct.epoll_event* %11, i32 %12, i32 %13)
store i32 %14, i32* %9
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %4
%17 = call i32 @err_sys(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %4
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
@.str = [33 x i8] c"[vn_epoll_wait] epoll_wait error\00"
define i32 @vn_epoll_wait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3) {
%5 = tail call i32 @epoll_wait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @err_sys(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_remove_autoload_by_index() {
  printf("NOT IMPLEMENTED:"
         "pa_context_remove_autoload_by_index"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"NOT IMPLEMENTED:pa_context_remove_autoload_by_index\0A\00"
define i32 @pa_context_remove_autoload_by_index() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [52 x i8] c"NOT IMPLEMENTED:pa_context_remove_autoload_by_index\00"
define i32 @pa_context_remove_autoload_by_index() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
float min_float(float x, float y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<min_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <min_float+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <min_float+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_float>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @min_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @min_float(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int close(int);
int closeSerialPort(int fd) {
  int res = 0;
  res = close(fd);
  return (res);
}


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

x86 assembly (clang, -O2):
<closeSerialPort>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define i32 @closeSerialPort(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @closeSerialPort(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void delay(void) { asm __volatile__(""); }


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

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

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

LLVM IR (-O2):
define void @delay() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}