xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EX_SOFTWARE;
int /*<<< orphan*/ pfpanic(char *, unsigned short, unsigned short, char const *,
                           char const *, int, int, int /*<<< orphan*/);
void __pfpanic_zmq_socket_bind(unsigned short _syslog, unsigned short _verbose,
                               const char *_function_name,
                               const char *_file_name, int _line_number,
                               int _errno) {
  pfpanic("Unable to bind to ZeroMQ socket", _syslog, _verbose, _function_name,
          _file_name, _line_number, _errno, EX_SOFTWARE);
}


x86 assembly (clang, -O0):
<__pfpanic_zmq_socket_bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x2(%rbp),%si
mov    -0x4(%rbp),%dx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%r10d
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
lea    0xea2(%rip),%rdi
movzwl %si,%esi
movzwl %dx,%edx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <pfpanic@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pfpanic_zmq_socket_bind>:
push   %rax
mov    %r9d,%r10d
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eb8(%rip),%rdi
mov    (%rdi),%eax
lea    0xecf(%rip),%rdi
push   %rax
push   %r10
call   1030 <pfpanic@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Unable to bind to ZeroMQ socket\00"
@EX_SOFTWARE = global i32 0
define void @__pfpanic_zmq_socket_bind(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i16 %0, i16* %7
store i16 %1, i16* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i16, i16* %7
%14 = load i16, i16* %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = load i32, i32* @EX_SOFTWARE
%20 = call i32 @pfpanic(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i16 zeroext %13, i16 zeroext %14, i8* %15, i8* %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Unable to bind to ZeroMQ socket\00"
@EX_SOFTWARE = global i32 0
define void @__pfpanic_zmq_socket_bind(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = load i32, i32* @EX_SOFTWARE
%8 = tail call i32 @pfpanic(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %7)
ret void
}
/* Variables and functions */
scalar_t__ random();
double rand_value_double(void) { return (double)random(); }


x86 assembly (clang, -O0):
<rand_value_double>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_value_double>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand_value_double() {
%1 = call i64 (...) @random()
%2 = sitofp i64 %1 to double
ret double %2
}

LLVM IR (-O2):
define double @rand_value_double() {
%1 = tail call i64 (...) @random()
%2 = sitofp i64 %1 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ conio_init();
void caca_conio_textmode(int newmode) { conio_init(); }


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

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

LLVM IR (-O0):
define void @caca_conio_textmode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @conio_init()
ret void
}

LLVM IR (-O2):
define void @caca_conio_textmode(i32 %0) {
%2 = tail call i32 (...) @conio_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
void testMacro(void) {
  printf("Macro(\"\\r\\n\") is %lu:\n", sizeof("aaaaa\r\n"));
  printf("Macro strlen (\"\\r\\n\") is %lu:\n", strlen("aaaaa\r\n"));
}


x86 assembly (clang, -O0):
<testMacro>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
lea    0xefa(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testMacro>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
lea    0xefd(%rip),%rdi
call   1030 <strlen@plt>
lea    0xed2(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Macro(\22\\r\\n\22) is %lu:\0A\00"
@.str.1 = [31 x i8] c"Macro strlen (\22\\r\\n\22) is %lu:\0A\00"
@.str.2 = [8 x i8] c"aaaaa\0D\0A\00"
define void @testMacro() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Macro(\22\\r\\n\22) is %lu:\0A\00"
@.str.1 = [31 x i8] c"Macro strlen (\22\\r\\n\22) is %lu:\0A\00"
@.str.2 = [8 x i8] c"aaaaa\0D\0A\00"
define void @testMacro() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello world!\n");
  return 0;
}


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

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

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

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

/* Variables and functions */
scalar_t__ gethrtime();
void burn_cycles(uint64_t nsecs) {
  uint64_t start, end;
  start = gethrtime();
  end = start;
  while (end - start <= nsecs)
    end = gethrtime();
}


x86 assembly (clang, -O0):
<burn_cycles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <gethrtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     1151 <burn_cycles+0x41>
mov    $0x0,%al
call   1030 <gethrtime@plt>
mov    %rax,-0x18(%rbp)
jmp    112f <burn_cycles+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<burn_cycles>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <gethrtime@plt>
test   %r14,%r14
js     113f <burn_cycles+0x2f>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gethrtime@plt>
sub    %rbx,%rax
cmp    %r14,%rax
jle    1130 <burn_cycles+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @burn_cycles(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = call i64 (...) @gethrtime()
store i64 %5, i64* %3
%6 = load i64, i64* %3
store i64 %6, i64* %4
br label %7
7: ; preds = %13, %1
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = sub nsw i64 %8, %9
%11 = load i64, i64* %2
%12 = icmp sle i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i64 (...) @gethrtime()
store i64 %14, i64* %4
br label %7
15: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @burn_cycles(i64 %0) {
%2 = tail call i64 (...) @gethrtime()
%3 = icmp slt i64 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = tail call i64 (...) @gethrtime()
%6 = sub nsw i64 %5, %2
%7 = icmp sgt i64 %6, %0
br i1 %7, label %8, label %4
8: ; preds = %4, %1
ret void
}
/* Type definitions */
struct parse {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ parse_warn(struct parse *, char *);
int /*<<< orphan*/ skip_to_semi(struct parse *);
void parse_ia_na_declaration(struct parse *cfile) {
  parse_warn(cfile, "No DHCPv6 support.");
  skip_to_semi(cfile);
}


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

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

LLVM IR (-O0):
%struct.parse = type { i32 }
@.str = [19 x i8] c"No DHCPv6 support.\00"
define void @parse_ia_na_declaration(%struct.parse* %0) {
%2 = alloca %struct.parse*
store %struct.parse* %0, %struct.parse** %2
%3 = load %struct.parse*, %struct.parse** %2
%4 = call i32 @parse_warn(%struct.parse* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = load %struct.parse*, %struct.parse** %2
%6 = call i32 @skip_to_semi(%struct.parse* %5)
ret void
}

LLVM IR (-O2):
%struct.parse = type { i32 }
@.str = [19 x i8] c"No DHCPv6 support.\00"
define void @parse_ia_na_declaration(%struct.parse* %0) {
%2 = tail call i32 @parse_warn(%struct.parse* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @skip_to_semi(%struct.parse* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_free(void *);
void yyfree(void *ptr, void *yyscanner) { parse_free(ptr); }


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

x86 assembly (clang, -O2):
<yyfree>:
jmp    1030 <parse_free@plt>

LLVM IR (-O0):
define void @yyfree(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 = call i32 @parse_free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @yyfree(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @parse_free(i8* %0)
ret void
}
int foo(int a, int b, int c) {
  int arr[5] = {1, 2, 3, 4, 5};
  int d = 4;
  int *p = &d;
  return a + b + c + arr[4] + arr[0] + *p;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xee7(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x4,-0x24(%rbp)
lea    -0x24(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x20(%rbp),%eax
mov    -0x30(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
add    %esi,%edi
lea    (%rdx,%rdi,1),%eax
add    $0xa,%eax
ret

LLVM IR (-O0):
@__const.foo.arr = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [5 x i32]
%8 = alloca i32
%9 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = bitcast [5 x i32]* %7 to i8*
store i32 4, i32* %8
store i32* %8, i32** %9
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 4
%17 = load i32, i32* %16
%18 = add nsw i32 %15, %17
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%20 = load i32, i32* %19
%21 = add nsw i32 %18, %20
%22 = load i32*, i32** %9
%23 = load i32, i32* %22
%24 = add nsw i32 %21, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, 10
%5 = add i32 %4, %1
%6 = add i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *);
int nogr_get_key(void) {
  printf("? ");
  return getchar();
}


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

x86 assembly (clang, -O2):
<nogr_get_key>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"? \00"
define i32 @nogr_get_key() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret i32 %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"? \00"
define i32 @nogr_get_key() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 %2
}
__attribute__((visibility("default"))) int get_builto_value(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @get_builto_value() {
ret i32 1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t uint16_encode(uint16_t value, uint8_t *p_encoded_data) {
  p_encoded_data[0] = (uint8_t)((value & 0x00FF) >> 0);
  p_encoded_data[1] = (uint8_t)((value & 0xFF00) >> 8);
  return sizeof(uint16_t);
}


x86 assembly (clang, -O0):
<uint16_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
sar    $0x0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint16_encode>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %ecx,(%rsi)
movzbl %ah,%eax
mov    %eax,0x4(%rsi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @uint16_encode(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 255
%7 = ashr i32 %6, 0
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %3
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
ret i32 4
}

LLVM IR (-O2):
define i32 @uint16_encode(i32 %0, i32* nocapture writeonly %1) {
%3 = and i32 %0, 255
store i32 %3, i32* %1
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %5, i32* %6
ret i32 4
}
unsigned int utilities_uimin(unsigned int i0, unsigned int i1) {
  if (i0 < i1)
    return i0;
  else
    return i1;
}


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

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

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

LLVM IR (-O2):
define i32 @utilities_uimin(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getMin(char *, char *);
int strncmp(char *, char *, int /*<<< orphan*/);
int myStrncmp(char *s1, char *s2) { return strncmp(s1, s2, getMin(s1, s2)); }


x86 assembly (clang, -O0):
<myStrncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <getMin@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myStrncmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <getMin@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @myStrncmp(i8* %0, i8* %1) {
%3 = tail call i32 @getMin(i8* %0, i8* %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
int test(str)
register char *str;
{
  char tokenbuf[5100];
  if (match(tokenbuf, str))
    return (1);
  else {
    pbstr(tokenbuf);
    return (0);
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1400,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x1400(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <match@plt>
cmp    $0x0,%eax
je     1156 <test+0x36>
movl   $0x1,-0x4(%rbp)
jmp    116b <test+0x4b>
lea    -0x1400(%rbp),%rdi
mov    $0x0,%al
call   1040 <pbstr@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x13f8,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <match@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1147 <test+0x27>
add    $0x13f8,%rsp
ret
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <pbstr@plt>
xor    %eax,%eax
add    $0x13f8,%rsp
ret

LLVM IR (-O0):
define i32 @test(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [5100 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [5100 x i8], [5100 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @match to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %13
10: ; preds = %1
%11 = getelementptr inbounds [5100 x i8], [5100 x i8]* %4, i64 0, i64 0
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @pbstr to i32 (i8*, ...)*)(i8* %11)
store i32 0, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @test(i8* %0) {
%2 = alloca [5100 x i8]
%3 = getelementptr inbounds [5100 x i8], [5100 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @match to i32 (i8*, i8*, ...)*)(i8* %3, i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @pbstr to i32 (i8*, ...)*)(i8* %3)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ 0, %6 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ malloc(int);
void other_func(void) {
  char *ptr;
  ptr = (char *)malloc(32);
  (void)ptr;
  return;
}


x86 assembly (clang, -O0):
<other_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<other_func>:
mov    $0x20,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @other_func() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 32)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
define void @other_func() {
%1 = tail call i64 @malloc(i32 32)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t parse_u16(uint8_t *d) {
  uint16_t n = 0;
  int i;
  for (i = 0; i < 2; ++i) {
    n <<= 8;
    n += d[i];
  }
  return n;
}


x86 assembly (clang, -O0):
<parse_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    114d <parse_u16+0x4d>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <parse_u16+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_u16>:
mov    (%rdi),%eax
shl    $0x8,%eax
add    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @parse_u16(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = add i32 %4, %7
ret i32 %8
}
int input(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @input() {
ret i32 0
}
long double ldbl(long double a, long double b, long double c) { return a; }


x86 assembly (clang, -O0):
<ldbl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldbl>:
fldt   0x8(%rsp)
ret

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

LLVM IR (-O2):
define x86_fp80 @ldbl(x86_fp80 returned %0, x86_fp80 %1, x86_fp80 %2) {
ret x86_fp80 %0
}
/* Variables and functions */
int /*<<< orphan*/ iter_quicksort(int *, int /*<<< orphan*/, size_t);
void iter_qsort_wrapper(int a[], size_t n) { iter_quicksort(a, 0, n - 1); }


x86 assembly (clang, -O0):
<iter_qsort_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
xor    %esi,%esi
call   1030 <iter_quicksort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iter_qsort_wrapper>:
lea    -0x1(%rsi),%rdx
xor    %esi,%esi
jmp    1030 <iter_quicksort@plt>

LLVM IR (-O0):
define void @iter_qsort_wrapper(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = sub i64 %6, 1
%8 = call i32 @iter_quicksort(i32* %5, i32 0, i64 %7)
ret void
}

LLVM IR (-O2):
define void @iter_qsort_wrapper(i32* %0, i64 %1) {
%3 = add i64 %1, -1
%4 = tail call i32 @iter_quicksort(i32* %0, i32 0, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read(int, unsigned char *, int);
int get_bit(int fd) {
  static int bit_count = 0;
  static unsigned char ch = '\0';
  if (bit_count-- == 0) {
    read(fd, &ch, sizeof(unsigned char));
    bit_count = 7;
  }
  return ((ch >> bit_count) & 0x0001);
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f0b(%rip),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,0x2f00(%rip)
cmp    $0x0,%eax
jne    1153 <get_bit+0x43>
mov    -0x4(%rbp),%edi
lea    0x2ef1(%rip),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movl   $0x7,0x2ed9(%rip)
movzbl 0x2ed6(%rip),%eax
mov    0x2ecc(%rip),%ecx
sar    %cl,%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
push   %rax
mov    0x2f15(%rip),%ecx
sub    $0x1,%ecx
mov    %ecx,0x2f0c(%rip)
jae    1142 <get_bit+0x32>
lea    0x2f07(%rip),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movl   $0x7,0x2eef(%rip)
mov    $0x7,%ecx
movzbl 0x2ee7(%rip),%eax
shr    %cl,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@get_bit.bit_count = internal global i32 0
@get_bit.ch = internal global i8 0
define i32 @get_bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @get_bit.bit_count
%4 = add nsw i32 %3, -1
store i32 %4, i32* @get_bit.bit_count
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @read(i32 %7, i8* @get_bit.ch, i32 1)
store i32 7, i32* @get_bit.bit_count
br label %9
9: ; preds = %6, %1
%10 = load i8, i8* @get_bit.ch
%11 = zext i8 %10 to i32
%12 = load i32, i32* @get_bit.bit_count
%13 = ashr i32 %11, %12
%14 = and i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
@get_bit.bit_count = internal unnamed_addr global i32 0
@get_bit.ch = internal global i8 0
define i32 @get_bit(i32 %0) {
%2 = load i32, i32* @get_bit.bit_count
%3 = add nsw i32 %2, -1
store i32 %3, i32* @get_bit.bit_count
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @read(i32 %0, i8* @get_bit.ch, i32 1)
store i32 7, i32* @get_bit.bit_count
br label %7
7: ; preds = %5, %1
%8 = phi i32 [ 7, %5 ], [ %3, %1 ]
%9 = load i8, i8* @get_bit.ch
%10 = zext i8 %9 to i32
%11 = lshr i32 %10, %8
%12 = and i32 %11, 1
ret i32 %12
}
unsigned int get_x(unsigned long x) {
  int i;
  for (i = 0; i < 32; i++) {
    if (x & (1 << i))
      return i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_x>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    1157 <get_x+0x57>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1144 <get_x+0x44>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <get_x+0x5e>
jmp    1149 <get_x+0x49>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <get_x+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_x>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
movslq %edx,%rcx
test   %rdi,%rcx
jne    1169 <get_x+0x69>
lea    0x1(%rax),%ecx
mov    $0x1,%edx
shl    %cl,%edx
movslq %edx,%rcx
test   %rdi,%rcx
jne    1162 <get_x+0x62>
lea    0x2(%rax),%ecx
mov    $0x1,%edx
shl    %cl,%edx
movslq %edx,%rcx
test   %rdi,%rcx
jne    1166 <get_x+0x66>
lea    0x3(%rax),%ecx
mov    $0x1,%edx
shl    %cl,%edx
movslq %edx,%rcx
test   %rdi,%rcx
jne    116a <get_x+0x6a>
add    $0x4,%eax
cmp    $0x20,%eax
jne    1110 <get_x+0x10>
xor    %eax,%eax
ret
add    $0x1,%eax
ret
add    $0x2,%eax
ret
add    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @get_x(i64 %0) {
br label %2
2: ; preds = %26, %1
%3 = phi i32 [ 0, %1 ], [ %27, %26 ]
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = and i64 %5, %0
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %29
8: ; preds = %2
%9 = or i32 %3, 1
%10 = shl nuw i32 1, %9
%11 = sext i32 %10 to i64
%12 = and i64 %11, %0
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %29
14: ; preds = %8
%15 = or i32 %3, 2
%16 = shl nuw i32 1, %15
%17 = sext i32 %16 to i64
%18 = and i64 %17, %0
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %29
20: ; preds = %14
%21 = or i32 %3, 3
%22 = shl nuw i32 1, %21
%23 = sext i32 %22 to i64
%24 = and i64 %23, %0
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %20
%27 = add nuw nsw i32 %3, 4
%28 = icmp eq i32 %27, 32
br i1 %28, label %29, label %2
29: ; preds = %26, %20, %14, %8, %2
%30 = phi i32 [ %3, %2 ], [ %9, %8 ], [ %15, %14 ], [ %21, %20 ], [ 0, %26 ]
ret i32 %30
}
/* Variables and functions */
int /*<<< orphan*/ isprint(char);
char *strprint(char *str) {
  while (*str && !isprint(*str))
    str++;
  return str;
}


x86 assembly (clang, -O0):
<strprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <strprint+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isprint@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <strprint+0x48>
jmp    1169 <strprint+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strprint+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strprint>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <strprint+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isprint@plt>
test   %eax,%eax
jne    1138 <strprint+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strprint+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strprint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %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 = load i8, i8* %9
%11 = call i32 @isprint(i8 signext %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @strprint(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isprint(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ bar(char);
int /*<<< orphan*/ foo(char);
int main(int argc, char **argv) {
  if (argc != 1)
    return 42;
  foo(argv[0][0]);
  bar(argv[0][1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0x2a,-0x4(%rbp)
jmp    1172 <main+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1040 <foo@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%edi
call   1030 <bar@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x2a,%eax
cmp    $0x1,%edi
jne    1148 <main+0x28>
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rax
movsbl (%rax),%edi
call   1040 <foo@plt>
mov    (%rbx),%rax
movsbl 0x1(%rax),%edi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = load i8, i8* %5
%7 = tail call i32 @foo(i8 signext %6)
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = tail call i32 @bar(i8 signext %10)
br label %12
12: ; preds = %2, %4
%13 = phi i32 [ 0, %4 ], [ 42, %2 ]
ret i32 %13
}
/* Variables and functions */
int vrna_hamming_distance_bound(char const *, char const *, int);
int hamming_bound(const char *s1, const char *s2, int boundary) {
  return vrna_hamming_distance_bound(s1, s2, boundary);
}


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

x86 assembly (clang, -O2):
<hamming_bound>:
jmp    1030 <vrna_hamming_distance_bound@plt>

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

LLVM IR (-O2):
define i32 @hamming_bound(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @vrna_hamming_distance_bound(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
void foo098() {}


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

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

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

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @UnlockMagickMutex() {
ret void
}
/* Variables and functions */
int float_interval(int, int);
int main() {
  int x, y, k;
  while (1) {
    k = float_interval(-1, 1);
    x = 0.8 * x + k;
    y = 0.9 * y + k;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <float_interval@plt>
mov    %eax,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xec5(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,-0x30(%rbp)
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xe92(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,-0x20(%rbp)
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <float_interval@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %0, %5
%6 = call i32 @float_interval(i32 -1, i32 1)
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double 8.000000e-01, double %8, double %10)
%12 = fptosi double %11 to i32
store i32 %12, i32* %2
%13 = load i32, i32* %3
%14 = sitofp i32 %13 to double
%15 = load i32, i32* %4
%16 = sitofp i32 %15 to double
%17 = call double @llvm.fmuladd.f64(double 9.000000e-01, double %14, double %16)
%18 = fptosi double %17 to i32
store i32 %18, i32* %3
br label %5
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @float_interval(i32 -1, i32 1)
br label %1
}
/* Variables and functions */
char *strdup(char const *);
scalar_t__ try_create_trash_dir(char const *);
int pick_trash_dir_traverser(const char base_path[], const char trash_dir[],
                             void *arg) {
  if (try_create_trash_dir(trash_dir) == 0) {
    char **const result = arg;
    *result = strdup(trash_dir);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<pick_trash_dir_traverser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <try_create_trash_dir@plt>
cmp    $0x0,%rax
jne    116e <pick_trash_dir_traverser+0x4e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1175 <pick_trash_dir_traverser+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pick_trash_dir_traverser>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1030 <try_create_trash_dir@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    114c <pick_trash_dir_traverser+0x2c>
mov    %rbx,%rdi
call   1040 <strdup@plt>
mov    %rax,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @pick_trash_dir_traverser(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8**
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load i8*, i8** %6
%10 = call i64 @try_create_trash_dir(i8* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %3
%13 = load i8*, i8** %7
%14 = bitcast i8* %13 to i8**
store i8** %14, i8*** %8
%15 = load i8*, i8** %6
%16 = call i8* @strdup(i8* %15)
%17 = load i8**, i8*** %8
store i8* %16, i8** %17
store i32 1, i32* %4
br label %19
18: ; preds = %3
store i32 0, i32* %4
br label %19
19: ; preds = %18, %12
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @pick_trash_dir_traverser(i8* nocapture readnone %0, i8* %1, i8* nocapture writeonly %2) {
%4 = tail call i64 @try_create_trash_dir(i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = bitcast i8* %2 to i8**
%8 = tail call i8* @strdup(i8* %1)
store i8* %8, i8** %7
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ program_parts();
int yyselect();
program() {
  switch (yyselect()) {
  case 1: {
    program_parts();
  } break;
  case 2: {
    program_parts();
    program();
  } break;
  }
}


x86 assembly (clang, -O0):
<program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <yyselect@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x1,%eax
je     1163 <program+0x33>
jmp    1152 <program+0x22>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     116f <program+0x3f>
jmp    117b <program+0x4b>
mov    $0x0,%al
call   1050 <program_parts@plt>
jmp    117b <program+0x4b>
mov    $0x0,%al
call   1050 <program_parts@plt>
call   1040 <program@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<program>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <yyselect@plt>
cmp    $0x2,%eax
jne    1145 <program+0x25>
xor    %eax,%eax
call   1040 <program_parts@plt>
jmp    1130 <program+0x10>
cmp    $0x1,%eax
jne    1151 <program+0x31>
xor    %eax,%eax
call   1040 <program_parts@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @program() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @yyselect()
switch i32 %2, label %7 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %1
%4 = tail call i32 (...) @program_parts()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @program_parts()
br label %1
7: ; preds = %1, %3
ret i32 undef
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int fs_exists(const char *path) {
  struct stat b;
  return stat(path, &b);
}


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

x86 assembly (clang, -O2):
<fs_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fs_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fs_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
ret i32 %4
}
void gdk_window_set_skip_taskbar_hint() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_set_skip_taskbar_hint() {
ret void
}
int p01abz_() {
  int s_stop();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @p01abz_() {
ret i32 0
}
void clearScreen() {
  printf("\033[2J");
  printf("\033[%d;%dH", 0, 0);
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [9 x i8] c"\1B[%d;%dH\00"
define void @clearScreen() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [9 x i8] c"\1B[%d;%dH\00"
define void @clearScreen() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void const *, size_t);
char *mem2strcpy(char *dest, const void *src, size_t n, size_t nmax) {
  if (n + 1 > nmax)
    n = nmax - 1;
  memcpy(dest, src, n);
  dest[nmax - 1] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<mem2strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
cmp    -0x20(%rbp),%rax
jbe    1146 <mem2strcpy+0x36>
mov    -0x20(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem2strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdi,%rbx
lea    0x1(%rdx),%rax
add    $0xffffffffffffffff,%rcx
cmp    %r14,%rax
cmova  %rcx,%rdx
call   1030 <memcpy@plt>
movb   $0x0,-0x1(%rbx,%r14,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @mem2strcpy(i8* returned %0, i8* %1, i64 %2, i64 %3) {
%5 = add i64 %2, 1
%6 = icmp ugt i64 %5, %3
%7 = add i64 %3, -1
%8 = select i1 %6, i64 %7, i64 %2
%9 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %8)
%10 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %10
ret i8* %0
}