xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  double x = 5.2;
  x = 2.2;
  x = 343.2;
  x = 23134.2;
  x = 3343.2;
  printf("%f\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xef2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xedd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe9e(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 5.200000e+00, double* %6
store double 2.200000e+00, double* %6
store double 3.432000e+02, double* %6
store double 2.313420e+04, double* %6
store double 3.343200e+03, double* %6
%7 = load double, double* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 3.343200e+03)
ret i32 0
}
/* Type definitions */
struct PVRSRV_PER_PROCESS_DATA {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ OSGetCurrentProcessIDKM();
struct PVRSRV_PER_PROCESS_DATA *PVRSRVPerProcessData(int /*<<< orphan*/);
struct PVRSRV_PER_PROCESS_DATA *PVRSRVFindPerProcessData(void) {
  return PVRSRVPerProcessData(OSGetCurrentProcessIDKM());
}


x86 assembly (clang, -O0):
<PVRSRVFindPerProcessData>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <OSGetCurrentProcessIDKM@plt>
mov    %eax,%edi
call   1030 <PVRSRVPerProcessData@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PVRSRVFindPerProcessData>:
push   %rax
xor    %eax,%eax
call   1040 <OSGetCurrentProcessIDKM@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <PVRSRVPerProcessData@plt>

LLVM IR (-O0):
%struct.PVRSRV_PER_PROCESS_DATA = type { i32 }
define %struct.PVRSRV_PER_PROCESS_DATA* @PVRSRVFindPerProcessData() {
%1 = call i32 (...) @OSGetCurrentProcessIDKM()
%2 = call %struct.PVRSRV_PER_PROCESS_DATA* @PVRSRVPerProcessData(i32 %1)
ret %struct.PVRSRV_PER_PROCESS_DATA* %2
}

LLVM IR (-O2):
%struct.PVRSRV_PER_PROCESS_DATA = type { i32 }
define %struct.PVRSRV_PER_PROCESS_DATA* @PVRSRVFindPerProcessData() {
%1 = tail call i32 (...) @OSGetCurrentProcessIDKM()
%2 = tail call %struct.PVRSRV_PER_PROCESS_DATA* @PVRSRVPerProcessData(i32 %1)
ret %struct.PVRSRV_PER_PROCESS_DATA* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x6a() {
  Assert_real((isalnum(106)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              535, ("isalnum should be 1 for j"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x6a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6a,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x217,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x6a>:
push   %rax
mov    $0x6a,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x217,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for j\00"
define void @t_isalnum_0x6a() {
%1 = call i32 @isalnum(i32 106)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 535, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for j\00"
define void @t_isalnum_0x6a() {
%1 = tail call i32 @isalnum(i32 106)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 535, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int spi_simple_write_cmd(struct flashrom_flashctx *, int, int);
int spi_chip_erase_c7(struct flashrom_flashctx *flash) {
  return spi_simple_write_cmd(flash, 0xc7, 1000 * 1000);
}


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

x86 assembly (clang, -O2):
<spi_chip_erase_c7>:
mov    $0xc7,%esi
mov    $0xf4240,%edx
jmp    1030 <spi_simple_write_cmd@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_chip_erase_c7(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
%3 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%4 = call i32 @spi_simple_write_cmd(%struct.flashrom_flashctx* %3, i32 199, i32 1000000)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_chip_erase_c7(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @spi_simple_write_cmd(%struct.flashrom_flashctx* %0, i32 199, i32 1000000)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exynos_5410_gpio_write_mask(unsigned int, unsigned int,
                                               unsigned int);
void odroid_xu_gpio_write_24(unsigned int data) {
  unsigned int bank_offset = 0x0C40;
  unsigned int bit_index = 1;
  exynos_5410_gpio_write_mask(bank_offset, ((data & 1U) << bit_index),
                              (1U << bit_index));
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_write_24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xc40,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
and    $0x1,%esi
mov    -0xc(%rbp),%ecx
shl    %cl,%esi
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1030 <exynos_5410_gpio_write_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_write_24>:
lea    (%rdi,%rdi,1),%esi
and    $0x2,%esi
mov    $0xc40,%edi
mov    $0x2,%edx
jmp    1030 <exynos_5410_gpio_write_mask@plt>

LLVM IR (-O0):
define void @odroid_xu_gpio_write_24(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 3136, i32* %3
store i32 1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = and i32 %6, 1
%8 = load i32, i32* %4
%9 = shl i32 %7, %8
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = call i32 @exynos_5410_gpio_write_mask(i32 %5, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @odroid_xu_gpio_write_24(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, 2
%4 = tail call i32 @exynos_5410_gpio_write_mask(i32 3136, i32 %3, i32 2)
ret void
}
unsigned char core___core__Byte___Numeric__unary_32d_45d(unsigned char self) {
  unsigned char var;
  unsigned char var1;
  var1 = -self;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<core___core__Byte___Numeric__unary_32d_45d>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @core___core__Byte___Numeric__unary_32d_45d(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = sub nsw i32 0, %6
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = load i8, i8* %4
store i8 %9, i8* %3
br label %10
10: ; preds = %1
%11 = load i8, i8* %3
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @core___core__Byte___Numeric__unary_32d_45d(i8 zeroext %0) {
%2 = sub i8 0, %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage: spawnvpn --config config_path --path openvpn_binary_path\n");
}


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

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

LLVM IR (-O0):
@.str = [65 x i8] c"usage: spawnvpn --config config_path --path openvpn_binary_path\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [64 x i8] c"usage: spawnvpn --config config_path --path openvpn_binary_path\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ isPipe(int /*<<< orphan*/ *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
void svd_closeFile(FILE *file) {
  if (file == stdin || file == stdout)
    return;
  if (isPipe(file))
    pclose(file);
  else
    fclose(file);
}


x86 assembly (clang, -O0):
<svd_closeFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%rax
je     1164 <svd_closeFile+0x34>
mov    -0x8(%rbp),%rax
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%rax
jne    1169 <svd_closeFile+0x39>
jmp    1193 <svd_closeFile+0x63>
mov    -0x8(%rbp),%rdi
call   1030 <isPipe@plt>
cmp    $0x0,%rax
je     118a <svd_closeFile+0x5a>
mov    -0x8(%rbp),%rdi
call   1050 <pclose@plt>
jmp    1193 <svd_closeFile+0x63>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svd_closeFile>:
push   %rbx
mov    0x2eb0(%rip),%rax
cmp    %rdi,(%rax)
je     1162 <svd_closeFile+0x32>
mov    %rdi,%rbx
mov    0x2e91(%rip),%rax
cmp    %rdi,(%rax)
je     1162 <svd_closeFile+0x32>
mov    %rbx,%rdi
call   1030 <isPipe@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1164 <svd_closeFile+0x34>
pop    %rbx
jmp    1050 <pclose@plt>
pop    %rbx
ret
pop    %rbx
jmp    1040 <fclose@plt>

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32* null
define void @svd_closeFile(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32*, i32** @stdin
%5 = icmp eq i32* %3, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = load i32*, i32** @stdout
%9 = icmp eq i32* %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6, %1
br label %21
11: ; preds = %6
%12 = load i32*, i32** %2
%13 = call i64 @isPipe(i32* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32*, i32** %2
%17 = call i32 @pclose(i32* %16)
br label %21
18: ; preds = %11
%19 = load i32*, i32** %2
%20 = call i32 @fclose(i32* %19)
br label %21
21: ; preds = %10, %18, %15
ret void
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32* null
define void @svd_closeFile(i32* %0) {
%2 = load i32*, i32** @stdin
%3 = icmp eq i32* %2, %0
%4 = load i32*, i32** @stdout
%5 = icmp eq i32* %4, %0
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %14, label %7
7: ; preds = %1
%8 = tail call i64 @isPipe(i32* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @pclose(i32* %0)
br label %14
12: ; preds = %7
%13 = tail call i32 @fclose(i32* %0)
br label %14
14: ; preds = %1, %12, %10
ret void
}
int string_length(char *string) {
  int count = 0;
  while (!(*string++ == '\0')) {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<string_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    1136 <string_length+0x36>
jmp    1144 <string_length+0x44>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <string_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_length>:
cmpb   $0x0,(%rdi)
je     111c <string_length+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <string_length+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @string_length(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @string_length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void foo() {
  enum option { a = 1 };
  if (1) {
    enum option { a = 2 };
  }
}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strNcpy(char *dest, char *src, int n) {
  if (n > 0)
    strncpy(dest, src, n);
  else
    n = 1;
  dest[n - 1] = 0;
  return dest;
}


x86 assembly (clang, -O0):
<strNcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1142 <strNcpy+0x32>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
jmp    1149 <strNcpy+0x39>
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strNcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %edx,%edx
jle    112a <strNcpy+0x1a>
mov    %edx,%ebx
mov    %r14,%rdi
call   1030 <strncpy@plt>
add    $0xffffffff,%ebx
jmp    112c <strNcpy+0x1c>
xor    %ebx,%ebx
movb   $0x0,(%r14,%rbx,1)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strNcpy(i8* returned %0, i8* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %2)
%7 = add nsw i32 %2, -1
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %3, %5
%10 = phi i64 [ %8, %5 ], [ 0, %3 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 0, i8* %11
ret i8* %0
}
/* Variables and functions */
float max(float, float);
float blendLighten(float base, float blend) { return max(blend, base); }


x86 assembly (clang, -O0):
<blendLighten>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
call   1030 <max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blendLighten>:
movaps %xmm0,%xmm2
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
jmp    1030 <max@plt>

LLVM IR (-O0):
define float @blendLighten(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = call float @max(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @blendLighten(float %0, float %1) {
%3 = tail call float @max(float %1, float %0)
ret float %3
}
long long int min(long long int a, long long int b) { return (a < b ? a : b); }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
char *DisplayString(int /*<<< orphan*/ *);
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/);
char *util_copy_string(char const *const);
const char *xserver_default_display_server() {
  Display *display = XOpenDisplay(0);
  if (display != 0) {
    const char *const server = DisplayString(display);
    const char *const server_copy = util_copy_string(server);
    XCloseDisplay(display);
    return server_copy;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<xserver_default_display_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
call   1030 <XOpenDisplay@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118e <xserver_default_display_server+0x4e>
mov    -0x10(%rbp),%rdi
call   1060 <DisplayString@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <util_copy_string@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <XCloseDisplay@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1196 <xserver_default_display_server+0x56>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xserver_default_display_server>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
call   1030 <XOpenDisplay@plt>
test   %rax,%rax
je     1173 <xserver_default_display_server+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <DisplayString@plt>
mov    %rax,%rdi
call   1050 <util_copy_string@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <XCloseDisplay@plt>
mov    %r14,%rax
jmp    1175 <xserver_default_display_server+0x35>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xserver_default_display_server() {
%1 = alloca i8*
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i8*
%5 = call i32* @XOpenDisplay(i32 0)
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %16
8: ; preds = %0
%9 = load i32*, i32** %2
%10 = call i8* @DisplayString(i32* %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = call i8* @util_copy_string(i8* %11)
store i8* %12, i8** %4
%13 = load i32*, i32** %2
%14 = call i32 @XCloseDisplay(i32* %13)
%15 = load i8*, i8** %4
store i8* %15, i8** %1
br label %17
16: ; preds = %0
store i8* null, i8** %1
br label %17
17: ; preds = %16, %8
%18 = load i8*, i8** %1
ret i8* %18
}

LLVM IR (-O2):
define i8* @xserver_default_display_server() {
%1 = tail call i32* @XOpenDisplay(i32 0)
%2 = icmp eq i32* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i8* @DisplayString(i32* %1)
%5 = tail call i8* @util_copy_string(i8* %4)
%6 = tail call i32 @XCloseDisplay(i32* %1)
br label %7
7: ; preds = %0, %3
%8 = phi i8* [ %5, %3 ], [ null, %0 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ system(char *);
void RemoveFile(char *fileName) {
  char command[256];
  sprintf(command, "%s %s", "/bin/rm -f", fileName);
  system(command);
}


x86 assembly (clang, -O0):
<RemoveFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rcx
lea    0xebf(%rip),%rsi
lea    0xebe(%rip),%rdx
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RemoveFile>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rsi
lea    0xecd(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [11 x i8] c"/bin/rm -f\00"
define void @RemoveFile(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [11 x i8] c"/bin/rm -f\00"
define void @RemoveFile(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int write_file_append(char *, char *, int /*<<< orphan*/);
int logFileWrite(char *str) {
  return write_file_append("/tmp/dlmv.log", str, strlen(str));
}


x86 assembly (clang, -O0):
<logFileWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb6(%rip),%rdi
call   1030 <write_file_append@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logFileWrite>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write_file_append@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"/tmp/dlmv.log\00"
define i32 @logFileWrite(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write_file_append(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [14 x i8] c"/tmp/dlmv.log\00"
define i32 @logFileWrite(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write_file_append(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ is_floppy(int /*<<< orphan*/ *);
int write_data(int /*<<< orphan*/ *, int, unsigned char *, int);
int write_partition_physical_disk_drive_id(FILE *fp) {
  unsigned char ucId = 0x80;
  if (is_floppy(fp)) {
    ucId = 0x00;
  }
  return write_data(fp, 0x40, &ucId, 1);
}


x86 assembly (clang, -O0):
<write_partition_physical_disk_drive_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x80,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <is_floppy@plt>
cmp    $0x0,%rax
je     1147 <write_partition_physical_disk_drive_id+0x27>
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x40,%esi
lea    -0x9(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <write_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_partition_physical_disk_drive_id>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movb   $0x80,0xf(%rsp)
call   1040 <is_floppy@plt>
test   %rax,%rax
je     113c <write_partition_physical_disk_drive_id+0x1c>
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    $0x1,%ecx
call   1030 <write_data@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @write_partition_physical_disk_drive_id(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
store i8 -128, i8* %3
%4 = load i32*, i32** %2
%5 = call i64 @is_floppy(i32* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 0, i8* %3
br label %8
8: ; preds = %7, %1
%9 = load i32*, i32** %2
%10 = call i32 @write_data(i32* %9, i32 64, i8* %3, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @write_partition_physical_disk_drive_id(i32* %0) {
%2 = alloca i8
store i8 -128, i8* %2
%3 = tail call i64 @is_floppy(i32* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
store i8 0, i8* %2
br label %6
6: ; preds = %5, %1
%7 = call i32 @write_data(i32* %0, i32 64, i8* %2, i32 1)
ret i32 %7
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll17(struct __test_metadata *);
void wrapper_epoll17(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll17(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll17>:
jmp    1030 <epoll17@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll17(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll17(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll17(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll17(%struct.__test_metadata* %0)
ret void
}
unsigned trim(unsigned count, unsigned first, unsigned incr) {
  return count - (count - first) % incr;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
mov    %edx,%ecx
mov    %edi,%eax
sub    %esi,%eax
xor    %edx,%edx
div    %ecx
sub    %edx,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @trim(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = sub i32 %8, %9
%11 = load i32, i32* %6
%12 = urem i32 %10, %11
%13 = sub i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @trim(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 %0, %1
%5 = urem i32 %4, %2
%6 = sub i32 %0, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ InitGameModeMusicInfo();
int /*<<< orphan*/ InitMusicInfo();
void ReinitializeMusic() {
  InitMusicInfo();
  InitGameModeMusicInfo();
}


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

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

LLVM IR (-O0):
define void @ReinitializeMusic() {
%1 = call i32 (...) @InitMusicInfo()
%2 = call i32 (...) @InitGameModeMusicInfo()
ret void
}

LLVM IR (-O2):
define void @ReinitializeMusic() {
%1 = tail call i32 (...) @InitMusicInfo()
%2 = tail call i32 (...) @InitGameModeMusicInfo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void detail() {
  printf("%s\n%s\n",
         "For more detail about about develper, license, help and feedback",
         "Type 'about'|'license'|'feedback'|'help'");
}


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

x86 assembly (clang, -O2):
<detail>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xf23(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [65 x i8] c"For more detail about about develper, license, help and feedback\00"
@.str.2 = [41 x i8] c"Type 'about'|'license'|'feedback'|'help'\00"
define void @detail() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [65 x i8] c"For more detail about about develper, license, help and feedback\00"
@.str.2 = [41 x i8] c"Type 'about'|'license'|'feedback'|'help'\00"
define void @detail() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void selinux_resetfscreatecon(void) {}


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

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

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

LLVM IR (-O2):
define void @selinux_resetfscreatecon() {
ret void
}
int get_errno(int value) { return value; }


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

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

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

LLVM IR (-O2):
define i32 @get_errno(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ slab_put_item(struct item *);
void item_put(struct item *it) {
  ;
  slab_put_item(it);
}


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

x86 assembly (clang, -O2):
<item_put>:
jmp    1030 <slab_put_item@plt>

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

LLVM IR (-O2):
%struct.item = type { i32 }
define void @item_put(%struct.item* %0) {
%2 = tail call i32 @slab_put_item(%struct.item* %0)
ret void
}
/* Variables and functions */
char *strdup(char *);
void copyenc(char *encoding[256], char *std[256]) {
  int i;
  for (i = 0; i < 256; ++i)
    encoding[i] = strdup(std[i]);
}


x86 assembly (clang, -O0):
<copyenc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    1162 <copyenc+0x52>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strdup@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <copyenc+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyenc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <strdup@plt>
mov    %rax,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    $0x100,%rbx
jne    1120 <copyenc+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @copyenc(i8** nocapture writeonly %0, i8** nocapture %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %9, %3 ]
%5 = getelementptr inbounds i8*, i8** %1, i64 %4
%6 = load i8*, i8** %5
%7 = tail call i8* @strdup(i8* %6)
%8 = getelementptr inbounds i8*, i8** %0, i64 %4
store i8* %7, i8** %8
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 256
br i1 %10, label %11, label %3
11: ; preds = %3
ret void
}
const char *ls_costN_nm10_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_costN_nm10_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1127 <ls_costN_nm10_name_in+0x27>
jmp    1117 <ls_costN_nm10_name_in+0x17>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <ls_costN_nm10_name_in+0x2f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm10_name_in>:
xor    %eax,%eax
test   %edi,%edi
lea    0xef5(%rip),%rcx
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
define i8* @ls_costN_nm10_name_in(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
/* Variables and functions */
double RAND_MAX;
float rand();
int getrandom(float r) { return 0 + (int)(r * rand() / (RAND_MAX + 1.0)); }


x86 assembly (clang, -O0):
<getrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeba(%rip),%xmm1
mov    0x2e9b(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrandom>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mulss  0x4(%rsp),%xmm0
mov    0x2ebd(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xec9(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @getrandom(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float (...) @rand()
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = load double, double* @RAND_MAX
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double %6, %8
%10 = fptosi double %9 to i32
%11 = add nsw i32 0, %10
ret i32 %11
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @getrandom(float %0) {
%2 = tail call float (...) @rand()
%3 = fmul float %2, %0
%4 = fpext float %3 to double
%5 = load double, double* @RAND_MAX
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}
float convert_meters_to_decmill(float x_meters) { return x_meters * 10000; }


x86 assembly (clang, -O0):
<convert_meters_to_decmill>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @convert_meters_to_decmill(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.000000e+04
ret float %4
}

LLVM IR (-O2):
define float @convert_meters_to_decmill(float %0) {
%2 = fmul float %0, 1.000000e+04
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Ola Mundo\n\c");
  return 0;
}


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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Ola Mundo\0Ac\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Ola Mundo\0Ac\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void coco_free_memory(void *data) { free(data); }


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

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

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

LLVM IR (-O2):
define void @coco_free_memory(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
bool isEmpty(char *s) {
  while (*s) {
    if (!isspace(*s))
      return false;
    s++;
  }
  return true;
}


x86 assembly (clang, -O0):
<isEmpty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <isEmpty+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    114a <isEmpty+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <isEmpty+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <isEmpty+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEmpty>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <isEmpty+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <isEmpty+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isEmpty+0x20>
jmp    114b <isEmpty+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isEmpty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isspace(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
int isalpha(int c) {
  return (int)((((unsigned)c | 32u) - (unsigned)'a') < 26U);
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x20,%eax
sub    $0x61,%eax
cmp    $0x1a,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
or     $0x20,%edi
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 %3, 32
%5 = sub i32 %4, 97
%6 = icmp ult i32 %5, 26
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = or i32 %0, 32
%3 = add i32 %2, -97
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *l_momentum(char *, int, char *);
char *macvectorOnLine(char *arg) { return l_momentum(arg, 1, "vectorOnLine"); }


x86 assembly (clang, -O0):
<macvectorOnLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
lea    0xed4(%rip),%rdx
call   1030 <l_momentum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macvectorOnLine>:
lea    0xee9(%rip),%rdx
mov    $0x1,%esi
jmp    1030 <l_momentum@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"vectorOnLine\00"
define i8* @macvectorOnLine(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @l_momentum(i8* %3, i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"vectorOnLine\00"
define i8* @macvectorOnLine(i8* %0) {
%2 = tail call i8* @l_momentum(i8* %0, i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
scalar_t__ ENAMETOOLONG;
scalar_t__ errno;
int /*<<< orphan*/ gethostname(char *, size_t);
void find_hostname(char *buf, size_t size) {
  errno = 0;
  gethostname(buf, size);
  if (errno == ENAMETOOLONG) {
    buf[size - 1] = '\0';
  }
  return;
}


x86 assembly (clang, -O0):
<find_hostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gethostname@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%rax
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
jne    1165 <find_hostname+0x55>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_hostname>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ebe(%rip),%r15
movq   $0x0,(%r15)
call   1030 <gethostname@plt>
mov    (%r15),%rax
mov    0x2ea0(%rip),%rcx
cmp    (%rcx),%rax
jne    1143 <find_hostname+0x33>
movb   $0x0,-0x1(%r14,%rbx,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@ENAMETOOLONG = global i64 0
define void @find_hostname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* @errno
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @gethostname(i8* %5, i64 %6)
%8 = load i64, i64* @errno
%9 = load i64, i64* @ENAMETOOLONG
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = sub i64 %13, 1
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 0, i8* %15
br label %16
16: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@ENAMETOOLONG = global i64 0
define void @find_hostname(i8* %0, i64 %1) {
store i64 0, i64* @errno
%3 = tail call i32 @gethostname(i8* %0, i64 %1)
%4 = load i64, i64* @errno
%5 = load i64, i64* @ENAMETOOLONG
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = add i64 %1, -1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %7, %2
ret void
}
void g_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @g_terminate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_statusbar_message(char *);
void error(char *msg) { set_statusbar_message(msg); }


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

x86 assembly (clang, -O2):
<error>:
jmp    1030 <set_statusbar_message@plt>

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

LLVM IR (-O2):
define void @error(i8* %0) {
%2 = tail call i32 @set_statusbar_message(i8* %0)
ret void
}