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

/* Variables and functions */
int /*<<< orphan*/ ESPIPE;
int /*<<< orphan*/ errno;
__attribute__((weak)) off_t _lseek(int fd, off_t offset, int whence) {
  (void)fd;
  (void)offset;
  (void)whence;
  errno = ESPIPE;
  return ((off_t)-1);
}


x86 assembly (clang, -O0):
<_lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ed4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebb(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lseek>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ESPIPE = global i32 0
@errno = global i32 0
define weak i32 @_lseek(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 = load i32, i32* %6
%10 = load i32, i32* @ESPIPE
store i32 %10, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ESPIPE = global i32 0
@errno = global i32 0
define weak i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ESPIPE
store i32 %4, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int eul03(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  uint64_t n = 600851475143;
  printf("%d\n", eul03(n));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xe589eac7,%edi
call   1040 <eul03@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
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 -443946297, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @eul03(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @eul03(i32 -443946297)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
char HexDigit(int Value) {
  if ((Value >= 0) && (Value < 10))
    return Value + '0';
  else
    return Value - 10 + 'A';
}


x86 assembly (clang, -O0):
<HexDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1129 <HexDigit+0x29>
cmpl   $0xa,-0x8(%rbp)
jge    1129 <HexDigit+0x29>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1135 <HexDigit+0x35>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HexDigit>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x37,%eax
cmovb  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @HexDigit(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 48
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %18
13: ; preds = %6, %1
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 10
%16 = add nsw i32 %15, 65
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %18
18: ; preds = %13, %9
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @HexDigit(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 55
%5 = add i8 %4, %3
ret i8 %5
}
int test_imm_A4uint8_reg(unsigned char val) {
  return ((val) & (-0xA4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A4uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff5c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_A4uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -164
%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_A4uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 92
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double sqrt(double);
double modul(double aX, double aY) { return sqrt(aX * aX + aY * aY); }


x86 assembly (clang, -O0):
<modul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modul>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <modul+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @modul(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* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @modul(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
void fc90(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    }
    goto a;
  a:;
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc90(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %1
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
%20 = load i32, i32* %2
%21 = zext i32 %20 to i64
ret void
}

LLVM IR (-O2):
define void @fc90(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ getppid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void glb_daemon_ok() {
  pid_t parent;
  parent = getppid();
  kill(parent, SIGUSR1);
}


x86 assembly (clang, -O0):
<glb_daemon_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getppid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glb_daemon_ok>:
push   %rax
xor    %eax,%eax
call   1040 <getppid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
define void @glb_daemon_ok() {
%1 = alloca i32
%2 = call i32 (...) @getppid()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @SIGUSR1
%5 = call i32 @kill(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define void @glb_daemon_ok() {
%1 = tail call i32 (...) @getppid()
%2 = load i32, i32* @SIGUSR1
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CtpRoutingEngineP__0__CtpInfo__triggerRouteUpdate();
void CtpForwardingEngineP__0__CtpInfo__triggerRouteUpdate(void) {
  CtpRoutingEngineP__0__CtpInfo__triggerRouteUpdate();
}


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

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

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

LLVM IR (-O2):
define void @CtpForwardingEngineP__0__CtpInfo__triggerRouteUpdate() {
%1 = tail call i32 (...) @CtpRoutingEngineP__0__CtpInfo__triggerRouteUpdate()
ret void
}
vdaabu(button) int *button;
{ vdbufl(); }


x86 assembly (clang, -O0):
<vdaabu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <vdbufl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @vdaabu(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @vdbufl()
ret i32 undef
}
int f_bun_cr1(float a1) { return (__builtin_isunordered(100, a1)); }


x86 assembly (clang, -O0):
<f_bun_cr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bun_cr1>:
xor    %eax,%eax
ucomiss %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @f_bun_cr1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp uno float 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_bun_cr1(float %0) {
%2 = fcmp uno float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
void SWAP2(char **p_1, char **p_2) {
  char *tmp;
  tmp = *p_1;
  *p_1 = *p_2;
  *p_2 = tmp;
}


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

x86 assembly (clang, -O2):
<SWAP2>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @SWAP2(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @SWAP2(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Type definitions */
typedef int time_t;
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, struct timezone *);
time_t time(time_t *t) {
  struct timeval tt;
  if (gettimeofday(&tt, (struct timezone *)0) < 0)
    return (-1);
  if (t)
    *t = tt.tv_sec;
  return (tt.tv_sec);
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jge    113f <time+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <time+0x49>
cmpq   $0x0,-0x10(%rbp)
je     1153 <time+0x43>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
js     1136 <time+0x26>
mov    0x8(%rsp),%eax
test   %rbx,%rbx
je     113b <time+0x2b>
mov    %eax,(%rbx)
jmp    113b <time+0x2b>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @time(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca %struct.timeval
store i32* %0, i32** %3
%5 = call i64 @gettimeofday(%struct.timeval* %4, %struct.timezone* null)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %18
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load i32*, i32** %3
store i32 %13, i32* %14
br label %15
15: ; preds = %11, %8
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%17 = load i32, i32* %16
store i32 %17, i32* %2
br label %18
18: ; preds = %15, %7
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @time(i32* writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i64 @gettimeofday(%struct.timeval* %2, %struct.timezone* null)
%5 = icmp slt i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = icmp eq i32* %0, null
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%9 = load i32, i32* %8
br i1 %7, label %11, label %10
10: ; preds = %6
store i32 %9, i32* %0
br label %11
11: ; preds = %6, %10, %1
%12 = phi i32 [ -1, %1 ], [ %9, %10 ], [ %9, %6 ]
ret i32 %12
}
void SDB_dbg_help() {}


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

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

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

LLVM IR (-O2):
define void @SDB_dbg_help() {
ret void
}
int test_imm_E7uint16_mem(unsigned short *val) {
  return ((*val) & (-0xE7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E7uint16_mem>:
movzwl (%rdi),%eax
test   $0xff19,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E7uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -231
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ pipe(int *);
int /*<<< orphan*/ redirect(int, int *);
int /*<<< orphan*/ sink();
int /*<<< orphan*/ source();
int main(void) {
  int pd[2];
  pipe(pd);
  if (fork()) {
    redirect(0, pd);
    sink();
  } else {
    redirect(1, pd);
    source();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <pipe@plt>
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0x0,%rax
je     1190 <main+0x40>
lea    -0xc(%rbp),%rsi
xor    %edi,%edi
call   1030 <redirect@plt>
mov    $0x0,%al
call   1050 <sink@plt>
jmp    11a5 <main+0x55>
lea    -0xc(%rbp),%rsi
mov    $0x1,%edi
call   1030 <redirect@plt>
mov    $0x0,%al
call   1070 <source@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1040 <pipe@plt>
xor    %eax,%eax
call   1060 <fork@plt>
mov    %rsp,%rsi
test   %rax,%rax
je     1178 <main+0x28>
xor    %edi,%edi
call   1030 <redirect@plt>
xor    %eax,%eax
call   1050 <sink@plt>
jmp    1189 <main+0x39>
mov    $0x1,%edi
call   1030 <redirect@plt>
xor    %eax,%eax
call   1070 <source@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%4 = call i32 @pipe(i32* %3)
%5 = call i64 (...) @fork()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%9 = call i32 @redirect(i32 0, i32* %8)
%10 = call i32 (...) @sink()
br label %15
11: ; preds = %0
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%13 = call i32 @redirect(i32 1, i32* %12)
%14 = call i32 (...) @source()
br label %15
15: ; preds = %11, %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @pipe(i32* %3)
%5 = call i64 (...) @fork()
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = call i32 @redirect(i32 0, i32* %3)
%9 = call i32 (...) @sink()
br label %13
10: ; preds = %0
%11 = call i32 @redirect(i32 1, i32* %3)
%12 = call i32 (...) @source()
br label %13
13: ; preds = %10, %7
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t pageFrame(uint64_t v) { return (v & (0x7FFFFFFFFFFFFF)); }


x86 assembly (clang, -O0):
<pageFrame>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x7fffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pageFrame(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = and i64 %4, 36028797018963967
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @pageFrame(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;

/* Variables and functions */
unsigned char *hash_hpav(int /*<<< orphan*/ *, unsigned char const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, ...);
int gen_passphrase(const char *password, u_int8_t *key,
                   const unsigned char *salt) {
  u_int8_t password_cpy[64 + 1];
  const unsigned char *password_hash;
  memcpy(password_cpy, password, 64);
  password_hash = hash_hpav(password_cpy, salt);
  memcpy(key, password_hash, 16);
  return 0;
}


x86 assembly (clang, -O0):
<gen_passphrase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    $0x40,%edx
call   1030 <memcpy@plt>
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <hash_hpav@plt>
mov    %rax,-0x128(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x128(%rbp),%rsi
xor    %eax,%eax
mov    $0x10,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_passphrase>:
push   %r15
push   %r14
push   %rbx
sub    $0x110,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x40,%edx
xor    %eax,%eax
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <hash_hpav@plt>
mov    %r14,%rdi
mov    %rax,%rsi
mov    $0x10,%edx
xor    %eax,%eax
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @gen_passphrase(i8* %0, i32* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca [65 x i32]
%8 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%9 = getelementptr inbounds [65 x i32], [65 x i32]* %7, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = call i32 (i32*, ...) @memcpy(i32* %9, i8* %10, i32 64)
%12 = getelementptr inbounds [65 x i32], [65 x i32]* %7, i64 0, i64 0
%13 = load i8*, i8** %6
%14 = call i8* @hash_hpav(i32* %12, i8* %13)
store i8* %14, i8** %8
%15 = load i32*, i32** %5
%16 = load i8*, i8** %8
%17 = call i32 (i32*, ...) @memcpy(i32* %15, i8* %16, i32 16)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_passphrase(i8* %0, i32* %1, i8* %2) {
%4 = alloca [65 x i32]
%5 = bitcast [65 x i32]* %4 to i8*
%6 = getelementptr inbounds [65 x i32], [65 x i32]* %4, i64 0, i64 0
%7 = call i32 (i32*, ...) @memcpy(i32* %6, i8* %0, i32 64)
%8 = call i8* @hash_hpav(i32* %6, i8* %2)
%9 = call i32 (i32*, ...) @memcpy(i32* %1, i8* %8, i32 16)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void sprint_orl_data_to_direct(char *str, uint8_t direct, uint8_t data) {
  sprintf(str,
          "ORL   "
          "0x%02X"
          ", #"
          "0x%02X"
          "               ",
          direct, data);
}


x86 assembly (clang, -O0):
<sprint_orl_data_to_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xecd(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_orl_data_to_direct>:
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"ORL 0x%02X,x%02X \00"
define void @sprint_orl_data_to_direct(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"ORL 0x%02X,x%02X \00"
define void @sprint_orl_data_to_direct(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
__main() {}


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

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

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

LLVM IR (-O2):
define i32 @__main() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print(int b) {
  printf("\n*");
  if (b > 0) {
    b--;
    print(b);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jle    1152 <print+0x32>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
test   %ebx,%ebx
jg     1120 <print+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0A*\00"
define void @print(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %3, 0
%6 = add nsw i32 %3, -1
br i1 %5, label %2, label %7
7: ; preds = %2
ret void
}
int dummy_init_modemctl_device(struct modem_ctl *mc, struct modem_data *pdata) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.modem_ctl = type opaque
%struct.modem_data = type opaque
define i32 @dummy_init_modemctl_device(%struct.modem_ctl* %0, %struct.modem_data* %1) {
%3 = alloca %struct.modem_ctl*
%4 = alloca %struct.modem_data*
store %struct.modem_ctl* %0, %struct.modem_ctl** %3
store %struct.modem_data* %1, %struct.modem_data** %4
ret i32 0
}

LLVM IR (-O2):
%struct.modem_ctl = type opaque
%struct.modem_data = type opaque
define i32 @dummy_init_modemctl_device(%struct.modem_ctl* nocapture readnone %0, %struct.modem_data* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct mas_int_stack {
  int dummy;
};
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ memset(struct mas_int_stack *, int /*<<< orphan*/, int);
void int_stack_init(struct mas_int_stack *s) { memset(s, 0, sizeof(s)); }


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

x86 assembly (clang, -O2):
<int_stack_init>:
xor    %esi,%esi
mov    $0x8,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
%struct.mas_int_stack = type { i32 }
define void @int_stack_init(%struct.mas_int_stack* %0) {
%2 = tail call i32 @memset(%struct.mas_int_stack* %0, i32 0, i32 8)
ret void
}
int shrfunc(int x) { return x * 10; }


x86 assembly (clang, -O0):
<shrfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xa,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shrfunc>:
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @shrfunc(i32 %0) {
%2 = mul nsw i32 %0, 10
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void end_doc(FILE *ofp) {
  fprintf(ofp, "\033%%-12345X@PJL\r\n");
  fprintf(ofp, "@PJL EOJ NAME = \"End \"\n");
  fprintf(ofp, "\033%%-12345X");
}


x86 assembly (clang, -O0):
<end_doc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeda(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xee2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_doc>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xeda(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\1B%%-12345X@PJL\0D\0A\00"
@.str.1 = [24 x i8] c"@PJL EOJ NAME = \22End \22\0A\00"
@.str.2 = [11 x i8] c"\1B%%-12345X\00"
define void @end_doc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\1B%%-12345X@PJL\0D\0A\00"
@.str.1 = [24 x i8] c"@PJL EOJ NAME = \22End \22\0A\00"
@.str.2 = [11 x i8] c"\1B%%-12345X\00"
define void @end_doc(i32* nocapture %0) {
%2 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i64 23, i64 1, i32* %0)
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jul2greg(double, int *, int *, int *, int *, int *,
                            double *);
int julian_get_day_of_month_number(double current) {
  int year, month, day, hour, minute;
  double seconds;
  jul2greg(current, &month, &day, &year, &hour, &minute, &seconds);
  return day;
}


x86 assembly (clang, -O0):
<julian_get_day_of_month_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
lea    -0x28(%rbp),%r9
call   1030 <jul2greg@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<julian_get_day_of_month_number>:
sub    $0x28,%rsp
lea    0x18(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x1c(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0x20(%rsp),%r9
call   1030 <jul2greg@plt>
mov    0xc(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @julian_get_day_of_month_number(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store double %0, double* %2
%9 = load double, double* %2
%10 = call i32 @jul2greg(double %9, i32* %4, i32* %5, i32* %3, i32* %6, i32* %7, double* %8)
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @julian_get_day_of_month_number(double %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast double* %7 to i8*
%14 = call i32 @jul2greg(double %0, i32* %3, i32* %4, i32* %2, i32* %5, i32* %6, double* %7)
%15 = load i32, i32* %4
ret i32 %15
}
void XSharpFontExtentsSet(void *fontSet, void *max_ink_return,
                          void *max_logical_return) {}


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

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

LLVM IR (-O0):
define void @XSharpFontExtentsSet(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @XSharpFontExtentsSet(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
int BT(int var, int pos) { return var & (1 << pos); }


x86 assembly (clang, -O0):
<BT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BT>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @BT(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 = shl i32 1, %6
%8 = and i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @BT(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int func15();
int func16() { return func15() + 1; }


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

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

LLVM IR (-O0):
define i32 @func16() {
%1 = call i32 (...) @func15()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @func16() {
%1 = tail call i32 (...) @func15()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ clearLCDLine(int);
int /*<<< orphan*/ wait1Msec(int);
void nothing() {
  wait1Msec(100);
  clearLCDLine(0);
  clearLCDLine(1);
}


x86 assembly (clang, -O0):
<nothing>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1040 <wait1Msec@plt>
xor    %edi,%edi
call   1030 <clearLCDLine@plt>
mov    $0x1,%edi
call   1030 <clearLCDLine@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nothing>:
push   %rax
mov    $0x64,%edi
call   1040 <wait1Msec@plt>
xor    %edi,%edi
call   1030 <clearLCDLine@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <clearLCDLine@plt>

LLVM IR (-O0):
define void @nothing() {
%1 = call i32 @wait1Msec(i32 100)
%2 = call i32 @clearLCDLine(i32 0)
%3 = call i32 @clearLCDLine(i32 1)
ret void
}

LLVM IR (-O2):
define void @nothing() {
%1 = tail call i32 @wait1Msec(i32 100)
%2 = tail call i32 @clearLCDLine(i32 0)
%3 = tail call i32 @clearLCDLine(i32 1)
ret void
}
/* Variables and functions */
double fatorial(double);
int /*<<< orphan*/ printf(char *, double, double);
int /*<<< orphan*/ scanf(char *, double *);
double main() {
  double n;
  scanf("%lf", &n);
  double f = fatorial(n);
  printf("N=%.0lf, F=%.0lf\n", n, f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <fatorial@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1040 <fatorial@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [18 x i8] c"N=%.0lf, F=%.0lf\0A\00"
define double @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = call double @fatorial(double %4)
%6 = load double, double* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %6, double %5)
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *,
                           int);
int /*<<< orphan*/ stderr;
int msg(char *t, char *fn, int line, char *m) {
  fprintf(stderr, "[%s] %s in %s:%d\n", t, m, fn, line);
  return 1;
}


x86 assembly (clang, -O0):
<msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x14(%rbp),%r9d
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg>:
push   %rax
mov    %edx,%r9d
mov    %rsi,%r8
mov    %rdi,%rdx
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"[%s] %s in %s:%d\0A\00"
define i32 @msg(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i8*, i8** %8
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i8* %12, i32 %13)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"[%s] %s in %s:%d\0A\00"
define i32 @msg(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3, i8* %1, i32 %2)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ work(char *);
int main() {
  char str1[] = {'h', 'e', 'l', 'l', 'o', '\0'};
  char str2[] = "world";
  work(str1);
  work(str2);
  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,-0xa(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0xc(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <work@plt>
lea    -0x10(%rbp),%rdi
call   1030 <work@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movw   $0x6f,0x14(%rsp)
movl   $0x6c6c6568,0x10(%rsp)
6c
movw   $0x64,0xc(%rsp)
movl   $0x6c726f77,0x8(%rsp)
6c
lea    0x10(%rsp),%rdi
call   1030 <work@plt>
lea    0x8(%rsp),%rdi
call   1030 <work@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.str1 = [6 x i8] c"hello\00"
@__const.main.str2 = [6 x i8] c"world\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [6 x i8]
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = bitcast [6 x i8]* %3 to i8*
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call i32 @work(i8* %6)
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%9 = call i32 @work(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [6 x i8] c"hello\00"
@__const.main.str2 = [6 x i8] c"world\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @work(i8* %3)
%6 = call i32 @work(i8* %4)
ret i32 0
}
/* Variables and functions */
double float_interval(double, double);
int main() {
  double S;
  while (1) {
    S = 0.8 * S + float_interval(-1.0, 1.0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <float_interval@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  0xeb2(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,-0x20(%rbp)
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm0,-0x10(%rbp)
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
call   1030 <float_interval@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = load double, double* %2
%5 = call double @float_interval(double -1.000000e+00, double 1.000000e+00)
%6 = call double @llvm.fmuladd.f64(double 8.000000e-01, double %4, double %5)
store double %6, double* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call double @float_interval(double -1.000000e+00, double 1.000000e+00)
br label %1
}
void test1i_setup() {}


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

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

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

LLVM IR (-O2):
define void @test1i_setup() {
ret void
}
int ori(int register2, int number) { return (register2 | number); }


x86 assembly (clang, -O0):
<ori>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ori>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @ori(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 = or i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ori(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
int do_047() { return 47; }


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

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

LLVM IR (-O0):
define i32 @do_047() {
ret i32 47
}

LLVM IR (-O2):
define i32 @do_047() {
ret i32 47
}
void foo776(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo776(i32 %0) {
ret void
}
/* Type definitions */
struct gate {
  int dummy;
};

/* Variables and functions */
int or_op(struct gate const *);
int nor_op(const struct gate *gate) {
  int truth = or_op(gate);
  return truth == -1 ? truth : !truth;
}


x86 assembly (clang, -O0):
<nor_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <or_op@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    113d <nor_op+0x2d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114e <nor_op+0x3e>
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nor_op>:
push   %rax
call   1030 <or_op@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
cmp    $0xffffffff,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.gate = type { i32 }
define i32 @nor_op(%struct.gate* %0) {
%2 = alloca %struct.gate*
%3 = alloca i32
store %struct.gate* %0, %struct.gate** %2
%4 = load %struct.gate*, %struct.gate** %2
%5 = call i32 @or_op(%struct.gate* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %10, %8
%16 = phi i32 [ %9, %8 ], [ %14, %10 ]
ret i32 %16
}

LLVM IR (-O2):
%struct.gate = type { i32 }
define i32 @nor_op(%struct.gate* %0) {
%2 = tail call i32 @or_op(%struct.gate* %0)
%3 = icmp eq i32 %2, -1
%4 = icmp eq i32 %2, 0
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
void swap(int *array, int i, int j) {
  int tmp = array[i];
  array[i] = array[j];
  array[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void window_park_emptysub() {}


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

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

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

LLVM IR (-O2):
define void @window_park_emptysub() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
int main(void) {
  int i;
  for (i = 0; i < 200; i++) {
    malloc(16);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jge    114b <main+0x3b>
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xc8,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x10,%edi
call   1030 <malloc@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
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 = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 200
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @malloc(i32 16)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @malloc(i32 16)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 200
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}