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

/* Variables and functions */
int ftell(int /*<<< orphan*/ *);
int tell(int fd) { return ftell((FILE *)fd); }


x86 assembly (clang, -O0):
<tell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1030 <ftell@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tell>:
movslq %edi,%rdi
jmp    1030 <ftell@plt>

LLVM IR (-O0):
define i32 @tell(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = call i32 @ftell(i32* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @tell(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 @ftell(i32* %3)
ret i32 %4
}
int g(y)
int y;
{ return y + 1; }


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

x86 assembly (clang, -O2):
<g>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ capture_event(void *, int, int, int /*<<< orphan*/);
void capture_write_codec(uint16_t port, uint8_t val, void *p) {
  capture_event(p, (1 << 8), 1, port);
}


x86 assembly (clang, -O0):
<capture_write_codec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x100,%esi
mov    $0x1,%edx
call   1030 <capture_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_write_codec>:
mov    %edi,%ecx
mov    %rdx,%rdi
mov    $0x100,%esi
mov    $0x1,%edx
jmp    1030 <capture_event@plt>

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

LLVM IR (-O2):
define void @capture_write_codec(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @capture_event(i8* %2, i32 256, i32 1, i32 %0)
ret void
}
int test18() {
  enum { A, B } a;
  switch (a) {
  case A:
    return 0;
  case B:
    return 1;
  case 7:
    return 1;
  default:
    return 2;
  }
}


x86 assembly (clang, -O0):
<test18>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1139 <test18+0x39>
jmp    1117 <test18+0x17>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1145 <test18+0x45>
jmp    1128 <test18+0x28>
mov    -0xc(%rbp),%eax
sub    $0x7,%eax
je     1151 <test18+0x51>
jmp    115d <test18+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1164 <test18+0x64>
movl   $0x1,-0x4(%rbp)
jmp    1164 <test18+0x64>
movl   $0x1,-0x4(%rbp)
jmp    1164 <test18+0x64>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test18() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %2
switch i32 %3, label %7 [
i32 0, label %4
i32 1, label %5
i32 7, label %6
]
4: ; preds = %0
store i32 0, i32* %1
br label %8
5: ; preds = %0
store i32 1, i32* %1
br label %8
6: ; preds = %0
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 2, i32* %1
br label %8
8: ; preds = %7, %6, %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @test18() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initialization();
int /*<<< orphan*/ menu();
int main(void) {
  initialization();
  menu();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initialization@plt>
mov    $0x0,%al
call   1040 <menu@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initialization()
%3 = call i32 (...) @menu()
%4 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialization()
%2 = tail call i32 (...) @menu()
%3 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ adafinal();
int /*<<< orphan*/ adainit();
int test_standard_container();
int main(void) {
  adainit();
  int fail = test_standard_container();
  adafinal();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <adainit@plt>
mov    $0x0,%al
call   1050 <test_standard_container@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <adafinal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @adainit()
%4 = call i32 (...) @test_standard_container()
store i32 %4, i32* %2
%5 = call i32 (...) @adafinal()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @adainit()
%2 = tail call i32 (...) @test_standard_container()
%3 = tail call i32 (...) @adafinal()
ret i32 0
}
char xor (char a, char b) { return a ^ b; }


x86 assembly (clang, -O0):
<xor>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
xor    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @xor(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = xor i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @xor(i8 signext %0, i8 signext %1) {
%3 = xor i8 %1, %0
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  i = 1;
  while (i <= 128) {
    printf("%d\n", i);
    i *= 2;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jg     1150 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 16)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 32)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 64)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 128)
ret i32 0
}
/* Variables and functions */
char tolower(char);
char *to_lower_str(char s[]) {
  int i;
  for (i = 0; s[i] != '\0'; i++) {
    s[i] = tolower(s[i]);
  }
  return s;
}


x86 assembly (clang, -O0):
<to_lower_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <to_lower_str+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <to_lower_str+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_lower_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <to_lower_str+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <to_lower_str+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @to_lower_str(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @tolower(i8 signext %6)
store i8 %8, i8* %7
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret i8* %0
}
__attribute__((always_)) void
flush_dcache_mmap_lock(struct address_space *mapping) {}


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

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

LLVM IR (-O0):
%struct.address_space = type opaque
define void @flush_dcache_mmap_lock(%struct.address_space* %0) {
%2 = alloca %struct.address_space*
store %struct.address_space* %0, %struct.address_space** %2
ret void
}

LLVM IR (-O2):
%struct.address_space = type opaque
define void @flush_dcache_mmap_lock(%struct.address_space* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void FPULazyStackingEnable(void) {
  (*((volatile uint32_t *)(0xE000EF34))) |= 0x80000000 | 0x40000000;
}


x86 assembly (clang, -O0):
<FPULazyStackingEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000ef34,%eax
mov    (%rax),%ecx
or     $0xc0000000,%ecx
mov    $0xe000ef34,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPULazyStackingEnable>:
mov    $0xe000ef34,%eax
orl    $0xc0000000,(%rax)
ret

LLVM IR (-O0):
define void @FPULazyStackingEnable() {
%1 = load volatile i32, i32* inttoptr (i64 3758157620 to i32*)
%2 = or i32 %1, -1073741824
store volatile i32 %2, i32* inttoptr (i64 3758157620 to i32*)
ret void
}

LLVM IR (-O2):
define void @FPULazyStackingEnable() {
%1 = load volatile i32, i32* inttoptr (i64 3758157620 to i32*)
%2 = or i32 %1, -1073741824
store volatile i32 %2, i32* inttoptr (i64 3758157620 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(FILE *fp) { return (int)fp; }


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

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

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

LLVM IR (-O2):
define i32 @fileno(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__25__IO__selectModuleFunc();
void GpioCaptureC__0__GeneralIO__selectModuleFunc(void) {
  HplMsp430GeneralIOP__25__IO__selectModuleFunc();
}


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

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

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

LLVM IR (-O2):
define void @GpioCaptureC__0__GeneralIO__selectModuleFunc() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__25__IO__selectModuleFunc()
ret void
}
/* Variables and functions */
unsigned short inw(unsigned short *);
unsigned short lcd_hpi_read_status() {
  unsigned short value;
  value = inw((unsigned short *)((0x0003 << 1) + 0xfff24000));
  return (value);
}


x86 assembly (clang, -O0):
<lcd_hpi_read_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xfff24006,%edi
call   1030 <inw@plt>
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_hpi_read_status>:
mov    $0xfff24006,%edi
jmp    1030 <inw@plt>

LLVM IR (-O0):
define zeroext i16 @lcd_hpi_read_status() {
%1 = alloca i16
%2 = call zeroext i16 @inw(i16* inttoptr (i64 4294066182 to i16*))
store i16 %2, i16* %1
%3 = load i16, i16* %1
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @lcd_hpi_read_status() {
%1 = tail call zeroext i16 @inw(i16* inttoptr (i64 4294066182 to i16*))
ret i16 %1
}
/* Variables and functions */
double atof(char *);
__attribute__((__weak__, __always___)) double softboundcets_atof(char *ptr) {
  return atof(ptr);
}


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

x86 assembly (clang, -O2):
<softboundcets_atof>:
jmp    1030 <atof@plt>

LLVM IR (-O0):
define weak double @softboundcets_atof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @atof(i8* %3)
ret double %4
}

LLVM IR (-O2):
define weak double @softboundcets_atof(i8* %0) {
%2 = tail call double @atof(i8* %0)
ret double %2
}
/* Variables and functions */
char *my_strcpy_end(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char a[40] = "hello world!";
  char b[20] = "hello Miss Dong";
  printf("%s", my_strcpy_end(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
mov    0xed5(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xed0(%rip),%eax
mov    %eax,-0x40(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <my_strcpy_end@plt>
mov    %rax,%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movq   $0x0,0x40(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <my_strcpy_end@plt>
lea    0xed8(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [40 x i8] c"hello world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.b = [20 x i8] c"hello Miss Dong\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [40 x i8]
%3 = alloca [20 x i8]
store i32 0, i32* %1
%4 = bitcast [40 x i8]* %2 to i8*
%5 = bitcast [20 x i8]* %3 to i8*
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = call i8* @my_strcpy_end(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [40 x i8] c"hello world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.b = [20 x i8] c"hello Miss Dong\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i8* @my_strcpy_end(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
bool shell_command(char *command) {
  if (strcmp(command, "get_env") == 0) {
    return true;
  }
  if (strcmp(command, "exit") == 0) {
    _exit(0);
  }
  return false;
}


x86 assembly (clang, -O0):
<shell_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1152 <shell_command+0x32>
movl   $0x1,-0x4(%rbp)
jmp    117a <shell_command+0x5a>
mov    -0x10(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1173 <shell_command+0x53>
xor    %edi,%edi
call   1030 <_exit@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell_command>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1150 <shell_command+0x30>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1157 <shell_command+0x37>
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"get_env\00"
@.str.1 = [5 x i8] c"exit\00"
define i32 @shell_command(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %15
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @_exit(i32 0)
unreachable
14: ; preds = %8
store i32 0, i32* %2
br label %15
15: ; preds = %14, %7
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [8 x i8] c"get_env\00"
@.str.1 = [5 x i8] c"exit\00"
define i32 @shell_command(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @_exit(i32 0)
unreachable
9: ; preds = %4, %1
%10 = phi i32 [ 1, %1 ], [ 0, %4 ]
ret i32 %10
}
/* Variables and functions */
int CloseStringSource(void *, char const *);
int CloseStringDestination(void *theEnv, const char *name) {
  return (CloseStringSource(theEnv, name));
}


x86 assembly (clang, -O0):
<CloseStringDestination>:
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 <CloseStringSource@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CloseStringDestination>:
jmp    1030 <CloseStringSource@plt>

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

LLVM IR (-O2):
define i32 @CloseStringDestination(i8* %0, i8* %1) {
%3 = tail call i32 @CloseStringSource(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int *safe_malloc(int);
int *alloc_int(int val) {
  int *rv = safe_malloc(sizeof(int));
  *rv = val;
  return (rv);
}


x86 assembly (clang, -O0):
<alloc_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <safe_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_int>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <safe_malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @alloc_int(i32 %0) {
%2 = tail call i32* @safe_malloc(i32 4)
store i32 %0, i32* %2
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char const *);
int main() {
  const char *cmd = "/bin/mount -t tmpfs -o size=50M tmpfs "
                    "`subversion/tests/cmdline/svn-test-work";
  setuid(0);
  system(cmd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
xor    %edi,%edi
call   1040 <setuid@plt>
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [78 x i8] c"/bin/mount -t tmpfs -o size=50M tmpfs `subversion/tests/cmdline/svn-test-work\00"
define i32 @main() {
%1 = alloca i8*
store i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i32 @setuid(i32 0)
%3 = load i8*, i8** %1
%4 = call i32 @system(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [78 x i8] c"/bin/mount -t tmpfs -o size=50M tmpfs `subversion/tests/cmdline/svn-test-work\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @system(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int open_devbox_io(void) {
  int file_desc = open("/dev/devbox_ioctl", 0);
  if (file_desc < 0) {
    printf("DEVBOX_IOCTL: Failed to open IO file: %d\n", file_desc);
    return -1;
  }
  return file_desc;
}


x86 assembly (clang, -O0):
<open_devbox_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
xor    %esi,%esi
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    115e <open_devbox_io+0x3e>
mov    -0x8(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <open_devbox_io+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_devbox_io>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1040 <open@plt>
test   %eax,%eax
js     1135 <open_devbox_io+0x15>
pop    %rcx
ret
lea    0xed6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/dev/devbox_ioctl\00"
@.str.1 = [42 x i8] c"DEVBOX_IOCTL: Failed to open IO file: %d\0A\00"
define i32 @open_devbox_io() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @open(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %7)
store i32 -1, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [18 x i8] c"/dev/devbox_ioctl\00"
@.str.1 = [42 x i8] c"DEVBOX_IOCTL: Failed to open IO file: %d\0A\00"
define i32 @open_devbox_io() {
%1 = tail call i32 @open(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ -1, %3 ], [ %1, %0 ]
ret i32 %6
}
int imin(int n, int m) {
  int min;
  if (n < m) {
    min = n;
  } else {
    min = m;
  }
  return min;
}


x86 assembly (clang, -O0):
<imin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <imin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%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* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %3
store i32 %10, i32* %5
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
store i32 %12, i32* %5
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %5
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 */
double exp(int);
double alphaM(double v) {
  return 0.1 * (25 - v) / (exp((25 - v) / 10.0) - 1.0);
}


x86 assembly (clang, -O0):
<alphaM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecd(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe93(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphaM>:
push   %rax
movsd  0xee7(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0xee3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
divsd  0xeda(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <exp@plt>
addsd  0xed1(%rip),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @alphaM(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 2.500000e+01, %3
%5 = fmul double 1.000000e-01, %4
%6 = load double, double* %2
%7 = fsub double 2.500000e+01, %6
%8 = fdiv double %7, 1.000000e+01
%9 = fptosi double %8 to i32
%10 = call double @exp(i32 %9)
%11 = fsub double %10, 1.000000e+00
%12 = fdiv double %5, %11
ret double %12
}

LLVM IR (-O2):
define double @alphaM(double %0) {
%2 = fsub double 2.500000e+01, %0
%3 = fmul double %2, 1.000000e-01
%4 = fdiv double %2, 1.000000e+01
%5 = fptosi double %4 to i32
%6 = tail call double @exp(i32 %5)
%7 = fadd double %6, -1.000000e+00
%8 = fdiv double %3, %7
ret double %8
}
int fun167() { return 167; }


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

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

LLVM IR (-O0):
define i32 @fun167() {
ret i32 167
}

LLVM IR (-O2):
define i32 @fun167() {
ret i32 167
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void introduction() {
  printf("\t\t***%c%c CRISS-CROSS GAME %c%c***\n\n\n", 1, 1, 1, 1);
  printf("## You can play against computer or human.\n");
  printf("## Every player will get chance by turns.\n\n");
  return;
}


x86 assembly (clang, -O0):
<introduction>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<introduction>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"\09\09***%c%c CRISS-CROSS GAME %c%c***\0A\0A\0A\00"
@.str.1 = [44 x i8] c"## You can play against computer or human.\0A\00"
@.str.2 = [44 x i8] c"## Every player will get chance by turns.\0A\0A\00"
define void @introduction() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 1, i32 1)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"\09\09***%c%c CRISS-CROSS GAME %c%c***\0A\0A\0A\00"
@str = [43 x i8] c"## You can play against computer or human.\00"
@str.3 = [43 x i8] c"## Every player will get chance by turns.\0A\00"
define void @introduction() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 1, i32 1)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy_prool(char *, char *);
char *strstr(char *, char *);
void process_string2(char str[]) {
  char *set;
  if (set = strstr(str, "NAME=")) {
    strcpy_prool(set + 5, set + 6);
  }
}


x86 assembly (clang, -O0):
<process_string2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     115f <process_string2+0x3f>
mov    -0x10(%rbp),%rdi
add    $0x5,%rdi
mov    -0x10(%rbp),%rsi
add    $0x6,%rsi
call   1030 <strcpy_prool@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_string2>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     1143 <process_string2+0x23>
lea    0x5(%rax),%rdi
add    $0x6,%rax
mov    %rax,%rsi
pop    %rax
jmp    1030 <strcpy_prool@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"NAME=\00"
define void @process_string2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 6
%12 = call i32 @strcpy_prool(i8* %9, i8* %11)
br label %13
13: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"NAME=\00"
define void @process_string2(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 5
%6 = getelementptr inbounds i8, i8* %2, i64 6
%7 = tail call i32 @strcpy_prool(i8* %5, i8* %6)
br label %8
8: ; preds = %4, %1
ret void
}
unsigned int sdb_version(void) { return 0x00020001; }


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

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

LLVM IR (-O0):
define i32 @sdb_version() {
ret i32 131073
}

LLVM IR (-O2):
define i32 @sdb_version() {
ret i32 131073
}
void VL_NULL_FlushParams() {}


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

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

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

LLVM IR (-O2):
define void @VL_NULL_FlushParams() {
ret void
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_assoc_req(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x0000 | 0x0000);
}


x86 assembly (clang, -O0):
<ieee80211_is_assoc_req>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_assoc_req>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
xor    %edi,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_assoc_req(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 0)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_assoc_req(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 0)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};
typedef long int64_t;

/* Variables and functions */
int64_t diff_time_us(struct timespec start, struct timespec end) {
  int64_t sec_diff = end.tv_sec - start.tv_sec;
  int64_t ns_diff = end.tv_nsec - start.tv_nsec;
  return (int64_t)(sec_diff * 1000000L + ns_diff / 1000L);
}


x86 assembly (clang, -O0):
<diff_time_us>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
imul   $0xf4240,-0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff_time_us>:
mov    %rcx,%rax
sub    %rdi,%rdx
sub    %rsi,%rax
imul   $0xf4240,%rdx,%rcx
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @diff_time_us(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = alloca i64
%8 = alloca i64
%9 = bitcast %struct.timespec* %5 to { i64, i64 }*
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %9, i32 0, i32 0
store i64 %0, i64* %10
%11 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %9, i32 0, i32 1
store i64 %1, i64* %11
%12 = bitcast %struct.timespec* %6 to { i64, i64 }*
%13 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %12, i32 0, i32 0
store i64 %2, i64* %13
%14 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %12, i32 0, i32 1
store i64 %3, i64* %14
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%16 = load i64, i64* %15
%17 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%18 = load i64, i64* %17
%19 = sub nsw i64 %16, %18
store i64 %19, i64* %7
%20 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%21 = load i64, i64* %20
%22 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%23 = load i64, i64* %22
%24 = sub nsw i64 %21, %23
store i64 %24, i64* %8
%25 = load i64, i64* %7
%26 = mul nsw i64 %25, 1000000
%27 = load i64, i64* %8
%28 = sdiv i64 %27, 1000
%29 = add nsw i64 %26, %28
ret i64 %29
}

LLVM IR (-O2):
define i64 @diff_time_us(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub nsw i64 %2, %0
%6 = sub nsw i64 %3, %1
%7 = mul nsw i64 %5, 1000000
%8 = sdiv i64 %6, 1000
%9 = add nsw i64 %8, %7
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_help(char *program) {
  printf("usage  : %s [options] [file]\n", program);
  printf("options:\n");
  printf("  -c <config file> path to shared object configuration\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"usage : %s [options] [file]\0A\00"
@.str.1 = [10 x i8] c"options:\0A\00"
@.str.2 = [56 x i8] c" -c <config file> path to shared object configuration\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"usage : %s [options] [file]\0A\00"
@str = [9 x i8] c"options:\00"
@str.3 = [55 x i8] c" -c <config file> path to shared object configuration\00"
define void @print_help(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
ret void
}
void av_guess_format() {}


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

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

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

LLVM IR (-O2):
define void @av_guess_format() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void shutdown() { exit(0); }


x86 assembly (clang, -O0):
<shutdown>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<shutdown>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @shutdown() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @shutdown() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ diff3(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ length3(int /*<<< orphan*/ *);
GLdouble dist3(GLdouble p[3], GLdouble q[3]) {
  GLdouble d[3];
  diff3(p, q, d);
  return length3(d);
}


x86 assembly (clang, -O0):
<dist3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <diff3@plt>
lea    -0x1c(%rbp),%rdi
call   1030 <length3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist3>:
push   %rbx
sub    $0x10,%rsp
lea    0x4(%rsp),%rbx
mov    %rbx,%rdx
call   1040 <diff3@plt>
mov    %rbx,%rdi
call   1030 <length3@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dist3(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [3 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%9 = call i32 @diff3(i32* %6, i32* %7, i32* %8)
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%11 = call i32 @length3(i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @dist3(i32* %0, i32* %1) {
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%6 = call i32 @diff3(i32* %0, i32* %1, i32* %5)
%7 = call i32 @length3(i32* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ session_file_make_path(char *, char *);
int write_session_functions_file(char *);
int maybe_write_function_file(char *fullname) {
  session_file_make_path(fullname, "functions.xml");
  return write_session_functions_file(fullname);
}


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

x86 assembly (clang, -O2):
<maybe_write_function_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <session_file_make_path@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <write_session_functions_file@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"functions.xml\00"
define i32 @maybe_write_function_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @session_file_make_path(i8* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @write_session_functions_file(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [14 x i8] c"functions.xml\00"
define i32 @maybe_write_function_file(i8* %0) {
%2 = tail call i32 @session_file_make_path(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write_session_functions_file(i8* %0)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long time;
};
struct TYPE_4__ {
  TYPE_1__ xselectionrequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xselectionrequest_time(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xselectionrequest.time = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEvent_xselectionrequest_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int /*<<< orphan*/ *strstr(int /*<<< orphan*/, char *);
int file_select(const struct dirent *entry) {
  if (strstr(entry->d_name, ".ppm") != NULL) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<file_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1144 <file_select+0x34>
movl   $0x1,-0x4(%rbp)
jmp    114b <file_select+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_select>:
push   %rax
mov    (%rdi),%edi
lea    0xee6(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [5 x i8] c".ppm\00"
define i32 @file_select(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %3
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32* @strstr(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [5 x i8] c".ppm\00"
define i32 @file_select(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32* @strstr(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}