xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ selection;
};
typedef TYPE_1__ XSelectionClearEvent;

/* Variables and functions */
unsigned long get_XSelectionClearEvent_selection(void *_p) {
  return (unsigned long)((XSelectionClearEvent *)_p)->selection;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XSelectionClearEvent_selection(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ output_with_tab(char *);
void gen_def_word(void) { output_with_tab(".word "); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c".word \00"
define void @gen_def_word() {
%1 = call i32 @output_with_tab(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c".word \00"
define void @gen_def_word() {
%1 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void removeFile(char *fn) {
  char b[1024];
  sprintf(b, "rm -f '%s'", fn);
  system(b);
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"rm -f '%s'\00"
define void @removeFile(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
unsigned long _intsoff();
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
unsigned long mon_intsoff(void) {
  unsigned long ret;
  monLock();
  ret = _intsoff();
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_intsoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <monLock@plt>
mov    $0x0,%al
call   1030 <_intsoff@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_intsoff>:
push   %rbx
xor    %eax,%eax
call   1040 <monLock@plt>
xor    %eax,%eax
call   1030 <_intsoff@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @mon_intsoff() {
%1 = alloca i64
%2 = call i32 (...) @monLock()
%3 = call i64 (...) @_intsoff()
store i64 %3, i64* %1
%4 = call i32 (...) @monUnlock()
%5 = load i64, i64* %1
ret i64 %5
}

LLVM IR (-O2):
define i64 @mon_intsoff() {
%1 = tail call i32 (...) @monLock()
%2 = tail call i64 (...) @_intsoff()
%3 = tail call i32 (...) @monUnlock()
ret i64 %2
}
void prefetch(const void *x __attribute__((unused))) { ; }


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

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

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

LLVM IR (-O2):
define void @prefetch(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void zfree_structure_string(void *value, void *ctx) {
  if (value) {
    free(value);
  }
}


x86 assembly (clang, -O0):
<zfree_structure_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <zfree_structure_string+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zfree_structure_string>:
test   %rdi,%rdi
je     111a <zfree_structure_string+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @zfree_structure_string(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @zfree_structure_string(i8* %0, i8* nocapture readnone %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __delay_us(int);
void Delay_45us(unsigned int dtime) {
  unsigned int i;
  for (i = 0; i < dtime; i++)
    __delay_us(1);
}


x86 assembly (clang, -O0):
<Delay_45us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1146 <Delay_45us+0x36>
mov    $0x1,%edi
call   1030 <__delay_us@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <Delay_45us+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay_45us>:
push   %rbx
test   %edi,%edi
je     112f <Delay_45us+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <__delay_us@plt>
add    $0xffffffff,%ebx
jne    1120 <Delay_45us+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @Delay_45us(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @__delay_us(i32 1)
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @Delay_45us(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @__delay_us(i32 1)
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reuturn(int, int);
int make_server_socket(int portNum) { reuturn(portNum, 1); }


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

x86 assembly (clang, -O2):
<make_server_socket>:
mov    $0x1,%esi
jmp    1030 <reuturn@plt>

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

LLVM IR (-O2):
define i32 @make_server_socket(i32 %0) {
%2 = tail call i32 @reuturn(i32 %0, i32 1)
ret i32 undef
}
unsigned char f32(unsigned char x, unsigned long int y) {
  return (x >> ((-y) & (8 * sizeof(unsigned char) - 1))) ^ (x << y);
}


x86 assembly (clang, -O0):
<f32>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x7,%rcx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f32>:
mov    %esi,%ecx
neg    %cl
and    $0x7,%cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f32(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = sub i64 0, %7
%9 = and i64 %8, 7
%10 = trunc i64 %9 to i32
%11 = ashr i32 %6, %10
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
%16 = shl i32 %13, %15
%17 = xor i32 %11, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @f32(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 0, %4
%6 = and i32 %5, 7
%7 = lshr i32 %3, %6
%8 = shl i32 %3, %4
%9 = xor i32 %7, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t be32_to_cpupu(const uint32_t *p) {
  const uint8_t *p1 = (const uint8_t *)p;
  return p1[3] | (p1[2] << 8) | (p1[1] << 16) | (p1[0] << 24);
}


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

x86 assembly (clang, -O2):
<be32_to_cpupu>:
mov    0x8(%rdi),%ecx
shl    $0x8,%ecx
or     0xc(%rdi),%ecx
mov    (%rdi),%eax
mov    0x4(%rdi),%edx
shl    $0x10,%edx
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @be32_to_cpupu(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %7, %10
%12 = load i32, i32* %0
%13 = shl i32 %12, 24
%14 = or i32 %11, %13
ret i32 %14
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  unsigned long long tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t realtime_now() {
  struct timespec now_ts;
  clock_gettime(CLOCK_REALTIME, &now_ts);
  return ((&now_ts)->tv_sec * 1000000000ULL + (&now_ts)->tv_nsec);
}


x86 assembly (clang, -O0):
<realtime_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realtime_now>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x8(%rsp),%rax
9a 3b
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @realtime_now() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @realtime_now() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add i64 %7, %9
ret i64 %10
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  while ((c = getchar()) != EOF) {
    if (c == 10)
      putchar(13);
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1169 <main+0x49>
cmpl   $0xa,-0x8(%rbp)
jne    115c <main+0x3c>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
jne    1141 <main+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %eax,%ebx
jmp    1165 <main+0x45>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     1137 <main+0x17>
cmp    $0xa,%ebx
jne    1150 <main+0x30>
mov    $0xd,%edi
call   1030 <putchar@plt>
jmp    1150 <main+0x30>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %12, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 10
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @putchar(i32 13)
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
%14 = call i32 @putchar(i32 %13)
br label %3
15: ; preds = %3
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %14, label %4
4: ; preds = %0, %9
%5 = phi i32 [ %11, %9 ], [ %1, %0 ]
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @putchar(i32 13)
br label %9
9: ; preds = %7, %4
%10 = tail call i32 @putchar(i32 %5)
%11 = tail call i32 (...) @getchar()
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %4
14: ; preds = %9, %0
ret i32 0
}
int cmp_int_des(const void *x, const void *y) {
  if (*(int *)x > *(int *)y) {
    return -1;
  } else if (*(int *)x < *(int *)y) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp_int_des>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <cmp_int_des+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <cmp_int_des+0x54>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <cmp_int_des+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1154 <cmp_int_des+0x54>
jmp    114d <cmp_int_des+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int_des>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_int_des(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = icmp sgt i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %25
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = icmp slt i32 %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 1, i32* %3
br label %25
23: ; preds = %14
br label %24
24: ; preds = %23
store i32 0, i32* %3
br label %25
25: ; preds = %24, %22, %13
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @cmp_int_des(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ print_chr(int /*<<< orphan*/);
void print_str(const char *p) {
  while (*p != 0) {
    print_chr(*(p++));
  }
}


x86 assembly (clang, -O0):
<print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <print_str+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <print_chr@plt>
jmp    111c <print_str+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <print_str+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <print_chr@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print_str+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @print_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 @print_chr(i32 %12)
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @print_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @print_chr(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int strcat2(char *s, char *t) {
  while (*s)
    s++;
  while (*t) {
    *s = *t;
    t++;
    s++;
  }
  *s = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<strcat2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <strcat2+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strcat2+0xc>
jmp    112f <strcat2+0x2f>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1165 <strcat2+0x65>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112f <strcat2+0x2f>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat2>:
mov    %rdi,%rcx
add    $0x1,%rdi
cmpb   $0x0,(%rcx)
jne    1100 <strcat2>
mov    (%rsi),%al
test   %al,%al
je     1136 <strcat2+0x36>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
mov    %al,(%rdi,%rcx,1)
movzbl 0x2(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1120 <strcat2+0x20>
add    %rcx,%rdi
mov    %rdi,%rcx
movb   $0x0,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strcat2(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %15, %11 ], [ %1, %8 ]
%14 = phi i8* [ %16, %11 ], [ %4, %8 ]
store i8 %12, i8* %14
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = getelementptr inbounds i8, i8* %14, i64 1
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %4, %8 ], [ %16, %11 ]
store i8 0, i8* %20
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, char *);
int /*<<< orphan*/ wcsutil_double2str(char *, char *, double);
void write_date(char *buf, int hour, int minute, double sec) {
  char ctmp[72];
  wcsutil_double2str(ctmp, "%04.1f", sec);
  sprintf(buf, "T%.2d:%.2d:%s", hour, minute, ctmp);
}


x86 assembly (clang, -O0):
<write_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
lea    0xeb9(%rip),%rsi
call   1040 <wcsutil_double2str@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    -0x60(%rbp),%r8
lea    0xea6(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_date>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec7(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <wcsutil_double2str@plt>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %r15,%r8
call   1030 <sprintf@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%04.1f\00"
@.str.1 = [14 x i8] c"T%.2d:%.2d:%s\00"
define void @write_date(i8* %0, i32 %1, i32 %2, double %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca [72 x i8]
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double %3, double* %8
%10 = getelementptr inbounds [72 x i8], [72 x i8]* %9, i64 0, i64 0
%11 = load double, double* %8
%12 = call i32 @wcsutil_double2str(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %11)
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = getelementptr inbounds [72 x i8], [72 x i8]* %9, i64 0, i64 0
%17 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%04.1f\00"
@.str.1 = [14 x i8] c"T%.2d:%.2d:%s\00"
define void @write_date(i8* nocapture writeonly %0, i32 %1, i32 %2, double %3) {
%5 = alloca [72 x i8]
%6 = getelementptr inbounds [72 x i8], [72 x i8]* %5, i64 0, i64 0
%7 = call i32 @wcsutil_double2str(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %3)
%8 = call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %2, i8* %6)
ret void
}
void ff_hevc_put_hevc_bi_w_qpel_h48_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_h48_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close_gpio();
int /*<<< orphan*/ getCommand(int, int, int, char *);
int /*<<< orphan*/ open_gpio();
int /*<<< orphan*/ repeatCommand(char *);
void send_command_gpio(bool isOn, int device, int index) {
  open_gpio();
  char c[3];
  getCommand(isOn, device, index, c);
  repeatCommand(c);
  close_gpio();
}


x86 assembly (clang, -O0):
<send_command_gpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1050 <open_gpio@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0xf(%rbp),%rcx
call   1040 <getCommand@plt>
lea    -0xf(%rbp),%rdi
call   1030 <repeatCommand@plt>
mov    $0x0,%al
call   1060 <close_gpio@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_command_gpio>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <open_gpio@plt>
lea    0x5(%rsp),%r15
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r15,%rcx
call   1040 <getCommand@plt>
mov    %r15,%rdi
call   1030 <repeatCommand@plt>
xor    %eax,%eax
call   1060 <close_gpio@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @send_command_gpio(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [3 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 (...) @open_gpio()
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%13 = call i32 @getCommand(i32 %9, i32 %10, i32 %11, i8* %12)
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%15 = call i32 @repeatCommand(i8* %14)
%16 = call i32 (...) @close_gpio()
ret void
}

LLVM IR (-O2):
define void @send_command_gpio(i32 %0, i32 %1, i32 %2) {
%4 = alloca [3 x i8]
%5 = tail call i32 (...) @open_gpio()
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%7 = call i32 @getCommand(i32 %0, i32 %1, i32 %2, i8* %6)
%8 = call i32 @repeatCommand(i8* %6)
%9 = call i32 (...) @close_gpio()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hello2() {
  printf("Hello, world!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @hello2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @hello2() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t maxu8(uint8_t a, uint8_t b) { return ((a) < (b) ? (a) : (b)); }


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

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

LLVM IR (-O0):
define i64 @maxu8(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 @maxu8(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ put(char);
void foo() {
  int i;
  for (i = 0; i < 256; i++) {
    put((char)i);
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1145 <foo+0x35>
mov    -0x4(%rbp),%eax
movsbl %al,%edi
call   1030 <put@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <foo+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %bl,%edi
call   1030 <put@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <foo+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %9, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 256
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = load i32, i32* %1
%7 = trunc i32 %6 to i8
%8 = call i32 @put(i8 signext %7)
br label %9
9: ; preds = %5
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %2
12: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = trunc i32 %2 to i8
%4 = tail call i32 @put(i8 signext %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 256
br i1 %6, label %7, label %1
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usage();
int /*<<< orphan*/ validatefilename(char *);
void validate_args(int argc, char *argv[]) {
  if (argc != 2) {
    usage();
  }
  char *fileName = argv[1];
  if (!validatefilename(fileName)) {
    printf("\ninvalid file name");
    usage();
  }
}


x86 assembly (clang, -O0):
<validate_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     1150 <validate_args+0x20>
mov    $0x0,%al
call   1040 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <validatefilename@plt>
cmp    $0x0,%eax
jne    1181 <validate_args+0x51>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <usage@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_args>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1140 <validate_args+0x10>
xor    %eax,%eax
call   1040 <usage@plt>
mov    0x8(%rbx),%rdi
call   1050 <validatefilename@plt>
test   %eax,%eax
je     114f <validate_args+0x1f>
pop    %rbx
ret
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <usage@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\0Ainvalid file name\00"
define void @validate_args(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = call i32 @validatefilename(i8* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %10
%18 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%19 = call i32 (...) @usage()
br label %20
20: ; preds = %17, %10
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0Ainvalid file name\00"
define void @validate_args(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @validatefilename(i8* %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 (...) @usage()
br label %14
14: ; preds = %11, %6
ret void
}
/* Variables and functions */
char *bufncat(char **, char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *bufcat(char **base, char *tail, const char *s) {
  return (tail) ? bufncat(base, tail, s, strlen(s)) : 0;
}


x86 assembly (clang, -O0):
<bufcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117c <bufcat+0x5c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    %eax,%ecx
call   1040 <bufncat@plt>
mov    %rax,-0x20(%rbp)
jmp    1187 <bufcat+0x67>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1187 <bufcat+0x67>
mov    -0x20(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufcat>:
test   %rsi,%rsi
je     1150 <bufcat+0x30>
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <bufncat@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @bufcat(i8** %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @strlen(i8* %2)
%7 = tail call i8* @bufncat(i8** %0, i8* %1, i8* %2, i32 %6)
br label %8
8: ; preds = %3, %5
%9 = phi i8* [ %7, %5 ], [ null, %3 ]
ret i8* %9
}
void upse_r3000_cpu_shutdown(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @upse_r3000_cpu_shutdown() {
ret void
}
/* Variables and functions */
double c_fcn(double *, int);
double objective(double x[], int *ndim) { return c_fcn(x, *ndim); }


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

x86 assembly (clang, -O2):
<objective>:
mov    (%rsi),%esi
jmp    1030 <c_fcn@plt>

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

LLVM IR (-O2):
define double @objective(double* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call double @c_fcn(double* %0, i32 %3)
ret double %4
}
char *bindtextdomain(const char *domainname, const char *dirname) {
  return (char *)(domainname ? domainname : dirname);
}


x86 assembly (clang, -O0):
<bindtextdomain>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1124 <bindtextdomain+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112c <bindtextdomain+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bindtextdomain>:
mov    %rsi,%rax
test   %rdi,%rdi
cmovne %rdi,%rax
ret

LLVM IR (-O0):
define i8* @bindtextdomain(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i8*, i8** %3
br label %11
9: ; preds = %2
%10 = load i8*, i8** %4
br label %11
11: ; preds = %9, %7
%12 = phi i8* [ %8, %7 ], [ %10, %9 ]
ret i8* %12
}

LLVM IR (-O2):
define i8* @bindtextdomain(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* %1, i8* %0
ret i8* %4
}
void _Jv_ThrowAbstractMethodError(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv_ThrowAbstractMethodError() {
ret void
}
void NOP() { asm volatile("nop"); }


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

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

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

LLVM IR (-O2):
define void @NOP() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reverse(char *, int);
int /*<<< orphan*/ reverse_each_word(char *);
int strlen(char *);
void reverse_words(char *s) {
  int n = strlen(s);
  reverse(s, n);
  reverse_each_word(s);
}


x86 assembly (clang, -O0):
<reverse_words>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
call   1050 <reverse_each_word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_words>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <reverse@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <reverse_each_word@plt>

LLVM IR (-O0):
define void @reverse_words(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i32 @reverse(i8* %6, i32 %7)
%9 = load i8*, i8** %2
%10 = call i32 @reverse_each_word(i8* %9)
ret void
}

LLVM IR (-O2):
define void @reverse_words(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @reverse(i8* %0, i32 %2)
%4 = tail call i32 @reverse_each_word(i8* %0)
ret void
}
void MPI_Barrier() {}


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

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

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

LLVM IR (-O2):
define void @MPI_Barrier() {
ret void
}
int IsPerfectSquare(int n) {
  int i;
  for (i = 0; i * i <= n; i++) {
    if (n == i * i) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<IsPerfectSquare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114f <IsPerfectSquare+0x4f>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jne    113c <IsPerfectSquare+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1156 <IsPerfectSquare+0x56>
jmp    1141 <IsPerfectSquare+0x41>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <IsPerfectSquare+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsPerfectSquare>:
test   %edi,%edi
js     1120 <IsPerfectSquare+0x20>
xor    %edx,%edx
mov    $0x1,%eax
mov    $0x1,%ecx
cmp    %edi,%edx
je     1122 <IsPerfectSquare+0x22>
mov    %ecx,%edx
imul   %ecx,%edx
add    $0x1,%ecx
cmp    %edi,%edx
jle    1110 <IsPerfectSquare+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @IsPerfectSquare(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %19, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %4
%15 = mul nsw i32 %13, %14
%16 = icmp eq i32 %12, %15
br i1 %16, label %17, label %18
17: ; preds = %11
store i32 1, i32* %2
br label %23
18: ; preds = %11
br label %19
19: ; preds = %18
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %5
22: ; preds = %5
store i32 0, i32* %2
br label %23
23: ; preds = %22, %17
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @IsPerfectSquare(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %11, label %6
3: ; preds = %6
%4 = mul nsw i32 %10, %10
%5 = icmp sgt i32 %4, %0
br i1 %5, label %11, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %4, %3 ], [ 0, %1 ]
%8 = phi i32 [ %10, %3 ], [ 0, %1 ]
%9 = icmp eq i32 %7, %0
%10 = add nuw nsw i32 %8, 1
br i1 %9, label %11, label %3
11: ; preds = %6, %3, %1
%12 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %6 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int __b64_ntop(int /*<<< orphan*/ const *, int /*<<< orphan*/, char *, size_t);
int ssh_uuencode(const u_char *src, u_int srclength, char *target,
                 size_t targsize) {
  return __b64_ntop(src, srclength, target, targsize);
}


x86 assembly (clang, -O0):
<ssh_uuencode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <__b64_ntop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssh_uuencode>:
jmp    1030 <__b64_ntop@plt>

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

LLVM IR (-O2):
define i32 @ssh_uuencode(i32* %0, i32 %1, i8* %2, i64 %3) {
%5 = tail call i32 @__b64_ntop(i32* %0, i32 %1, i8* %2, i64 %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int imgfile_convert(int /*<<< orphan*/ *);
int /*<<< orphan*/ msg_perror(char const *);
bool imgfile_create(const char *filename_out) {
  FILE *f = fopen(filename_out, "wb");
  if (!f) {
    msg_perror(filename_out);
    return false;
  }
  bool r = imgfile_convert(f);
  fclose(f);
  return r;
}


x86 assembly (clang, -O0):
<imgfile_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1180 <imgfile_create+0x40>
mov    -0x10(%rbp),%rdi
call   1060 <msg_perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    119b <imgfile_create+0x5b>
mov    -0x18(%rbp),%rdi
call   1040 <imgfile_convert@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imgfile_create>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0xeb2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1171 <imgfile_create+0x31>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <imgfile_convert@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
jmp    117b <imgfile_create+0x3b>
mov    %r14,%rdi
call   1060 <msg_perror@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
define i32 @imgfile_create(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @msg_perror(i8* %11)
store i32 0, i32* %2
br label %19
13: ; preds = %1
%14 = load i32*, i32** %4
%15 = call i32 @imgfile_convert(i32* %14)
store i32 %15, i32* %5
%16 = load i32*, i32** %4
%17 = call i32 @fclose(i32* %16)
%18 = load i32, i32* %5
store i32 %18, i32* %2
br label %19
19: ; preds = %13, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define i32 @imgfile_create(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @msg_perror(i8* %0)
br label %9
6: ; preds = %1
%7 = tail call i32 @imgfile_convert(i32* %2)
%8 = tail call i32 @fclose(i32* %2)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ %7, %6 ], [ 0, %4 ]
ret i32 %10
}
/* Variables and functions */
int setup_dhcpv4_socket();
int dhcpv4_setup() { return setup_dhcpv4_socket(); }


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

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

LLVM IR (-O0):
define i32 @dhcpv4_setup() {
%1 = call i32 (...) @setup_dhcpv4_socket()
ret i32 %1
}

LLVM IR (-O2):
define i32 @dhcpv4_setup() {
%1 = tail call i32 (...) @setup_dhcpv4_socket()
ret i32 %1
}
/* Type definitions */
struct h262_gop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct h262_gop *);
void h262_del_gop(struct h262_gop *gop) { free(gop); }


x86 assembly (clang, -O0):
<h262_del_gop>:
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):
<h262_del_gop>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.h262_gop = type { i32 }
define void @h262_del_gop(%struct.h262_gop* nocapture %0) {
%2 = tail call i32 @free(%struct.h262_gop* %0)
ret void
}