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

/* Variables and functions */
int EOF;
int /*<<< orphan*/ SEEK_CUR;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void stbi__stdio_skip(void *user, int n) {
  int ch;
  fseek((FILE *)user, n, SEEK_CUR);
  ch = fgetc((FILE *)user);
  if (ch != EOF) {
    ungetc(ch, (FILE *)user);
  }
}


x86 assembly (clang, -O0):
<stbi__stdio_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    0x2e76(%rip),%rcx
cmp    (%rcx),%eax
je     117e <stbi__stdio_skip+0x4e>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi__stdio_skip>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%eax
jne    1157 <stbi__stdio_skip+0x27>
pop    %rbx
ret
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <ungetc@plt>

LLVM IR (-O0):
@SEEK_CUR = global i32 0
@EOF = global i32 0
define void @stbi__stdio_skip(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 = bitcast i8* %6 to i32*
%8 = load i32, i32* %4
%9 = load i32, i32* @SEEK_CUR
%10 = call i32 @fseek(i32* %7, i32 %8, i32 %9)
%11 = load i8*, i8** %3
%12 = bitcast i8* %11 to i32*
%13 = call i32 @fgetc(i32* %12)
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = load i32, i32* @EOF
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %2
%18 = load i32, i32* %5
%19 = load i8*, i8** %3
%20 = bitcast i8* %19 to i32*
%21 = call i32 @ungetc(i32 %18, i32* %20)
br label %22
22: ; preds = %17, %2
ret void
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
@EOF = global i32 0
define void @stbi__stdio_skip(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* @SEEK_CUR
%5 = tail call i32 @fseek(i32* %3, i32 %1, i32 %4)
%6 = tail call i32 @fgetc(i32* %3)
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %6, %7
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 @ungetc(i32 %6, i32* %3)
br label %11
11: ; preds = %9, %2
ret void
}
/* Variables and functions */
int fatorialExponencial(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("O fatorialExponencial de 4 eh: %d", fatorialExponencial(4));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"O fatorialExponencial de 4 eh: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fatorialExponencial(i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"O fatorialExponencial de 4 eh: %d\00"
define i32 @main() {
%1 = tail call i32 @fatorialExponencial(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgstorlb(int n) { ngen("%s\t[bp%+d],al", "mov", n); }


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

x86 assembly (clang, -O2):
<cgstorlb>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%s\09[bp%+d],al\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgstorlb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s\09[bp%+d],al\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgstorlb(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void wbt_msleep(int ms) { usleep(ms * 1000); }


x86 assembly (clang, -O0):
<wbt_msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wbt_msleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @wbt_msleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @wbt_msleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t cpu_read_cr3() {
  uint64_t ret = 0;
  __asm__ __volatile__("movq %%"
                       "cr3"
                       ", %0"
                       : "=r"(ret));
  return (ret);
}


x86 assembly (clang, -O0):
<cpu_read_cr3>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    %cr3,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_read_cr3>:
mov    %cr3,%rax
ret

LLVM IR (-O0):
define i8* @cpu_read_cr3() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i8* asm sideeffect "movq %cr3, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @cpu_read_cr3() {
%1 = tail call i8* asm sideeffect "movq %cr3, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
void TMTimerSetNano(void) {}


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

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

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

LLVM IR (-O2):
define void @TMTimerSetNano() {
ret void
}
int test_imm_07int64_lowword_reg(long long val) {
  return ((val) & (0x07 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_07int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 7
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ yank_char_valid(char);
int yank_index(char reg) {
  if (yank_char_valid(reg))
    return reg - ('a' - 1);
  return -1;
}


x86 assembly (clang, -O0):
<yank_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <yank_char_valid@plt>
cmp    $0x0,%rax
je     1140 <yank_index+0x30>
movsbl -0x5(%rbp),%eax
sub    $0x60,%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <yank_index+0x37>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yank_index>:
push   %rbx
mov    %edi,%ebx
call   1030 <yank_char_valid@plt>
add    $0xffffffa0,%ebx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @yank_index(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @yank_char_valid(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 96
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @yank_index(i8 signext %0) {
%2 = tail call i64 @yank_char_valid(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -96
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
scalar_t__ read(int, char **, int);
void reactor_reset_timer(int fd) {
  char data[sizeof(void *)];
  if (read(fd, &data, sizeof(void *)) < 0)
    data[0] = 0;
}


x86 assembly (clang, -O0):
<reactor_reset_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x8,%edx
call   1030 <read@plt>
cmp    $0x0,%rax
jge    113a <reactor_reset_timer+0x2a>
movb   $0x0,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reactor_reset_timer>:
push   %rax
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <read@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @reactor_reset_timer(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast [8 x i8]* %3 to i8**
%6 = call i64 @read(i32 %4, i8** %5, i32 8)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @reactor_reset_timer(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @read(i32 %0, i8** %2, i32 8)
ret void
}
unsigned short nic_inw(unsigned short reg) {
  unsigned short val;
  (*((volatile unsigned char *)(0x20000000)) = (reg));
  val = (*((volatile unsigned char *)((0x20000000 + 4))));
  (*((volatile unsigned char *)(0x20000000)) = (reg + 1));
  val |= (*((volatile unsigned char *)((0x20000000 + 4)))) << 8;
  return val;
}


x86 assembly (clang, -O0):
<nic_inw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,%cl
mov    $0x20000000,%eax
mov    %cl,(%rax)
mov    $0x20000004,%eax
mov    (%rax),%al
movzbl %al,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x1,%eax
mov    %al,%cl
mov    $0x20000000,%eax
mov    %cl,(%rax)
mov    $0x20000004,%eax
mov    (%rax),%al
movzbl %al,%ecx
shl    $0x8,%ecx
movzwl -0x4(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nic_inw>:
mov    %dil,0x20000000
20
movzbl 0x20000004,%ecx
20
add    $0x1,%dil
mov    %dil,0x20000000
20
movzbl 0x20000004,%eax
20
shl    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @nic_inw(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = trunc i16 %4 to i8
store volatile i8 %5, i8* inttoptr (i64 536870912 to i8*)
%6 = load volatile i8, i8* inttoptr (i64 536870916 to i8*)
%7 = zext i8 %6 to i16
store i16 %7, i16* %3
%8 = load i16, i16* %2
%9 = zext i16 %8 to i32
%10 = add nsw i32 %9, 1
%11 = trunc i32 %10 to i8
store volatile i8 %11, i8* inttoptr (i64 536870912 to i8*)
%12 = load volatile i8, i8* inttoptr (i64 536870916 to i8*)
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i16, i16* %3
%16 = zext i16 %15 to i32
%17 = or i32 %16, %14
%18 = trunc i32 %17 to i16
store i16 %18, i16* %3
%19 = load i16, i16* %3
ret i16 %19
}

LLVM IR (-O2):
define zeroext i16 @nic_inw(i16 zeroext %0) {
%2 = trunc i16 %0 to i8
store volatile i8 %2, i8* inttoptr (i64 536870912 to i8*)
%3 = load volatile i8, i8* inttoptr (i64 536870916 to i8*)
%4 = add i8 %2, 1
store volatile i8 %4, i8* inttoptr (i64 536870912 to i8*)
%5 = load volatile i8, i8* inttoptr (i64 536870916 to i8*)
%6 = zext i8 %5 to i16
%7 = shl nuw i16 %6, 8
%8 = zext i8 %3 to i16
%9 = or i16 %7, %8
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Reticle(int reticle) {
  reticle = reticle;
  fprintf(stderr, "NexStar does not support remote setting of reticle.\n");
}


x86 assembly (clang, -O0):
<Reticle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reticle>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"NexStar does not support remote setting of reticle.\0A\00"
define void @Reticle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* %2
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"NexStar does not support remote setting of reticle.\0A\00"
define void @Reticle(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}
int COMMAND_CAN_AMR(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @COMMAND_CAN_AMR() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @COMMAND_CAN_AMR() {
ret i32 -1
}
char HexChar(char ch) { return ("0123456789ABCDEF"[ch & 0x0F]); }


x86 assembly (clang, -O0):
<HexChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xee5(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HexChar>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define signext i8 @HexChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 15
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define signext i8 @HexChar(i8 signext %0) {
%2 = and i8 %0, 15
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
void gtk_adjustment_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_adjustment_new() {
ret void
}
int test_imm_00uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x00 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_00uint64_highword_mem(i64* nocapture readnone %0) {
ret i32 -40
}
/* Variables and functions */
scalar_t__ memmove(char *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
char *strcpy(char *dest, const char *src) {
  return (char *)memmove(dest, src, strlen(src) + 1);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memmove@plt>

LLVM IR (-O0):
define i8* @strcpy(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 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i64 @memmove(i8* %5, i8* %6, i64 %9)
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i64 @memmove(i8* %0, i8* %1, i64 %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
double Pi(int n) {
  if (n >= 0) {
    double fac = 0;
    if (n % 2 == 0) {
      fac = 1;
    } else {
      fac = -1;
    }
    return (4 * fac / (2 * n + 1)) + Pi(n - 1);
  } else {
    return 0.;
  }
}


x86 assembly (clang, -O0):
<Pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     11a4 <Pi+0x94>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1153 <Pi+0x43>
movsd  0xebf(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1160 <Pi+0x50>
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xea8(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <Pi@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ac <Pi+0x9c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pi>:
test   %edi,%edi
js     114f <Pi+0x3f>
push   %rax
xor    %eax,%eax
test   $0x1,%dil
sete   %al
lea    0xedb(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm1
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
add    $0xffffffff,%edi
call   1030 <Pi@plt>
addsd  (%rsp),%xmm0
add    $0x8,%rsp
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @Pi(i32 %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %1
store double 0.000000e+00, double* %4
%8 = load i32, i32* %3
%9 = srem i32 %8, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store double 1.000000e+00, double* %4
br label %13
12: ; preds = %7
store double -1.000000e+00, double* %4
br label %13
13: ; preds = %12, %11
%14 = load double, double* %4
%15 = fmul double 4.000000e+00, %14
%16 = load i32, i32* %3
%17 = mul nsw i32 2, %16
%18 = add nsw i32 %17, 1
%19 = sitofp i32 %18 to double
%20 = fdiv double %15, %19
%21 = load i32, i32* %3
%22 = sub nsw i32 %21, 1
%23 = call double @Pi(i32 %22)
%24 = fadd double %20, %23
store double %24, double* %2
br label %26
25: ; preds = %1
store double 0.000000e+00, double* %2
br label %26
26: ; preds = %25, %13
%27 = load double, double* %2
ret double %27
}

LLVM IR (-O2):
define double @Pi(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1, %5
%4 = phi double [ %15, %5 ], [ 0.000000e+00, %1 ]
ret double %4
5: ; preds = %1
%6 = and i32 %0, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, double 4.000000e+00, double -4.000000e+00
%9 = shl nuw nsw i32 %0, 1
%10 = or i32 %9, 1
%11 = sitofp i32 %10 to double
%12 = fdiv double %8, %11
%13 = add nsw i32 %0, -1
%14 = tail call double @Pi(i32 %13)
%15 = fadd double %12, %14
br label %3
}
void INT_Excep_SCI9_TEI9(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI9_TEI9() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mumble_serverconfig_callback(uint32_t max_bandwidth, char *welcome_text,
                                  uint32_t allow_html, uint32_t message_length,
                                  uint32_t image_message_length,
                                  void *user_data) {
  printf("serverconfig_callback\n");
}


x86 assembly (clang, -O0):
<mumble_serverconfig_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"serverconfig_callback\0A\00"
define void @mumble_serverconfig_callback(i32 %0, i8* %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
store i32 %0, i32* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"serverconfig_callback\00"
define void @mumble_serverconfig_callback(i32 %0, i8* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i8* nocapture readnone %5) {
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int test(int n) {
  printf("\n\tHERE %d\n\n", n);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"\0A\09HERE %d\0A\0A\00"
define i32 @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"\0A\09HERE %d\0A\0A\00"
define i32 @test(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
int do_729() { return 729; }


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

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

LLVM IR (-O0):
define i32 @do_729() {
ret i32 729
}

LLVM IR (-O2):
define i32 @do_729() {
ret i32 729
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int syntax(void) {
  puts("bor2wav 1.0 by rofl0r\nsyntax: bor2wav borfile wavfile");
  return 1;
}


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

x86 assembly (clang, -O2):
<syntax>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"bor2wav 1.0 by rofl0r\0Asyntax: bor2wav borfile wavfile\00"
define i32 @syntax() {
%1 = call i32 @puts(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [54 x i8] c"bor2wav 1.0 by rofl0r\0Asyntax: bor2wav borfile wavfile\00"
define i32 @syntax() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
void foo079(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo079(i32 %0) {
ret void
}
/* Variables and functions */
unsigned isdigit(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf(" Hello C , How's it going ?");
  return 2324;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c" Hello C , How's it going ?\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 2324
}

LLVM IR (-O2):
@.str = [28 x i8] c" Hello C , How's it going ?\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 2324
}
/* Variables and functions */
int isSwitchOn(int, int);
int readSwitchPort();
int /*<<< orphan*/ sendData();
int main() {
  int switchPort;
  do {
    switchPort = readSwitchPort();
    if (isSwitchOn(switchPort, 1) == 1)
      sendData();
  } while (isSwitchOn(switchPort, 3) != 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <readSwitchPort@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1040 <isSwitchOn@plt>
cmp    $0x1,%eax
jne    1166 <main+0x36>
mov    $0x0,%al
call   1050 <sendData@plt>
jmp    116b <main+0x3b>
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
call   1040 <isSwitchOn@plt>
cmp    $0x1,%eax
jne    113f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
jmp    1151 <main+0x21>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
mov    $0x3,%esi
call   1040 <isSwitchOn@plt>
cmp    $0x1,%eax
je     1174 <main+0x44>
xor    %eax,%eax
call   1030 <readSwitchPort@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <isSwitchOn@plt>
cmp    $0x1,%eax
jne    1140 <main+0x10>
xor    %eax,%eax
call   1050 <sendData@plt>
jmp    1140 <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
br label %3
3: ; preds = %11, %0
%4 = call i32 (...) @readSwitchPort()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @isSwitchOn(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 (...) @sendData()
br label %10
10: ; preds = %8, %3
br label %11
11: ; preds = %10
%12 = load i32, i32* %2
%13 = call i32 @isSwitchOn(i32 %12, i32 3)
%14 = icmp ne i32 %13, 1
br i1 %14, label %3, label %15
15: ; preds = %11
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %7, %0
%2 = tail call i32 (...) @readSwitchPort()
%3 = tail call i32 @isSwitchOn(i32 %2, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @sendData()
br label %7
7: ; preds = %1, %5
%8 = tail call i32 @isSwitchOn(i32 %2, i32 3)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %1
10: ; preds = %7
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y, n;
  n = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  x = n;
  if (x >= 0) {
    while (x >= 0) {
      y = 1;
      if (y < x) {
        while (y < x) {
          y = 2 * y;
        }
      }
      x = x - 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     119c <main+0x8c>
jmp    1148 <main+0x38>
cmpl   $0x0,-0x8(%rbp)
jl     1197 <main+0x87>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1189 <main+0x79>
jmp    116a <main+0x5a>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1184 <main+0x74>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116a <main+0x5a>
jmp    1189 <main+0x79>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <main+0x38>
jmp    119c <main+0x8c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %4
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
%7 = load i32, i32* %4
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %31
10: ; preds = %0
br label %11
11: ; preds = %27, %10
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %30
14: ; preds = %11
store i32 1, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %27
18: ; preds = %14
br label %19
19: ; preds = %23, %18
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i32, i32* %3
%25 = mul nsw i32 2, %24
store i32 %25, i32* %3
br label %19
26: ; preds = %19
br label %27
27: ; preds = %26, %14
%28 = load i32, i32* %2
%29 = sub nsw i32 %28, 1
store i32 %29, i32* %2
br label %11
30: ; preds = %11
br label %31
31: ; preds = %30, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
int k_atominc(int volatile *value) {
  return (int)__sync_fetch_and_add(value, 1) + 1;
}


x86 assembly (clang, -O0):
<k_atominc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
lock xadd %eax,(%rcx)
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_atominc>:
mov    $0x1,%eax
lock xadd %eax,(%rdi)
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @k_atominc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = atomicrmw add i32* %3, i32 1 seq_cst
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @k_atominc(i32* nocapture %0) {
%2 = atomicrmw add i32* %0, i32 1 seq_cst
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int HV_E_FAIL;
int fprintf(int /*<<< orphan*/ *, char *, char *, char *, char *, char *);
int kvp_write_file(FILE *f, char *s1, char *s2, char *s3) {
  int ret;
  ret = fprintf(f, "%s%s%s%s\n", s1, s2, "=", s3);
  if (ret < 0)
    return HV_E_FAIL;
  return 0;
}


x86 assembly (clang, -O0):
<kvp_write_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r9
lea    0xec1(%rip),%rsi
lea    0xec4(%rip),%r8
call   1030 <fprintf@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    1169 <kvp_write_file+0x59>
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <kvp_write_file+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvp_write_file>:
push   %rax
mov    %rcx,%r9
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xedf(%rip),%rsi
lea    0xee2(%rip),%r8
call   1030 <fprintf@plt>
mov    0x2eac(%rip),%rcx
sar    $0x1f,%eax
and    (%rcx),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s%s%s%s\0A\00"
@.str.1 = [2 x i8] c"=\00"
@HV_E_FAIL = global i32 0
define i32 @kvp_write_file(i32* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = icmp slt i32 %5, 0
%7 = load i32, i32* @HV_E_FAIL
%8 = select i1 %6, i32 %7, i32 0
ret i32 %8
}
add(char *str1, char *str2, char *str3) {}


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

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

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

LLVM IR (-O2):
define i32 @add(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 undef
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_callback {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void wl_callback_set_user_data(struct wl_callback *wl_callback,
                               void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)wl_callback, user_data);
}


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

x86 assembly (clang, -O2):
<wl_callback_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

LLVM IR (-O0):
%struct.wl_callback = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_callback_set_user_data(%struct.wl_callback* %0, i8* %1) {
%3 = alloca %struct.wl_callback*
%4 = alloca i8*
store %struct.wl_callback* %0, %struct.wl_callback** %3
store i8* %1, i8** %4
%5 = load %struct.wl_callback*, %struct.wl_callback** %3
%6 = bitcast %struct.wl_callback* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_callback = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_callback_set_user_data(%struct.wl_callback* %0, i8* %1) {
%3 = bitcast %struct.wl_callback* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
/* Variables and functions */
double alea();
double r2(void) { return 0.95 + 0.05 * (alea() + alea()); }


x86 assembly (clang, -O0):
<r2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <alea@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <alea@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xec1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r2>:
push   %rax
xor    %eax,%eax
call   1030 <alea@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <alea@plt>
addsd  (%rsp),%xmm0
mulsd  0xecf(%rip),%xmm0
addsd  0xecf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @r2() {
%1 = call double (...) @alea()
%2 = call double (...) @alea()
%3 = fadd double %1, %2
%4 = call double @llvm.fmuladd.f64(double 5.000000e-02, double %3, double 0x3FEE666666666666)
ret double %4
}

LLVM IR (-O2):
define double @r2() {
%1 = tail call double (...) @alea()
%2 = tail call double (...) @alea()
%3 = fadd double %1, %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double 5.000000e-02, double 0x3FEE666666666666)
ret double %4
}
int imin(int a, int b) {
  if (a < b) {
    return (a);
  } else {
    return (b);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @imin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int cpuid_rdrand_test();
int hardware_rng_supported() {
  static int test_done = 0;
  static int supported = 0;
  if (!test_done) {
    supported = cpuid_rdrand_test();
    test_done = 1;
  }
  return supported;
}


x86 assembly (clang, -O0):
<hardware_rng_supported>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    1138 <hardware_rng_supported+0x28>
mov    $0x0,%al
call   1030 <cpuid_rdrand_test@plt>
mov    %eax,0x2f02(%rip)
movl   $0x1,0x2ef4(%rip)
mov    0x2ef2(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hardware_rng_supported>:
push   %rax
cmpb   $0x1,0x2f14(%rip)
jne    1122 <hardware_rng_supported+0x12>
mov    0x2f10(%rip),%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <cpuid_rdrand_test@plt>
mov    %eax,0x2f01(%rip)
movb   $0x1,0x2ef6(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@hardware_rng_supported.test_done = internal global i32 0
@hardware_rng_supported.supported = internal global i32 0
define i32 @hardware_rng_supported() {
%1 = load i32, i32* @hardware_rng_supported.test_done
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 (...) @cpuid_rdrand_test()
store i32 %4, i32* @hardware_rng_supported.supported
store i32 1, i32* @hardware_rng_supported.test_done
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @hardware_rng_supported.supported
ret i32 %6
}

LLVM IR (-O2):
@hardware_rng_supported.test_done = internal unnamed_addr global i1 false
@hardware_rng_supported.supported = internal unnamed_addr global i32 0
define i32 @hardware_rng_supported() {
%1 = load i1, i1* @hardware_rng_supported.test_done
br i1 %1, label %2, label %4
2: ; preds = %0
%3 = load i32, i32* @hardware_rng_supported.supported
br label %6
4: ; preds = %0
%5 = tail call i32 (...) @cpuid_rdrand_test()
store i32 %5, i32* @hardware_rng_supported.supported
store i1 true, i1* @hardware_rng_supported.test_done
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %3, %2 ], [ %5, %4 ]
ret i32 %7
}
/* Variables and functions */
scalar_t__ chdir(char *);
int /*<<< orphan*/ doNetworkingStuff();
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
char *strerror(int /*<<< orphan*/);
void startServer(void) {
  if (chdir("pages") != 0)
    fprintf(stdout, "chdir error: %s\n", strerror(errno));
  doNetworkingStuff();
}


x86 assembly (clang, -O0):
<startServer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <chdir@plt>
cmp    $0x0,%rax
je     118a <startServer+0x4a>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xe81(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <doNetworkingStuff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startServer>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1040 <chdir@plt>
test   %rax,%rax
je     117a <startServer+0x3a>
mov    0x2e7f(%rip),%rax
mov    (%rax),%ebx
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe96(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1050 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <doNetworkingStuff@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"pages\00"
@stdout = global i32 0
@.str.1 = [17 x i8] c"chdir error: %s\0A\00"
@errno = global i32 0
define void @startServer() {
%1 = call i64 @chdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @stdout
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %3, %0
%9 = call i32 (...) @doNetworkingStuff()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"pages\00"
@stdout = global i32 0
@.str.1 = [17 x i8] c"chdir error: %s\0A\00"
@errno = global i32 0
define void @startServer() {
%1 = tail call i64 @chdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = load i32, i32* @stdout
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %3, %0
%9 = tail call i32 (...) @doNetworkingStuff()
ret void
}
void MSP430TimerM$TimerA$overflow(void) {
  MSP430DCOCalibM$TimerMicro$overflow();
}


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

x86 assembly (clang, -O2):
<MSP430TimerM$TimerA$overflow>:
xor    %eax,%eax
jmp    1030 <MSP430DCOCalibM$TimerMicro$overflow@plt>

LLVM IR (-O0):
define void @"MSP430TimerM$TimerA$overflow"() {
%1 = call i32 (...) @"MSP430DCOCalibM$TimerMicro$overflow"()
ret void
}

LLVM IR (-O2):
define void @"MSP430TimerM$TimerA$overflow"() {
%1 = tail call i32 (...) @"MSP430DCOCalibM$TimerMicro$overflow"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_print(char const *);
void U_WMRCREATEBITMAPINDIRECT_print(const char *contents) {
  U_WMRNOTIMPLEMENTED_print(contents);
}


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

x86 assembly (clang, -O2):
<U_WMRCREATEBITMAPINDIRECT_print>:
jmp    1030 <U_WMRNOTIMPLEMENTED_print@plt>

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

LLVM IR (-O2):
define void @U_WMRCREATEBITMAPINDIRECT_print(i8* %0) {
%2 = tail call i32 @U_WMRNOTIMPLEMENTED_print(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void check(int argc) {
  if (argc < 2) {
    printf("Specify filename!\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1148 <check+0x28>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
cmp    $0x1,%edi
jle    1126 <check+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Specify filename!\0A\00"
define void @check(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 2
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 0)
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"Specify filename!\00"
define void @check(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
void *b1(size_t);
void *c1(size_t n) { return b1(n); }


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

x86 assembly (clang, -O2):
<c1>:
jmp    1030 <b1@plt>

LLVM IR (-O0):
define i8* @c1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @b1(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @c1(i64 %0) {
%2 = tail call i8* @b1(i64 %0)
ret i8* %2
}
int g_DUMMY_menu_create_buttonbox2(int win_id, int rows) {
  win_id = win_id;
  rows = rows;
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @g_DUMMY_menu_create_buttonbox2(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
store i32 %5, i32* %3
%6 = load i32, i32* %4
store i32 %6, i32* %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @g_DUMMY_menu_create_buttonbox2(i32 %0, i32 %1) {
ret i32 -1
}