xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, size_t, int, int /*<<< orphan*/);
scalar_t__ getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(void) {
  char *line = NULL;
  size_t n = 0;
  while (getline(&line, &n, stdin) >= 0)
    fwrite(line, n, 1, stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <getline@plt>
cmp    $0x0,%rax
jl     117f <main+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e6a(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1040 <fwrite@plt>
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    0x2ea4(%rip),%r15
mov    (%r15),%edx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <getline@plt>
test   %rax,%rax
js     119b <main+0x7b>
mov    0x2e76(%rip),%r12
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%rbx
nopl   0x0(%rax)
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    (%r12),%ecx
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    (%r15),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <getline@plt>
test   %rax,%rax
jns    1170 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 0, i32* %1
store i8* null, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* @stdin
%6 = call i64 @getline(i8** %2, i64* %3, i32 %5)
%7 = icmp sge i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = load i64, i64* %3
%11 = load i32, i32* @stdout
%12 = call i32 @fwrite(i8* %9, i64 %10, i32 1, i32 %11)
br label %4
13: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
define i32 @main() {
%1 = alloca i8*
%2 = alloca i64
%3 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = load i32, i32* @stdin
%6 = call i64 @getline(i8** %1, i64* %2, i32 %5)
%7 = icmp sgt i64 %6, -1
br i1 %7, label %8, label %16
8: ; preds = %0, %8
%9 = load i8*, i8** %1
%10 = load i64, i64* %2
%11 = load i32, i32* @stdout
%12 = call i32 @fwrite(i8* %9, i64 %10, i32 1, i32 %11)
%13 = load i32, i32* @stdin
%14 = call i64 @getline(i8** %1, i64* %2, i32 %13)
%15 = icmp sgt i64 %14, -1
br i1 %15, label %8, label %16
16: ; preds = %8, %0
ret i32 0
}
void WDTimerDisable(void) {
  (*((volatile unsigned long *)(0x40002C04))) &= ~0x00000200;
}


x86 assembly (clang, -O0):
<WDTimerDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40002c04,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffdff,%rcx
mov    $0x40002c04,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WDTimerDisable>:
andq   $0xfffffffffffffdff,0x40002c04
40 ff fd ff ff
ret

LLVM IR (-O0):
define void @WDTimerDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1073753092 to i64*)
%2 = and i64 %1, -513
store volatile i64 %2, i64* inttoptr (i64 1073753092 to i64*)
ret void
}

LLVM IR (-O2):
define void @WDTimerDisable() {
%1 = load volatile i64, i64* inttoptr (i64 1073753092 to i64*)
%2 = and i64 %1, -513
store volatile i64 %2, i64* inttoptr (i64 1073753092 to i64*)
ret void
}
void *GUI_Memset(void *s, unsigned char c, int n) {
  const unsigned char uc = c;
  unsigned char *su;
  for (su = s; 0 < n; ++su, --n) {
    *su = uc;
  }
  return s;
}


x86 assembly (clang, -O0):
<GUI_Memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%eax
jge    114d <GUI_Memset+0x4d>
mov    -0x11(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    111f <GUI_Memset+0x1f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GUI_Memset>:
push   %rbx
mov    %rdi,%rbx
test   %edx,%edx
jle    1126 <GUI_Memset+0x16>
mov    %edx,%edx
movzbl %sil,%esi
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @GUI_Memset(i8* returned writeonly %0, i8 zeroext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ iptoa(char *, int *);
int len(char *);
int /*<<< orphan*/ printf(char *, char *);
int intlen(int x) {
  int v;
  char buf[12];
  v = x;
  iptoa(buf, &v);
  printf("%s\n", buf);
  return len(buf);
}


x86 assembly (clang, -O0):
<intlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <iptoa@plt>
lea    -0x14(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
lea    -0x14(%rbp),%rdi
call   1030 <len@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlen>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,(%rsp)
lea    0x4(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <iptoa@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <len@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @intlen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [12 x i8]
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%7 = call i32 @iptoa(i8* %6, i32* %3)
%8 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%11 = call i32 @len(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @intlen(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i8]
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
store i32 %0, i32* %2
%6 = call i32 @iptoa(i8* %5, i32* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = call i32 @len(i8* %5)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *test_thread(void *arg) {
  printf("Hello from thread!\n");
  pthread_exit(NULL);
  return 0;
}


x86 assembly (clang, -O0):
<test_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"Hello from thread!\0A\00"
define i8* @test_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @pthread_exit(i32* null)
ret i8* null
}

LLVM IR (-O2):
@str = [19 x i8] c"Hello from thread!\00"
define noalias i8* @test_thread(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i32* null)
ret i8* null
}
/* Variables and functions */
void DebugP_log1(const char *format, uintptr_t p1) {}


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

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

LLVM IR (-O0):
define void @DebugP_log1(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @DebugP_log1(i8* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glRotatef(double, int, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
void idle(void) {
  glRotatef(.1, 1, 0, 0);
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<idle>:
push   %rbp
mov    %rsp,%rbp
movsd  0xed4(%rip),%xmm0
mov    $0x1,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <glRotatef@plt>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<idle>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <glRotatef@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glutPostRedisplay@plt>

LLVM IR (-O0):
define void @idle() {
%1 = call i32 @glRotatef(double 1.000000e-01, i32 1, i32 0, i32 0)
%2 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @idle() {
%1 = tail call i32 @glRotatef(double 1.000000e-01, i32 1, i32 0, i32 0)
%2 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void help(void) {
  fputs("\n"
        "infgen "
        "2.4"
        "\n"
        "Usage:\n"
        "\n"
        "  infgen [-dq[q]isrb] input_path > output_path\n"
        "  infgen [-dq[q]isrb] < input_path > output_path\n"
        "\n"
        "    -d   Write raw dynamic header (code lengths in comments)\n"
        "    -q   Do not write dynamic code lengths (comments or not)\n"
        "    -qq  Do not write deflate stream description at all\n"
        "    -i   Include detailed gzip / zlib header descriptions\n"
        "    -s   Include deflate block statistics (as comments)\n"
        "    -r   Assume raw deflate data -- do not look for headers\n"
        "    -b   Write compact binary format (only -r honored)\n"
        "\n",
        stderr);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [526 x i8] c"\0Ainfgen 2.4\0AUsage:\0A\0A infgen [-dq[q]isrb] input_path > output_path\0A infgen [-dq[q]isrb] < input_path > output_path\0A\0A -d Write raw dynamic header (code lengths in comments)\0A -q Do not write dynamic code lengths (comments or not)\0A -qq Do not write deflate stream description at all\0A -i Include detailed gzip / zlib header descriptions\0A -s Include deflate block statistics (as comments)\0A -r Assume raw deflate data -- do not look for headers\0A -b Write compact binary format (only -r honored)\0A\0A\00"
@stderr = global i32 0
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([526 x i8], [526 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [526 x i8] c"\0Ainfgen 2.4\0AUsage:\0A\0A infgen [-dq[q]isrb] input_path > output_path\0A infgen [-dq[q]isrb] < input_path > output_path\0A\0A -d Write raw dynamic header (code lengths in comments)\0A -q Do not write dynamic code lengths (comments or not)\0A -qq Do not write deflate stream description at all\0A -i Include detailed gzip / zlib header descriptions\0A -s Include deflate block statistics (as comments)\0A -r Assume raw deflate data -- do not look for headers\0A -b Write compact binary format (only -r honored)\0A\0A\00"
@stderr = global i32 0
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([526 x i8], [526 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, unsigned short);
void RNDResponseSink_RenderingControl_GetGreenVideoBlackLevel(
    struct UPnPService *Service, int ErrorCode, void *User,
    unsigned short CurrentGreenVideoBlackLevel) {
  printf("RND Invoke Response: "
         "RenderingControl/GetGreenVideoBlackLevel[ErrorCode:%d](%u)\r\n",
         ErrorCode, CurrentGreenVideoBlackLevel);
}


x86 assembly (clang, -O0):
<RNDResponseSink_RenderingControl_GetGreenVideoBlackLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0xc(%rbp),%esi
lea    0xecc(%rip),%rdi
movzwl -0x1a(%rbp),%edx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNDResponseSink_RenderingControl_GetGreenVideoBlackLevel>:
lea    0xee9(%rip),%rdi
mov    %ecx,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [82 x i8] c"RND Invoke Response: RenderingControl/GetGreenVideoBlackLevel[ErrorCode:%d](%u)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_GetGreenVideoBlackLevel(%struct.UPnPService* %0, i32 %1, i8* %2, i16 zeroext %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i16
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i16 %3, i16* %8
%9 = load i32, i32* %6
%10 = load i16, i16* %8
%11 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i32 %9, i16 zeroext %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [82 x i8] c"RND Invoke Response: RenderingControl/GetGreenVideoBlackLevel[ErrorCode:%d](%u)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_GetGreenVideoBlackLevel(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i16 zeroext %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i32 %1, i16 zeroext %3)
ret void
}
long mktime(tmp)
struct tm *const tmp;
{
  tzset();
}


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

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

LLVM IR (-O0):
%struct.tm = type opaque
define i64 @mktime(%struct.tm* %0) {
%2 = alloca i64
%3 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %3
%4 = call i32 (...) @tzset()
%5 = load i64, i64* %2
ret i64 %5
}

LLVM IR (-O2):
%struct.tm = type opaque
define i64 @mktime(%struct.tm* nocapture readnone %0) {
%2 = tail call i32 (...) @tzset()
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "yes", message); }


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

x86 assembly (clang, -O2):
<g_error>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [4 x i8] c"yes\00"
define void @g_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [4 x i8] c"yes\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ be32toh(int /*<<< orphan*/);
void unaligned_write_be32(void *_u, uint32_t a) {
  struct __attribute__((__packed__, __may_alias__)) {
    uint32_t x;
  } *u = _u;
  u->x = be32toh(a);
}


x86 assembly (clang, -O0):
<unaligned_write_be32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <be32toh@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaligned_write_be32>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <be32toh@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.anon = type { i32 }
define void @unaligned_write_be32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.anon*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.anon*
store %struct.anon* %7, %struct.anon** %5
%8 = load i32, i32* %4
%9 = call i32 @be32toh(i32 %8)
%10 = load %struct.anon*, %struct.anon** %5
%11 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @unaligned_write_be32(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @be32toh(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
deflin_(n, s) int *n, *s;
{ deflinestyle(*n, *s); }


x86 assembly (clang, -O0):
<deflin_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <deflinestyle@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deflin_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
xor    %eax,%eax
jmp    1030 <deflinestyle@plt>

LLVM IR (-O0):
define i32 @deflin_(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* %6
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @deflinestyle to i32 (i32, i32, ...)*)(i32 %7, i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @deflin_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @deflinestyle to i32 (i32, i32, ...)*)(i32 %3, i32 %4)
ret i32 undef
}
/* Type definitions */
struct image_object {
  int dummy;
};

/* Variables and functions */
int _singularity_image_bind(struct image_object *);
int singularity_image_bind(struct image_object *image) {
  return (_singularity_image_bind(image));
}


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

x86 assembly (clang, -O2):
<singularity_image_bind>:
jmp    1030 <_singularity_image_bind@plt>

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

LLVM IR (-O2):
%struct.image_object = type { i32 }
define i32 @singularity_image_bind(%struct.image_object* %0) {
%2 = tail call i32 @_singularity_image_bind(%struct.image_object* %0)
ret i32 %2
}
int do_089() { return 89; }


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

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

LLVM IR (-O0):
define i32 @do_089() {
ret i32 89
}

LLVM IR (-O2):
define i32 @do_089() {
ret i32 89
}
/* Type definitions */
struct protoent {
  int p_proto;
};

/* Variables and functions */
struct protoent *getprotobyname(char const *);
int pcap_nametoproto(const char *str) {
  struct protoent *p;
  p = getprotobyname(str);
  if (p != 0)
    return p->p_proto;
  else
    return -1;
}


x86 assembly (clang, -O0):
<pcap_nametoproto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getprotobyname@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1142 <pcap_nametoproto+0x32>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <pcap_nametoproto+0x39>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcap_nametoproto>:
push   %rax
call   1030 <getprotobyname@plt>
test   %rax,%rax
je     111f <pcap_nametoproto+0xf>
mov    (%rax),%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.protoent = type { i32 }
define i32 @pcap_nametoproto(i8* %0) {
%2 = tail call %struct.protoent* @getprotobyname(i8* %0)
%3 = icmp eq %struct.protoent* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.protoent, %struct.protoent* %2, i64 0, i32 0
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
unsigned xrop3_173_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S & D;
  stk2 = T | stk3;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_173_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_173_0_0>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_173_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_173_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = or i32 %5, %3
%7 = xor i32 %6, -256
ret i32 %7
}
/* Type definitions */
typedef int socklen_t;
typedef int /*<<< orphan*/ bufsize;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVBUF;
int /*<<< orphan*/ getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int *);
int /*<<< orphan*/ rs_debug(char *, int, int);
void printrcvbuf(int fd) {
  int bufsize;
  socklen_t solen = sizeof(bufsize);
  getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bufsize, &solen);
  rs_debug("fd:%d socket recv bufsize %d\n", fd, bufsize);
}


x86 assembly (clang, -O0):
<printrcvbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2e93(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%r8
call   1030 <getsockopt@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe9f(%rip),%rdi
call   1040 <rs_debug@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printrcvbuf>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x4,0x8(%rsp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <getsockopt@plt>
mov    0xc(%rsp),%edx
lea    0xea5(%rip),%rdi
mov    %ebx,%esi
call   1040 <rs_debug@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
@.str = [30 x i8] c"fd:%d socket recv bufsize %d\0A\00"
define void @printrcvbuf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_RCVBUF
%8 = call i32 @getsockopt(i32 %5, i32 %6, i32 %7, i32* %3, i32* %4)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @rs_debug(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
@.str = [30 x i8] c"fd:%d socket recv bufsize %d\0A\00"
define void @printrcvbuf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_RCVBUF
%8 = call i32 @getsockopt(i32 %0, i32 %6, i32 %7, i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = call i32 @rs_debug(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float quart;
  printf("Input quarts of water:");
  scanf("%f", &quart);
  printf("The number of water molucules is about %e.", quart / 3 * 1.0e23);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xeae(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe96(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xeb1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
divss  0xeb2(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeae(%rip),%xmm0
lea    0xec9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Input quarts of water:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [43 x i8] c"The number of water molucules is about %e.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fdiv float %5, 3.000000e+00
%7 = fpext float %6 to double
%8 = fmul double %7, 0x44B52D02C7E14AF6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Input quarts of water:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [43 x i8] c"The number of water molucules is about %e.\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fdiv float %5, 3.000000e+00
%7 = fpext float %6 to double
%8 = fmul double %7, 0x44B52D02C7E14AF6
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntDisable(int /*<<< orphan*/);
int /*<<< orphan*/ IntUnregister(int /*<<< orphan*/);
int /*<<< orphan*/ _TimerIntNumberGet(int /*<<< orphan*/, int /*<<< orphan*/);
void TimerIntUnregister(uint32_t ui32Base, uint32_t ui32Timer) {
  uint32_t ui32Int;
  ;

  ;
  ui32Int = _TimerIntNumberGet(ui32Base, ui32Timer);
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<TimerIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_TimerIntNumberGet@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <IntDisable@plt>
mov    -0xc(%rbp),%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerIntUnregister>:
push   %rbx
call   1030 <_TimerIntNumberGet@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <IntDisable@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @TimerIntUnregister(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @_TimerIntNumberGet(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @IntDisable(i32 %9)
%11 = load i32, i32* %5
%12 = call i32 @IntUnregister(i32 %11)
ret void
}

LLVM IR (-O2):
define void @TimerIntUnregister(i32 %0, i32 %1) {
%3 = tail call i32 @_TimerIntNumberGet(i32 %0, i32 %1)
%4 = tail call i32 @IntDisable(i32 %3)
%5 = tail call i32 @IntUnregister(i32 %3)
ret void
}
/* Variables and functions */
double M_PI;
int /*<<< orphan*/ printf(char *, double, ...);
int main() {
  int a = 12;
  int b = -2;
  printf("max(%d,%d)=%d\n", a, b, a > b ? a : b);
  printf("2*pi = %lf\n", M_PI * 2.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
movl   $0xfffffffe,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1154 <main+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    115a <main+0x4a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%edx
lea    0xe9c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe85(%rip),%xmm0
mov    0x2e66(%rip),%rax
mulsd  (%rax),%xmm0
lea    0xe8a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0xfffffffe,%esi
mov    $0xc,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2eb0(%rip),%rax
movsd  (%rax),%xmm0
addsd  %xmm0,%xmm0
lea    0xed0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"max(%d,%d)=%d\0A\00"
@.str.1 = [12 x i8] c"2*pi = %lf\0A\00"
@M_PI = global double 0.000000e+00
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 12, i32* %2
store i32 -2, i32* %3
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = load i32, i32* %2
br label %14
12: ; preds = %0
%13 = load i32, i32* %3
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
%16 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %5, i32 %6, i32 %15)
%17 = load double, double* @M_PI
%18 = fmul double %17, 2.000000e+00
%19 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"max(%d,%d)=%d\0A\00"
@.str.1 = [12 x i8] c"2*pi = %lf\0A\00"
@M_PI = global double 0.000000e+00
define i32 @main() {
%1 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double 1.200000e+01, i32 -2, i32 12)
%2 = load double, double* @M_PI
%3 = fmul double %2, 2.000000e+00
%4 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %3)
ret i32 0
}
void yyerror(s) char *s;
{
  char buf[50];
  extern int yylineno;
  sprintf(buf, "line %d: %s", yylineno, s);
  fatal(buf);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rcx
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rcx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
lea    0xec8(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fatal@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"line %d: %s\00"
@yylineno = external global i32
define void @yyerror(i8* %0) {
%2 = alloca i8*
%3 = alloca [50 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @yylineno
%6 = load i8*, i8** %2
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"line %d: %s\00"
@yylineno = external global i32
define void @yyerror(i8* %0) {
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @yylineno
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %0)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* %3)
ret void
}
/* Variables and functions */
int maxdig(int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int num, max = 0;
  printf("Enter the number:\n");
  scanf(" %d", &num);
  max = maxdig(&num, &max);
  printf(" %d", max);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <maxdig@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,(%rsp)
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
lea    0xea2(%rip),%r14
lea    0x4(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <maxdig@plt>
mov    %eax,(%rsp)
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter the number:\0A\00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @maxdig(i32* %1, i32* %2)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c" %d\00"
@str = [18 x i8] c"Enter the number:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @maxdig(i32* %1, i32* %2)
store i32 %7, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fn_ptr();
void test_5(void) { fn_ptr(); }


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

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

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

LLVM IR (-O2):
define void @test_5() {
%1 = tail call i32 (...) @fn_ptr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
void print_error(const char *str) { write(STDERR_FILENO, str, strlen(str)); }


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDERR_FILENO = global i32 0
define void @print_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @STDERR_FILENO
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @write(i32 %3, i8* %4, i32 %6)
ret void
}

LLVM IR (-O2):
@STDERR_FILENO = global i32 0
define void @print_error(i8* %0) {
%2 = load i32, i32* @STDERR_FILENO
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 %2, i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HanBingJianFa_bind();
int /*<<< orphan*/ HuoYanJianFa_bind();
int /*<<< orphan*/ LieYanJianFa_bind();
int /*<<< orphan*/ LiuShuiJianFa_bind();
int /*<<< orphan*/ WuWoJianQi_bind();
int /*<<< orphan*/ XuanYinJianQi_bind();
void QZ_Ability_init() {
  HanBingJianFa_bind();
  HuoYanJianFa_bind();
  LieYanJianFa_bind();
  LiuShuiJianFa_bind();
  WuWoJianQi_bind();
  XuanYinJianQi_bind();
}


x86 assembly (clang, -O0):
<QZ_Ability_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <HanBingJianFa_bind@plt>
mov    $0x0,%al
call   1040 <HuoYanJianFa_bind@plt>
mov    $0x0,%al
call   1030 <LieYanJianFa_bind@plt>
mov    $0x0,%al
call   1050 <LiuShuiJianFa_bind@plt>
mov    $0x0,%al
call   1080 <WuWoJianQi_bind@plt>
mov    $0x0,%al
call   1060 <XuanYinJianQi_bind@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<QZ_Ability_init>:
push   %rax
xor    %eax,%eax
call   1070 <HanBingJianFa_bind@plt>
xor    %eax,%eax
call   1040 <HuoYanJianFa_bind@plt>
xor    %eax,%eax
call   1030 <LieYanJianFa_bind@plt>
xor    %eax,%eax
call   1050 <LiuShuiJianFa_bind@plt>
xor    %eax,%eax
call   1080 <WuWoJianQi_bind@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <XuanYinJianQi_bind@plt>

LLVM IR (-O0):
define void @QZ_Ability_init() {
%1 = call i32 (...) @HanBingJianFa_bind()
%2 = call i32 (...) @HuoYanJianFa_bind()
%3 = call i32 (...) @LieYanJianFa_bind()
%4 = call i32 (...) @LiuShuiJianFa_bind()
%5 = call i32 (...) @WuWoJianQi_bind()
%6 = call i32 (...) @XuanYinJianQi_bind()
ret void
}

LLVM IR (-O2):
define void @QZ_Ability_init() {
%1 = tail call i32 (...) @HanBingJianFa_bind()
%2 = tail call i32 (...) @HuoYanJianFa_bind()
%3 = tail call i32 (...) @LieYanJianFa_bind()
%4 = tail call i32 (...) @LiuShuiJianFa_bind()
%5 = tail call i32 (...) @WuWoJianQi_bind()
%6 = tail call i32 (...) @XuanYinJianQi_bind()
ret void
}
void _xm_sw_reset_samples() {}


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

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

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

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

/* Variables and functions */
void set_bit_val(unsigned int *src, int16_t seq) {
  int x;
  x = src[seq / 32];
  x |= 1 << (seq % 32);
  src[seq / 32] = x;
}


x86 assembly (clang, -O0):
<set_bit_val>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit_val>:
mov    %esi,%ecx
lea    0x1f(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x5,%eax
mov    $0x1,%edx
shl    %cl,%edx
cltq
or     %edx,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @set_bit_val(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 32
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 31
%8 = shl nuw i32 1, %7
%9 = or i32 %6, %8
store i32 %9, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void CAN2_RX0_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @CAN2_RX0_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @CAN2_RX0_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int cmpint(const void *ap, const void *bp) {
  return ((int)(intptr_t)(ap)) - ((int)(intptr_t)(bp));
}


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

x86 assembly (clang, -O2):
<cmpint>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @cmpint(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 = ptrtoint i8* %5 to i64
%7 = trunc i64 %6 to i32
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmpint(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void ROM_GetFlash(uint32_t *address, uint32_t *size) {
  void (*p_ROM_GetFlash)(uint32_t * address, uint32_t * size);
  p_ROM_GetFlash = (void (*)(uint32_t * address, uint32_t * size))0x03000e0dU;
  p_ROM_GetFlash(address, size);
}


x86 assembly (clang, -O0):
<ROM_GetFlash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3000e0d,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROM_GetFlash>:
mov    $0x3000e0d,%eax
jmp    *%rax

LLVM IR (-O0):
define void @ROM_GetFlash(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca void (i32*, i32*)*
store i32* %0, i32** %3
store i32* %1, i32** %4
store void (i32*, i32*)* inttoptr (i64 50335245 to void (i32*, i32*)*), void (i32*, i32*)** %5
%6 = load void (i32*, i32*)*, void (i32*, i32*)** %5
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
ret void
}

LLVM IR (-O2):
define void @ROM_GetFlash(i32* %0, i32* %1) {
tail call void inttoptr (i64 50335245 to void (i32*, i32*)*)(i32* %0, i32* %1)
ret void
}
void foo_1_1_1_1_1_1_1_2_2() {}


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

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

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

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