xunge/DecIR huggingface dataset:
double calc_temperature_c(unsigned int data) {
  double sensor_temp = data / 65536.0;
  return -46.85 + (175.72 * sensor_temp);
}


x86 assembly (clang, -O0):
<calc_temperature_c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xef9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecf(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_temperature_c>:
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
mulsd  0xef1(%rip),%xmm0
mulsd  0xef1(%rip),%xmm0
addsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calc_temperature_c(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = uitofp i32 %4 to double
%6 = fdiv double %5, 6.553600e+04
store double %6, double* %3
%7 = load double, double* %3
%8 = call double @llvm.fmuladd.f64(double 1.757200e+02, double %7, double -4.685000e+01)
ret double %8
}

LLVM IR (-O2):
define double @calc_temperature_c(i32 %0) {
%2 = uitofp i32 %0 to double
%3 = fmul double %2, 0x3EF0000000000000
%4 = tail call double @llvm.fmuladd.f64(double %3, double 1.757200e+02, double -4.685000e+01)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Print(char *);
scalar_t__ pocketfull();
int /*<<< orphan*/ take(int, int /*<<< orphan*/);
int snag(int itm) {
  if (pocketfull()) {
    Print("Hey, you can't carry any more.");
    return (0);
  } else {
    Print("Ok, here ya go.");
    take(itm, 0);
    return (1);
  }
}


x86 assembly (clang, -O0):
<snag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pocketfull@plt>
cmp    $0x0,%rax
je     1164 <snag+0x34>
lea    0xead(%rip),%rdi
call   1030 <Print@plt>
movl   $0x0,-0x4(%rbp)
jmp    1181 <snag+0x51>
lea    0xeb4(%rip),%rdi
call   1030 <Print@plt>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1040 <take@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snag>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <pocketfull@plt>
test   %rax,%rax
je     1151 <snag+0x21>
lea    0xeb6(%rip),%rdi
call   1030 <Print@plt>
jmp    116b <snag+0x3b>
lea    0xec7(%rip),%rdi
call   1030 <Print@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1040 <take@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Hey, you can't carry any more.\00"
@.str.1 = [16 x i8] c"Ok, here ya go.\00"
define i32 @snag(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @pocketfull()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @Print(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %12
8: ; preds = %1
%9 = call i32 @Print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %3
%11 = call i32 @take(i32 %10, i32 0)
store i32 1, i32* %2
br label %12
12: ; preds = %8, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [31 x i8] c"Hey, you can't carry any more.\00"
@.str.1 = [16 x i8] c"Ok, here ya go.\00"
define i32 @snag(i32 %0) {
%2 = tail call i64 (...) @pocketfull()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @Print(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %9
6: ; preds = %1
%7 = tail call i32 @Print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @take(i32 %0, i32 0)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ 0, %4 ], [ 1, %6 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printusage(char *name) {
  printf("Usage : %s [-r abc] [-p p1,p2,p3] <input file>\n", name);
}


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

x86 assembly (clang, -O2):
<printusage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Usage : %s [-r abc] [-p p1,p2,p3] <input file>\0A\00"
define void @printusage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Usage : %s [-r abc] [-p p1,p2,p3] <input file>\0A\00"
define void @printusage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ function1(int);
int main(int argc __attribute__((unused)),
         char **argv __attribute__((unused))) {
  for (int x = -120; x <= 100; x++) {
    function1(x);
  }
  return -100;
}


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   $0xffffff88,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     114d <main+0x3d>
mov    -0x14(%rbp),%edi
call   1030 <function1@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    $0xffffff9c,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffff23,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    0x65(%rbx),%edi
call   1030 <function1@plt>
inc    %ebx
jne    1120 <main+0x10>
mov    $0xffffff9c,%eax
pop    %rbx
ret

LLVM IR (-O0):
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 -120, i32* %6
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %6
%9 = icmp sle i32 %8, 100
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %6
%12 = call i32 @function1(i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
br label %7
16: ; preds = %7
ret i32 -100
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %4
3: ; preds = %4
ret i32 -100
4: ; preds = %2, %4
%5 = phi i32 [ -120, %2 ], [ %7, %4 ]
%6 = tail call i32 @function1(i32 %5)
%7 = add nsw i32 %5, 1
%8 = icmp eq i32 %7, 101
br i1 %8, label %3, label %4
}
/* Type definitions */
struct sembuf {
  int member_0;
  int member_1;
  int /*<<< orphan*/ member_2;
};

/* Variables and functions */
int semop(int, struct sembuf *, int);
int unlock(int sem_id, int sem_num) {
  struct sembuf command = {sem_num, 1, 0};
  return semop(sem_id, &command, 1);
}


x86 assembly (clang, -O0):
<unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movq   $0x1,0xc(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
define i32 @unlock(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sembuf
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i32 1, i32* %8
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 2
store i32 0, i32* %9
%10 = load i32, i32* %3
%11 = call i32 @semop(i32 %10, %struct.sembuf* %5, i32 1)
ret i32 %11
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
define i32 @unlock(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i32 0, i32* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
long UARTCharGet(unsigned long ulBase) {
  DEBUG_ASSERT(UARTBaseValid(ulBase));
  while ((*((volatile unsigned long *)(ulBase + 0x00000018))) & 0x00000010) {
  }
  return ((*((volatile unsigned long *)(ulBase + 0x00000000))));
}


x86 assembly (clang, -O0):
<UARTCharGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
and    $0x10,%rax
cmp    $0x0,%rax
je     1157 <UARTCharGet+0x37>
jmp    113c <UARTCharGet+0x1c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharGet>:
push   %rbx
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
testq  $0x10,0x18(%rbx)
jne    1130 <UARTCharGet+0x10>
mov    (%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @UARTCharGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @UARTBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
br label %6
6: ; preds = %13, %1
%7 = load i64, i64* %2
%8 = add i64 %7, 24
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, 16
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %6
br label %6
14: ; preds = %6
%15 = load i64, i64* %2
%16 = add i64 %15, 0
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @UARTCharGet(i64 %0) {
%2 = tail call i32 @UARTBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 24
%5 = inttoptr i64 %4 to i64*
br label %6
6: ; preds = %6, %1
%7 = load volatile i64, i64* %5
%8 = and i64 %7, 16
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6
%11 = inttoptr i64 %0 to i64*
%12 = load volatile i64, i64* %11
ret i64 %12
}
/* Type definitions */
struct sigaction {
  scalar_t__ sa_flags;
  int /*<<< orphan*/ sa_mask;
  int /*<<< orphan*/ *sa_handler;
};

/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ alarm(int /*<<< orphan*/);
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/ *);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
void unsudirribe_alarm() {
  struct sigaction sig;
  sig.sa_handler = NULL;
  sigemptyset(&sig.sa_mask);
  sig.sa_flags = 0;
  sigaction(SIGALRM, &sig, NULL);
  alarm(0);
}


x86 assembly (clang, -O0):
<unsudirribe_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
add    $0x8,%rdi
call   1050 <sigemptyset@plt>
movq   $0x0,-0x18(%rbp)
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
xor    %edi,%edi
call   1040 <alarm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsudirribe_alarm>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1050 <sigemptyset@plt>
movq   $0x0,(%rsp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
xor    %edi,%edi
call   1040 <alarm@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sigaction = type { i64, i32, i32* }
@SIGALRM = global i32 0
define void @unsudirribe_alarm() {
%1 = alloca %struct.sigaction
%2 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 2
store i32* null, i32** %2
%3 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 1
%4 = call i32 @sigemptyset(i32* %3)
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
store i64 0, i64* %5
%6 = load i32, i32* @SIGALRM
%7 = call i32 @sigaction(i32 %6, %struct.sigaction* %1, i32* null)
%8 = call i32 @alarm(i32 0)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i64, i32, i32* }
@SIGALRM = global i32 0
define void @unsudirribe_alarm() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 2
store i32* null, i32** %3
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 1
%5 = call i32 @sigemptyset(i32* %4)
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
store i64 0, i64* %6
%7 = load i32, i32* @SIGALRM
%8 = call i32 @sigaction(i32 %7, %struct.sigaction* %1, i32* null)
%9 = call i32 @alarm(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putnbr(int);
int /*<<< orphan*/ ft_putstr(char *);
void ft_putnbr_info(int nb) {
  ft_putstr("\x1B[36m");
  ft_putnbr(nb);
  ft_putstr("\x1B[0m");
}


x86 assembly (clang, -O0):
<ft_putnbr_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    -0x4(%rbp),%edi
call   1030 <ft_putnbr@plt>
lea    0xec0(%rip),%rdi
call   1040 <ft_putstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_info>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    %ebx,%edi
call   1030 <ft_putnbr@plt>
lea    0xec9(%rip),%rdi
pop    %rbx
jmp    1040 <ft_putstr@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[36m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putnbr_info(i32 %0) {
%2 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ft_putnbr(i32 %0)
%4 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void km_onerr_nil(int err, char *msg, char *file, int line) {
  (void)(err);
  (void)(msg);
  (void)(file);
  (void)(line);
}


x86 assembly (clang, -O0):
<km_onerr_nil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @km_onerr_nil(i32 %0, i8* nocapture %1, i8* nocapture %2, i32 %3) {
ret void
}
unsigned int be_readu16(const void *p) {
  const unsigned char *i = (unsigned char *)p;
  return i[0] << 8 | i[1];
}


x86 assembly (clang, -O0):
<be_readu16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_readu16>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @be_readu16(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @be_readu16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ getchar();
char keyboard_char(void) { return (char)getchar(); }


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

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

LLVM IR (-O0):
define signext i8 @keyboard_char() {
%1 = call i64 (...) @getchar()
%2 = trunc i64 %1 to i8
ret i8 %2
}

LLVM IR (-O2):
define signext i8 @keyboard_char() {
%1 = tail call i64 (...) @getchar()
%2 = trunc i64 %1 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f7(long j) {
  if ((j & ((1UL << (7)) - 1)) >= ((1UL << ((7) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7f,%rax
cmp    $0x42,%rax
jb     1135 <f7+0x25>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
and    $0x7e,%edi
cmp    $0x42,%edi
jae    1119 <f7+0x9>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f7(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 127
%5 = icmp uge i64 %4, 66
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f7(i64 %0) {
%2 = and i64 %0, 126
%3 = icmp ugt i64 %2, 65
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_composite_channel_credentials_create() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_composite_channel_credentials_create>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_composite_channel_credentials_create() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_composite_channel_credentials_create() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
scalar_t__ gets(char *);
int /*<<< orphan*/ parse_expr();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ set_line(char *);
int main(int argc, char const *argv[]) {
  printf("enter expressions: \n");
  char buf[1024];
  if (gets(buf)) {
    set_line(buf);
    printf("%lf\n", parse_expr());
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x410(%rbp),%rdi
call   1050 <gets@plt>
cmp    $0x0,%rax
je     11a0 <main+0x60>
lea    -0x410(%rbp),%rdi
call   1030 <set_line@plt>
mov    $0x0,%al
call   1060 <parse_expr@plt>
mov    %eax,%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x408,%rsp
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1060 <gets@plt>
test   %rax,%rax
je     118f <main+0x3f>
mov    %rsp,%rdi
call   1040 <set_line@plt>
xor    %eax,%eax
call   1070 <parse_expr@plt>
lea    0xe7a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x408,%rsp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"enter expressions: \0A\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%9 = call i64 @gets(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%13 = call i32 @set_line(i8* %12)
%14 = call i32 (...) @parse_expr()
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %11, %2
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%lf\0A\00"
@str = [20 x i8] c"enter expressions: \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = call i64 @gets(i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = call i32 @set_line(i8* %5)
%10 = call i32 (...) @parse_expr()
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %2
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xselection;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xselection_display(void *_p) {
  return (void *)((XEvent *)_p)->xselection.display;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i8* @get_XEvent_xselection_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_XEvent_xselection_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
scalar_t__ FP_NORMAL;
scalar_t__ __fpclassify(double);
int __isnormal(double x) { return (__fpclassify(x) == FP_NORMAL); }


x86 assembly (clang, -O0):
<__isnormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__fpclassify@plt>
mov    0x2ec2(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isnormal>:
push   %rax
call   1030 <__fpclassify@plt>
mov    0x2ed3(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FP_NORMAL = global i64 0
define i32 @__isnormal(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @__fpclassify(double %3)
%5 = load i64, i64* @FP_NORMAL
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@FP_NORMAL = global i64 0
define i32 @__isnormal(double %0) {
%2 = tail call i64 @__fpclassify(double %0)
%3 = load i64, i64* @FP_NORMAL
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void compdatalab(l) { out2p(100, l); }


x86 assembly (clang, -O0):
<compdatalab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x64,%edi
mov    $0x0,%al
call   1030 <out2p@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compdatalab>:
mov    %edi,%esi
mov    $0x64,%edi
xor    %eax,%eax
jmp    1030 <out2p@plt>

LLVM IR (-O0):
define void @compdatalab(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @out2p to i32 (i32, i32, ...)*)(i32 100, i32 %3)
ret void
}

LLVM IR (-O2):
define void @compdatalab(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @out2p to i32 (i32, i32, ...)*)(i32 100, i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ numbers;

/* Variables and functions */
int /*<<< orphan*/ doIt(int *, int);
int main() {
  int numbers[] = {0, 0, 1, 7, 4, 6};
  int sizeVectorNumbers = sizeof(numbers) / sizeof(int);
  doIt(numbers, sizeVectorNumbers);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x6,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <doIt@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <doIt@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.numbers = [6 x i32] [i32 0, i32 0, i32 1, i32 7, i32 4, i32 6]
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [6 x i32]* %2 to i8*
store i32 6, i32* %3
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @doIt(i32* %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.numbers = [6 x i32] [i32 0, i32 0, i32 1, i32 7, i32 4, i32 6]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @doIt(i32* %3, i32 6)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int string_cmp(const void *a, const void *b) {
  char const *a_str = *(char const *const *)a;
  char const *b_str = *(char const *const *)b;
  return strcmp(a_str, b_str);
}


x86 assembly (clang, -O0):
<string_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
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),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @string_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @string_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct dhcp_binding {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dhcp_isbound(struct dhcp_binding *);
int /*<<< orphan*/ dhcp_step(struct dhcp_binding *);
time_t dhcp_bind(struct dhcp_binding *binding) {
  time_t next;
  do {
    next = dhcp_step(binding);
  } while (!dhcp_isbound(binding));
  return next;
}


x86 assembly (clang, -O0):
<dhcp_bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <dhcp_step@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dhcp_isbound@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112c <dhcp_bind+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhcp_bind>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <dhcp_step@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <dhcp_isbound@plt>
test   %eax,%eax
je     1130 <dhcp_bind+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.dhcp_binding = type { i32 }
define i32 @dhcp_bind(%struct.dhcp_binding* %0) {
%2 = alloca %struct.dhcp_binding*
%3 = alloca i32
store %struct.dhcp_binding* %0, %struct.dhcp_binding** %2
br label %4
4: ; preds = %7, %1
%5 = load %struct.dhcp_binding*, %struct.dhcp_binding** %2
%6 = call i32 @dhcp_step(%struct.dhcp_binding* %5)
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load %struct.dhcp_binding*, %struct.dhcp_binding** %2
%9 = call i32 @dhcp_isbound(%struct.dhcp_binding* %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %4, label %12
12: ; preds = %7
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
%struct.dhcp_binding = type { i32 }
define i32 @dhcp_bind(%struct.dhcp_binding* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @dhcp_step(%struct.dhcp_binding* %0)
%4 = tail call i32 @dhcp_isbound(%struct.dhcp_binding* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int IFF_NOARP;
int IFF_UP;
int ifc_set_flags(char const *, int, int /*<<< orphan*/);
int ifc_up(const char *name, int rawIP) {
  int ret = ifc_set_flags(name, IFF_UP | (rawIP ? IFF_NOARP : 0), 0);
  return ret;
}


x86 assembly (clang, -O0):
<ifc_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114e <ifc_up+0x3e>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1158 <ifc_up+0x48>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1158 <ifc_up+0x48>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x24(%rbp),%eax
or     %eax,%esi
xor    %edx,%edx
call   1030 <ifc_set_flags@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifc_up>:
mov    0x2ec9(%rip),%rax
test   %esi,%esi
je     1124 <ifc_up+0x14>
mov    0x2ec6(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
xor    %edx,%edx
jmp    1030 <ifc_set_flags@plt>

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

LLVM IR (-O2):
@IFF_UP = global i32 0
@IFF_NOARP = global i32 0
define i32 @ifc_up(i8* %0, i32 %1) {
%3 = load i32, i32* @IFF_UP
%4 = icmp eq i32 %1, 0
%5 = load i32, i32* @IFF_NOARP
%6 = select i1 %4, i32 0, i32 %5
%7 = or i32 %6, %3
%8 = tail call i32 @ifc_set_flags(i8* %0, i32 %7, i32 0)
ret i32 %8
}
char *RCSid() {
  return RCSid("$Id: strftime.c,v 1.7 2004/07/01 17:10:08 broeker Exp $");
}


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

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [56 x i8] c"$Id: strftime.c,v 1.7 2004/07/01 17:10:08 broeker Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void __attribute__((regparm(3))) memcpy_17(void *dest, void *src) {
  memcpy(dest, src, 17);
}


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

x86 assembly (clang, -O2):
<memcpy_17>:
mov    $0x11,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @memcpy_17(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 = load i8*, i8** %4
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 17)
ret void
}

LLVM IR (-O2):
define void @memcpy_17(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 17)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ key_irq_init();
int /*<<< orphan*/ uart_irq_init();
void irq_init(void) {
  key_irq_init();
  uart_irq_init();
}


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

x86 assembly (clang, -O2):
<irq_init>:
push   %rax
xor    %eax,%eax
call   1030 <key_irq_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <uart_irq_init@plt>

LLVM IR (-O0):
define void @irq_init() {
%1 = call i32 (...) @key_irq_init()
%2 = call i32 (...) @uart_irq_init()
ret void
}

LLVM IR (-O2):
define void @irq_init() {
%1 = tail call i32 (...) @key_irq_init()
%2 = tail call i32 (...) @uart_irq_init()
ret void
}
double dor(x, y)
double x, y;
{ return ((double)(x || y)); }


x86 assembly (clang, -O0):
<dor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jne    1142 <dor+0x42>
jp     1142 <dor+0x42>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dor>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomisd %xmm2,%xmm1
setp   %al
setne  %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @dor(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 = fcmp une double %5, 0.000000e+00
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load double, double* %4
%9 = fcmp une double %8, 0.000000e+00
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @dor(double %0, double %1) {
%3 = fcmp une double %0, 0.000000e+00
%4 = fcmp une double %1, 0.000000e+00
%5 = or i1 %3, %4
%6 = uitofp i1 %5 to double
ret double %6
}
int startup_services_katcp(struct katcp_dispatch *d) {
  int rtn;
  rtn = 0;
  return rtn;
}


x86 assembly (clang, -O0):
<startup_services_katcp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.katcp_dispatch = type opaque
define i32 @startup_services_katcp(%struct.katcp_dispatch* %0) {
%2 = alloca %struct.katcp_dispatch*
%3 = alloca i32
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %2
store i32 0, i32* %3
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.katcp_dispatch = type opaque
define i32 @startup_services_katcp(%struct.katcp_dispatch* nocapture readnone %0) {
ret i32 0
}
void exit(status) int status;
{}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
unreachable
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ set_lock_size(int, int, int /*<<< orphan*/);
set_lock_total(int fd, int type) { set_lock_size(fd, type, 0); }


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

x86 assembly (clang, -O2):
<set_lock_total>:
xor    %edx,%edx
jmp    1030 <set_lock_size@plt>

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

LLVM IR (-O2):
define i32 @set_lock_total(i32 %0, i32 %1) {
%3 = tail call i32 @set_lock_size(i32 %0, i32 %1, i32 0)
ret i32 undef
}
int duplicate(int *selected, int size, int number) {
  int i = 0;
  for (i = 0; i < size; i++) {
    if (selected[i] == number) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<duplicate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115b <duplicate+0x5b>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1148 <duplicate+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1162 <duplicate+0x62>
jmp    114d <duplicate+0x4d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111c <duplicate+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<duplicate>:
test   %esi,%esi
jle    111e <duplicate+0x1e>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rcx,4)
je     1121 <duplicate+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <duplicate+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @duplicate(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %8
store i32 0, i32* %8
br label %9
9: ; preds = %23, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %7
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 1, i32* %4
br label %27
22: ; preds = %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %9
26: ; preds = %9
store i32 0, i32* %4
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @duplicate(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
int ZopfliGetDistExtraBits(int dist) {
  if (dist < 5)
    return 0;
  return (31 ^ __builtin_clz(dist - 1)) - 1;
}


x86 assembly (clang, -O0):
<ZopfliGetDistExtraBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    111d <ZopfliGetDistExtraBits+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1132 <ZopfliGetDistExtraBits+0x32>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
bsr    %eax,%eax
xor    $0x1f,%eax
xor    $0x1f,%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZopfliGetDistExtraBits>:
xor    %eax,%eax
cmp    $0x5,%edi
jl     1113 <ZopfliGetDistExtraBits+0x13>
add    $0xffffffff,%edi
bsr    %edi,%eax
xor    $0xffffffe0,%eax
add    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @ZopfliGetDistExtraBits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @llvm.ctlz.i32(i32 %9, i1 true)
%11 = xor i32 31, %10
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %2
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @ZopfliGetDistExtraBits(i32 %0) {
%2 = icmp slt i32 %0, 5
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @llvm.ctlz.i32(i32 %4, i1 true)
%6 = sub nsw i32 30, %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
unsigned int cast_int_uint_fast(int x) { return (unsigned int)x; }


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

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

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

LLVM IR (-O2):
define i32 @cast_int_uint_fast(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Time;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Bool;

/* Variables and functions */
int GrabSuccess;
int XGrabKeyboard(Display *display, Window grab_window, Bool owner_events,
                  int pointer_mode, int keyboard_mode, Time time) {
  (void)display;
  (void)grab_window;
  (void)owner_events;
  (void)pointer_mode;
  (void)keyboard_mode;
  (void)time;
  return GrabSuccess;
}


x86 assembly (clang, -O0):
<XGrabKeyboard>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<XGrabKeyboard>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@GrabSuccess = global i32 0
define i32 @XGrabKeyboard(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = load i32, i32* @GrabSuccess
ret i32 %19
}

LLVM IR (-O2):
@GrabSuccess = global i32 0
define i32 @XGrabKeyboard(i32* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = load i32, i32* @GrabSuccess
ret i32 %7
}
int monitor_protocol_event() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @monitor_protocol_event() {
ret i32 0
}
void fd211(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
a : {
  typedef int(*f)[n];
P02A:
  goto P02A;
  {
    typedef int(*g)[n];
  P024A:
    goto P024A;
    0;
  };
P02B:
  goto P02B;
  {
    typedef int(*h)[n];
  P025A:
    goto P025A;
    0;
  };
p02C:
  goto p02C;
  goto a;
P02C:
  goto P02C;
  ;
  typedef int(*i)[n];
P026A:
  goto P026A;
  0;
};
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd211>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd211+0x7>

x86 assembly (clang, -O2):
<fd211>:
jmp    1100 <fd211>

LLVM IR (-O0):
define void @fd211(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; No predecessors!
%23 = load i32, i32* %2
%24 = zext i32 %23 to i64
br label %25
25: ; preds = %25, %22
br label %25
26: ; No predecessors!
%27 = load i32, i32* %2
%28 = zext i32 %27 to i64
br label %29
29: ; preds = %29, %26
br label %29
30: ; preds = %30
br label %30
31: ; No predecessors!
%32 = load i32, i32* %2
%33 = zext i32 %32 to i64
br label %34
34: ; preds = %34, %31
br label %34
35: ; preds = %35
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd211(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void __fakesbrk(void) {}


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

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

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

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