xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
void broken_pipe_handler() {
  char ch;
  printf("Enter y to continue serving clients or n to halt:");
  scanf("%c", &ch);
  if (ch == 'y') {
    printf("\nwill continue serving clients\n");
  } else
    exit(0);
}


x86 assembly (clang, -O0):
<broken_pipe_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x79,%eax
jne    1172 <broken_pipe_handler+0x42>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
jmp    1179 <broken_pipe_handler+0x49>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<broken_pipe_handler>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xede(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
cmpb   $0x79,0x7(%rsp)
jne    1173 <broken_pipe_handler+0x33>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"Enter y to continue serving clients or n to halt:\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [32 x i8] c"\0Awill continue serving clients\0A\00"
define void @broken_pipe_handler() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 121
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"Enter y to continue serving clients or n to halt:\00"
@.str.1 = [3 x i8] c"%c\00"
@str = [31 x i8] c"\0Awill continue serving clients\00"
define void @broken_pipe_handler() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 121
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
8: ; preds = %0
%9 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, char const *, unsigned int);
int shim_memfd_create(const char *name, unsigned int flags) {
  return (int)shim_enosys(0, name, flags);
}


x86 assembly (clang, -O0):
<shim_memfd_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_memfd_create>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_memfd_create(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @shim_enosys(i32 0, i8* %5, i32 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @shim_memfd_create(i8* %0, i32 %1) {
%3 = tail call i64 @shim_enosys(i32 0, i8* %0, i32 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *get_enclosed_string(char *, char, char);
char *get_string_in_quotes(char *string) {
  return get_enclosed_string(string, '"', '"');
}


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

x86 assembly (clang, -O2):
<get_string_in_quotes>:
mov    $0x22,%esi
mov    $0x22,%edx
jmp    1030 <get_enclosed_string@plt>

LLVM IR (-O0):
define i8* @get_string_in_quotes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @get_enclosed_string(i8* %3, i8 signext 34, i8 signext 34)
ret i8* %4
}

LLVM IR (-O2):
define i8* @get_string_in_quotes(i8* %0) {
%2 = tail call i8* @get_enclosed_string(i8* %0, i8 signext 34, i8 signext 34)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__8__GeneralIO__toggle();
void LedsP__Led1__toggle(void) { Msp430GpioC__8__GeneralIO__toggle(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led1__toggle() {
%1 = tail call i32 (...) @Msp430GpioC__8__GeneralIO__toggle()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage_exit(int exitcode) {
  fprintf(stderr,
          "Usage: dumpiso [opts] [FILE]\n"
          "Dump IEEE 1394 isochronous channels to FILE or standard output.\n"
          "\n"
          "-c --channels  CHANNELS    Listen on these channels; CHANNELS is "
          "either a\n"
          "                           number X or a range X-Y.\n"
          "-p --port      PORT        Choose 1394 chip PORT. (default: 0)\n"
          "-h --help                  Show this help.\n");
  exit(exitcode);
}


x86 assembly (clang, -O0):
<usage_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage_exit>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [327 x i8] c"Usage: dumpiso [opts] [FILE]\0ADump IEEE 1394 isochronous channels to FILE or standard output.\0A\0A-c --channels CHANNELS Listen on these channels; CHANNELS is either a\0A number X or a range X-Y.\0A-p --port PORT Choose 1394 chip PORT. (default: 0)\0A-h --help Show this help.\0A\00"
define void @usage_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([327 x i8], [327 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [327 x i8] c"Usage: dumpiso [opts] [FILE]\0ADump IEEE 1394 isochronous channels to FILE or standard output.\0A\0A-c --channels CHANNELS Listen on these channels; CHANNELS is either a\0A number X or a range X-Y.\0A-p --port PORT Choose 1394 chip PORT. (default: 0)\0A-h --help Show this help.\0A\00"
define void @usage_exit(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([327 x i8], [327 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
void piezo_speaker_init() {}


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

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

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

LLVM IR (-O2):
define void @piezo_speaker_init() {
ret void
}
/* Variables and functions */
int putchar(char);
int puts(const char *s) {
  int c;
  while ((c = *s++))
    putchar(c);
  return putchar('\n');
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     114a <puts+0x3a>
mov    -0xc(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @putchar(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @putchar(i8 signext 10)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ foo1();
int /*<<< orphan*/ foo2();
void bar() {
  int a = 0;
  static char mem[1000 * 64];
  int ii, jj;
  for (ii = 0; ii < 4; ++ii) {
    for (jj = 0; jj < 10; ++jj)
      a += mem[jj * 64];
    foo1();
    foo2();
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1195 <bar+0x75>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1179 <bar+0x59>
mov    -0xc(%rbp),%eax
shl    $0x6,%eax
movslq %eax,%rcx
lea    0x2edf(%rip),%rax
movsbl (%rax,%rcx,1),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <bar+0x27>
mov    $0x0,%al
call   1040 <foo1@plt>
mov    $0x0,%al
call   1030 <foo2@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <bar+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@bar.mem = internal global [64000 x i8] zeroinitializer
define void @bar() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %26, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %29
7: ; preds = %4
store i32 0, i32* %3
br label %8
8: ; preds = %20, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, 64
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [64000 x i8], [64000 x i8]* @bar.mem, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i32, i32* %1
%19 = add nsw i32 %18, %17
store i32 %19, i32* %1
br label %20
20: ; preds = %11
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %8
23: ; preds = %8
%24 = call i32 (...) @foo1()
%25 = call i32 (...) @foo2()
br label %26
26: ; preds = %23
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %4
29: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 (...) @foo1()
%2 = tail call i32 (...) @foo2()
%3 = tail call i32 (...) @foo1()
%4 = tail call i32 (...) @foo2()
%5 = tail call i32 (...) @foo1()
%6 = tail call i32 (...) @foo2()
%7 = tail call i32 (...) @foo1()
%8 = tail call i32 (...) @foo2()
ret void
}
int __skb_linearize(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__skb_linearize() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lstBin(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  char *infile = NULL;
  char *outfile = NULL;
  if (argc == 1) {
    printf("Usage: \n lstbin fib.lst fib.bin \n");
  } else {
    infile = argv[1];
    outfile = argv[2];
  }
  lstBin(infile, outfile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1161 <main+0x41>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1179 <main+0x59>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <lstBin@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    1138 <main+0x18>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
xor    %esi,%esi
jmp    1140 <main+0x20>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <lstBin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: \0A lstbin fib.lst fib.bin \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %7
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %19
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
store i8* %15, i8** %6
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
store i8* %18, i8** %7
br label %19
19: ; preds = %12, %10
%20 = load i8*, i8** %6
%21 = load i8*, i8** %7
%22 = call i32 @lstBin(i8* %20, i8* %21)
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"Usage: \0A lstbin fib.lst fib.bin \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
br label %11
11: ; preds = %6, %4
%12 = phi i8* [ null, %4 ], [ %8, %6 ]
%13 = phi i8* [ null, %4 ], [ %10, %6 ]
%14 = tail call i32 @lstBin(i8* %12, i8* %13)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sig_t;

/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
sig_t mazen_sigalrm() {
  printf("in sigalrm\n");
  fflush(stdin);
  signal(SIGALRM, (sig_t)mazen_sigalrm);
  alarm(3);
  return 0;
}


x86 assembly (clang, -O0):
<mazen_sigalrm>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    0x2e8a(%rip),%rax
mov    %eax,%esi
call   1050 <signal@plt>
mov    $0x3,%edi
call   1040 <alarm@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mazen_sigalrm>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    0x2e8e(%rip),%esi
call   1050 <signal@plt>
mov    $0x3,%edi
call   1040 <alarm@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"in sigalrm\0A\00"
@stdin = global i32 0
@SIGALRM = global i32 0
define i32 @mazen_sigalrm() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdin
%3 = call i32 @fflush(i32 %2)
%4 = load i32, i32* @SIGALRM
%5 = call i32 @signal(i32 %4, i32 ptrtoint (i32 ()* @mazen_sigalrm to i32))
%6 = call i32 @alarm(i32 3)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@SIGALRM = global i32 0
@str = [11 x i8] c"in sigalrm\00"
define i32 @mazen_sigalrm() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdin
%3 = tail call i32 @fflush(i32 %2)
%4 = load i32, i32* @SIGALRM
%5 = tail call i32 @signal(i32 %4, i32 ptrtoint (i32 ()* @mazen_sigalrm to i32))
%6 = tail call i32 @alarm(i32 3)
ret i32 0
}
const char *MergeOperatorName(void *arg) {
  (void)arg;
  return "TestMergeOperator";
}


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

x86 assembly (clang, -O2):
<MergeOperatorName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"TestMergeOperator\00"
define i8* @MergeOperatorName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"TestMergeOperator\00"
define i8* @MergeOperatorName(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ strlcpy(char *, char const *, int);
void f3() {
  char dst[2];
  const char *src = "abdef";
  strlcpy(dst, src, 5);
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x2(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strlcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x6(%rsp),%rdi
mov    $0x5,%edx
call   1030 <strlcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"abdef\00"
define void @f3() {
%1 = alloca [2 x i8]
%2 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%4 = load i8*, i8** %2
%5 = call i32 @strlcpy(i8* %3, i8* %4, i32 5)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"abdef\00"
define void @f3() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}
/* Variables and functions */
size_t rgb555_sz(unsigned width, unsigned height) { return width * height * 2; }


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

x86 assembly (clang, -O2):
<rgb555_sz>:
imul   %esi,%edi
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i64 @rgb555_sz(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 = load i32, i32* %4
%7 = mul i32 %5, %6
%8 = mul i32 %7, 2
%9 = zext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @rgb555_sz(i32 %0, i32 %1) {
%3 = shl i32 %0, 1
%4 = mul i32 %3, %1
%5 = zext i32 %4 to i64
ret i64 %5
}
/* Type definitions */
struct stat {
  int st_size;
};
typedef int off_t;

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
off_t get_filesize_(const char *srcpath) {
  struct stat srcstat;
  if (0 == stat(srcpath, &srcstat))
    return srcstat.st_size;
  else
    return -1;
}


x86 assembly (clang, -O0):
<get_filesize_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1142 <get_filesize_+0x32>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <get_filesize_+0x39>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_filesize_(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 0, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_filesize_(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
double scale_dh31(double x, double y, double z) { return 0.0; }


x86 assembly (clang, -O0):
<scale_dh31>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_dh31>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @scale_dh31(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @scale_dh31(double %0, double %1, double %2) {
ret double 0.000000e+00
}
short extractLower16(void *address) {
  unsigned int addr = (unsigned int)address;
  return addr & 0x8000 ? (addr & 0xffff) - 0x10000 : addr & 0xffff;
}


x86 assembly (clang, -O0):
<extractLower16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1135 <extractLower16+0x35>
mov    -0xc(%rbp),%eax
and    $0xffff,%eax
sub    $0x10000,%eax
mov    %eax,-0x10(%rbp)
jmp    1140 <extractLower16+0x40>
mov    -0xc(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @extractLower16(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, 32768
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = and i32 %10, 65535
%12 = sub i32 %11, 65536
br label %16
13: ; preds = %1
%14 = load i32, i32* %3
%15 = and i32 %14, 65535
br label %16
16: ; preds = %13, %9
%17 = phi i32 [ %12, %9 ], [ %15, %13 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @extractLower16(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i16
ret i16 %3
}
void badlvalue(nodeptr) struct nodestruct *nodeptr;
{
  error("invalid lvalue");
  fixnode(nodeptr);
}


x86 assembly (clang, -O0):
<badlvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <error@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <fixnode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badlvalue>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <error@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fixnode@plt>

LLVM IR (-O0):
%struct.nodestruct = type opaque
@.str = [15 x i8] c"invalid lvalue\00"
define void @badlvalue(%struct.nodestruct* %0) {
%2 = alloca %struct.nodestruct*
store %struct.nodestruct* %0, %struct.nodestruct** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.nodestruct*, %struct.nodestruct** %2
%5 = call i32 (%struct.nodestruct*, ...) bitcast (i32 (...)* @fixnode to i32 (%struct.nodestruct*, ...)*)(%struct.nodestruct* %4)
ret void
}

LLVM IR (-O2):
%struct.nodestruct = type opaque
@.str = [15 x i8] c"invalid lvalue\00"
define void @badlvalue(%struct.nodestruct* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (%struct.nodestruct*, ...) bitcast (i32 (...)* @fixnode to i32 (%struct.nodestruct*, ...)*)(%struct.nodestruct* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gd_filetype_function(int);
void png_filetype_function(void) { gd_filetype_function(1); }


x86 assembly (clang, -O0):
<png_filetype_function>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <gd_filetype_function@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<png_filetype_function>:
mov    $0x1,%edi
jmp    1030 <gd_filetype_function@plt>

LLVM IR (-O0):
define void @png_filetype_function() {
%1 = call i32 @gd_filetype_function(i32 1)
ret void
}

LLVM IR (-O2):
define void @png_filetype_function() {
%1 = tail call i32 @gd_filetype_function(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flushWrite();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void linenoiseClearScreen(void) {
  fprintf(stdout, "\x1b[H\x1b[2J");
  flushWrite();
}


x86 assembly (clang, -O0):
<linenoiseClearScreen>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <flushWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<linenoiseClearScreen>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <flushWrite@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"\1B[H\1B[2J\00"
define void @linenoiseClearScreen() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @flushWrite()
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"\1B[H\1B[2J\00"
define void @linenoiseClearScreen() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @flushWrite()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ fix_sum(int *, int, int);
void main() {
  int arr[] = {1, 2, 13, 4, 5, 10, 91, 8, 7, 11, 15};
  int len = sizeof(arr) / sizeof(arr[0]);
  int sum = 15;
  fix_sum(arr, len, sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x2c,%edx
call   1040 <memcpy@plt>
movl   $0xb,-0x34(%rbp)
movl   $0xf,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
call   1030 <fix_sum@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movups 0xf01(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xb,%esi
mov    $0xf,%edx
call   1030 <fix_sum@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [11 x i32] [i32 1, i32 2, i32 13, i32 4, i32 5, i32 10, i32 91, i32 8, i32 7, i32 11, i32 15]
define void @main() {
%1 = alloca [11 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [11 x i32]* %1 to i8*
store i32 11, i32* %2
store i32 15, i32* %3
%5 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @fix_sum(i32* %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@__const.main.arr = [11 x i32] [i32 1, i32 2, i32 13, i32 4, i32 5, i32 10, i32 91, i32 8, i32 7, i32 11, i32 15]
define void @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%4 = call i32 @fix_sum(i32* %3, i32 11, i32 15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_udp();
int main(int argc, char *argv[]) {
  printf("test_udp 2\n");
  test_udp();
  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)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test_udp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"test_udp 2\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @test_udp()
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"test_udp 2\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test_udp()
ret i32 0
}
unsigned long b_smp_dequeue(void) {
  unsigned long tlong;
  asm volatile("call 0x00100118" : "=a"(tlong));
  return tlong;
}


x86 assembly (clang, -O0):
<b_smp_dequeue>:
push   %rbp
mov    %rsp,%rbp
call   100118 <completed.0+0xfc0f8>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_smp_dequeue>:
call   100118 <completed.0+0xfc0f8>
ret

LLVM IR (-O0):
define i64 @b_smp_dequeue() {
%1 = alloca i64
%2 = call i64 asm sideeffect "call 0x00100118", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @b_smp_dequeue() {
%1 = tail call i64 asm sideeffect "call 0x00100118", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
void set_ulog_param(double *a0, double *a1, double *a2, double *b4) {
  *a0 = 1.0;
  *a1 = 1.0;
  *a2 = 1.0;
  *b4 = 1.0;
}


x86 assembly (clang, -O0):
<set_ulog_param>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xeb0(%rip),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ulog_param>:
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rdi)
mov    %rax,(%rsi)
mov    %rax,(%rdx)
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @set_ulog_param(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double*, double** %5
store double 1.000000e+00, double* %9
%10 = load double*, double** %6
store double 1.000000e+00, double* %10
%11 = load double*, double** %7
store double 1.000000e+00, double* %11
%12 = load double*, double** %8
store double 1.000000e+00, double* %12
ret void
}

LLVM IR (-O2):
define void @set_ulog_param(double* nocapture writeonly %0, double* nocapture writeonly %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
store double 1.000000e+00, double* %0
store double 1.000000e+00, double* %1
store double 1.000000e+00, double* %2
store double 1.000000e+00, double* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int LOG_PERROR;
int LOG_PID;
int /*<<< orphan*/ log_trigger(char const *);
int /*<<< orphan*/ openlog(char const *, int, int /*<<< orphan*/);
void log_open(char const *app, char const *level) {
  openlog(app ? app : "-", LOG_PERROR | LOG_PID, LOG_DAEMON);
  log_trigger(level);
}


x86 assembly (clang, -O0):
<log_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1148 <log_open+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1158 <log_open+0x38>
lea    0xeb1(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1158 <log_open+0x38>
mov    -0x18(%rbp),%rdi
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
mov    0x2e64(%rip),%rax
or     (%rax),%esi
mov    0x2e73(%rip),%rax
mov    (%rax),%edx
call   1040 <openlog@plt>
mov    -0x10(%rbp),%rdi
call   1030 <log_trigger@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_open>:
push   %rbx
test   %rdi,%rdi
lea    0xed5(%rip),%rax
cmove  %rax,%rdi
mov    %rsi,%rbx
mov    0x2ea7(%rip),%rax
mov    0x2e90(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
call   1040 <openlog@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <log_trigger@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@LOG_PERROR = global i32 0
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @log_open(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 %10
9: ; preds = %2
br label %10
10: ; preds = %9, %7
%11 = phi i8* [ %8, %7 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %9 ]
%12 = load i32, i32* @LOG_PERROR
%13 = load i32, i32* @LOG_PID
%14 = or i32 %12, %13
%15 = load i32, i32* @LOG_DAEMON
%16 = call i32 @openlog(i8* %11, i32 %14, i32 %15)
%17 = load i8*, i8** %4
%18 = call i32 @log_trigger(i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@LOG_PERROR = global i32 0
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @log_open(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0
%5 = load i32, i32* @LOG_PERROR
%6 = load i32, i32* @LOG_PID
%7 = or i32 %6, %5
%8 = load i32, i32* @LOG_DAEMON
%9 = tail call i32 @openlog(i8* %4, i32 %7, i32 %8)
%10 = tail call i32 @log_trigger(i8* %1)
ret void
}
unsigned upscale_256x_320x240_generic_input_fmts(void) { return (1 << 0); }


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

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

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

LLVM IR (-O2):
define i32 @upscale_256x_320x240_generic_input_fmts() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Content-type: text/plain\n");
  printf("\n");
  printf("ABCDE");
  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>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"Content-type: text/plain\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [6 x i8] c"ABCDE\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"ABCDE\00"
@str = [25 x i8] c"Content-type: text/plain\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
int rtsp_digest_auth_check(struct rtsp_client *c, const char *username,
                           const char *password, const char *realm) {
  return -1;
}


x86 assembly (clang, -O0):
<rtsp_digest_auth_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.rtsp_client = type opaque
define i32 @rtsp_digest_auth_check(%struct.rtsp_client* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.rtsp_client*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.rtsp_client* %0, %struct.rtsp_client** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 -1
}

LLVM IR (-O2):
%struct.rtsp_client = type opaque
define i32 @rtsp_digest_auth_check(%struct.rtsp_client* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 -1
}
void rsn_preauth_scan_results(struct wpa_supplicant *wpa_s,
                              struct wpa_scan_result *results, int count) {}


x86 assembly (clang, -O0):
<rsn_preauth_scan_results>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wpa_scan_result = type opaque
define void @rsn_preauth_scan_results(%struct.wpa_supplicant* %0, %struct.wpa_scan_result* %1, i32 %2) {
%4 = alloca %struct.wpa_supplicant*
%5 = alloca %struct.wpa_scan_result*
%6 = alloca i32
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %4
store %struct.wpa_scan_result* %1, %struct.wpa_scan_result** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wpa_scan_result = type opaque
define void @rsn_preauth_scan_results(%struct.wpa_supplicant* nocapture %0, %struct.wpa_scan_result* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mysecFunction();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("hello world\n");
  mysecFunction();
  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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <mysecFunction@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @mysecFunction()
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @mysecFunction()
ret i32 0
}
void gfx_set_color_pattern(unsigned long bgcolor, unsigned long fgcolor,
                           unsigned long data0, unsigned long data1,
                           unsigned long data2, unsigned long data3,
                           unsigned char transparent) {}


x86 assembly (clang, -O0):
<gfx_set_color_pattern>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gfx_set_color_pattern(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i8 zeroext %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i8
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i8 %6, i8* %14
ret void
}

LLVM IR (-O2):
define void @gfx_set_color_pattern(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i8 zeroext %6) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void *shmem_malloc(size_t size) { printf("\nOpenSHMEM Analyzer\n"); }


x86 assembly (clang, -O0):
<shmem_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define noalias i8* @shmem_malloc(i64 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i8* undef
}
void replaceAll(char *str, char oldChar, char newChar) {
  int i = 0;
  while (str[i] != '\0') {
    if (str[i] == oldChar)
      str[i] = newChar;
    i++;
  }
}


x86 assembly (clang, -O0):
<replaceAll>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1163 <replaceAll+0x63>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1155 <replaceAll+0x55>
mov    -0xa(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111a <replaceAll+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<replaceAll>:
mov    (%rdi),%al
test   %al,%al
je     1125 <replaceAll+0x25>
add    $0x1,%rdi
jmp    111b <replaceAll+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <replaceAll+0x25>
cmp    %sil,%al
jne    1110 <replaceAll+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <replaceAll+0x10>
ret

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

LLVM IR (-O2):
define void @replaceAll(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %12
%7 = phi i64 [ %13, %12 ], [ 0, %3 ]
%8 = phi i8 [ %15, %12 ], [ %4, %3 ]
%9 = phi i8* [ %14, %12 ], [ %0, %3 ]
%10 = icmp eq i8 %8, %1
br i1 %10, label %11, label %12
11: ; preds = %6
store i8 %2, i8* %9
br label %12
12: ; preds = %11, %6
%13 = add nuw i64 %7, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %12, %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t depth_log(uint32_t i) {
  uint32_t j;
  j = 0;
  while (i >>= 1)
    j++;
  return j;
}


x86 assembly (clang, -O0):
<depth_log>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <depth_log+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <depth_log+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<depth_log>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <depth_log+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <depth_log+0x10>
ret

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

LLVM IR (-O2):
define i32 @depth_log(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}