xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ foo(int /*<<< orphan*/);
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  foo(0);
  return EXIT_SUCCESS;
}


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)
xor    %edi,%edi
call   1030 <foo@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <foo@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @foo(i32 0)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 0)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
scalar_t__ INT_MIN;
unsigned int test12u(unsigned int x) {
  unsigned int y = 0x1234;
  unsigned int z = (unsigned int)INT_MIN;
  return (x ^ y) - z;
}


x86 assembly (clang, -O0):
<test12u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1234,-0x8(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test12u>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
xor    $0x1234,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
define i32 @test12u(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 4660, i32* %3
%5 = load i64, i64* @INT_MIN
%6 = trunc i64 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = xor i32 %7, %8
%10 = load i32, i32* %4
%11 = sub i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
@INT_MIN = global i64 0
define i32 @test12u(i32 %0) {
%2 = load i64, i64* @INT_MIN
%3 = trunc i64 %2 to i32
%4 = xor i32 %0, 4660
%5 = sub i32 %4, %3
ret i32 %5
}
int isspace(int c) {
  if (c <= ' ')
    return 1;
  if (c == '\n')
    return 1;
  if (c == '\t')
    return 1;
  if (c == ':')
    return 1;
  if (c == ';')
    return 1;
  if (c == ',')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jg     111d <isspace+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1192 <isspace+0x92>
cmpl   $0xa,-0x8(%rbp)
jne    1133 <isspace+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1192 <isspace+0x92>
cmpl   $0x9,-0x8(%rbp)
jne    1149 <isspace+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1192 <isspace+0x92>
cmpl   $0x3a,-0x8(%rbp)
jne    115f <isspace+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    1192 <isspace+0x92>
cmpl   $0x3b,-0x8(%rbp)
jne    1175 <isspace+0x75>
movl   $0x1,-0x4(%rbp)
jmp    1192 <isspace+0x92>
cmpl   $0x2c,-0x8(%rbp)
jne    118b <isspace+0x8b>
movl   $0x1,-0x4(%rbp)
jmp    1192 <isspace+0x92>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
cmp    $0x21,%edi
jl     1121 <isspace+0x21>
cmp    $0x3b,%edi
ja     1122 <isspace+0x22>
mov    %edi,%ecx
movabs $0xc00100000000000,%rdx
bt     %rcx,%rdx
jae    1122 <isspace+0x22>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 32
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %28
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %2
br label %28
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 9
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 1, i32* %2
br label %28
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 58
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 1, i32* %2
br label %28
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 59
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 1, i32* %2
br label %28
23: ; preds = %19
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 44
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 1, i32* %2
br label %28
27: ; preds = %23
store i32 0, i32* %2
br label %28
28: ; preds = %27, %26, %22, %18, %14, %10, %6
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp slt i32 %0, 33
br i1 %2, label %5, label %3
3: ; preds = %1
switch i32 %0, label %4 [
i32 58, label %5
i32 59, label %5
i32 44, label %5
]
4: ; preds = %3
br label %5
5: ; preds = %3, %3, %3, %1, %4
%6 = phi i32 [ 0, %4 ], [ 1, %1 ], [ 1, %3 ], [ 1, %3 ], [ 1, %3 ]
ret i32 %6
}
/* Type definitions */
struct wf_mtllib {
  int dummy;
};

/* Variables and functions */
struct wf_mtllib *wf_parse_mtllib(void const *);
int load_wf_mtllib(void const *filename, size_t len, void *data, void *link) {
  struct wf_mtllib const **p;
  (void)link;
  (void)len;
  p = data;
  *p = wf_parse_mtllib(filename);
  return *p ? 0 : -1;
}


x86 assembly (clang, -O0):
<load_wf_mtllib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wf_parse_mtllib@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_wf_mtllib>:
push   %rbx
mov    %rdx,%rbx
call   1030 <wf_parse_mtllib@plt>
mov    %rax,(%rbx)
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.wf_mtllib = type { i32 }
define i32 @load_wf_mtllib(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.wf_mtllib**
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %8
%11 = load i64, i64* %6
%12 = load i8*, i8** %7
%13 = bitcast i8* %12 to %struct.wf_mtllib**
store %struct.wf_mtllib** %13, %struct.wf_mtllib*** %9
%14 = load i8*, i8** %5
%15 = call %struct.wf_mtllib* @wf_parse_mtllib(i8* %14)
%16 = load %struct.wf_mtllib**, %struct.wf_mtllib*** %9
store %struct.wf_mtllib* %15, %struct.wf_mtllib** %16
%17 = load %struct.wf_mtllib**, %struct.wf_mtllib*** %9
%18 = load %struct.wf_mtllib*, %struct.wf_mtllib** %17
%19 = icmp ne %struct.wf_mtllib* %18, null
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 0, i32 -1
ret i32 %21
}

LLVM IR (-O2):
%struct.wf_mtllib = type { i32 }
define i32 @load_wf_mtllib(i8* %0, i64 %1, i8* nocapture writeonly %2, i8* nocapture readnone %3) {
%5 = bitcast i8* %2 to %struct.wf_mtllib**
%6 = tail call %struct.wf_mtllib* @wf_parse_mtllib(i8* %0)
store %struct.wf_mtllib* %6, %struct.wf_mtllib** %5
%7 = icmp eq %struct.wf_mtllib* %6, null
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t load_bigendian(const unsigned char *x) {
  return (uint32_t)(x[3]) | (((uint32_t)(x[2])) << 8) |
         (((uint32_t)(x[1])) << 16) | (((uint32_t)(x[0])) << 24);
}


x86 assembly (clang, -O0):
<load_bigendian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_bigendian>:
mov    (%rdi),%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @load_bigendian(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = load i8, i8* %0
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %14, %17
ret i32 %18
}
/* Type definitions */
struct ftpsub_buf {
  int dummy;
};

/* Variables and functions */
int RecvMessage_(struct ftpsub_buf *, int);
int SendMessage_(struct ftpsub_buf *, int);
int CmdRUN(struct ftpsub_buf *fbf, int sockfd) {
  if (SendMessage_(fbf, sockfd) == -1) {
    return (-1);
  }
  if (RecvMessage_(fbf, sockfd) == -1) {
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<CmdRUN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <SendMessage_@plt>
cmp    $0xffffffff,%eax
jne    1150 <CmdRUN+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <CmdRUN+0x58>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <RecvMessage_@plt>
cmp    $0xffffffff,%eax
jne    1171 <CmdRUN+0x51>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <CmdRUN+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdRUN>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <SendMessage_@plt>
cmp    $0xffffffff,%eax
je     114a <CmdRUN+0x2a>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <RecvMessage_@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
jmp    114f <CmdRUN+0x2f>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.ftpsub_buf = type { i32 }
define i32 @CmdRUN(%struct.ftpsub_buf* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.ftpsub_buf*
%5 = alloca i32
store %struct.ftpsub_buf* %0, %struct.ftpsub_buf** %4
store i32 %1, i32* %5
%6 = load %struct.ftpsub_buf*, %struct.ftpsub_buf** %4
%7 = load i32, i32* %5
%8 = call i32 @SendMessage_(%struct.ftpsub_buf* %6, i32 %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %18
11: ; preds = %2
%12 = load %struct.ftpsub_buf*, %struct.ftpsub_buf** %4
%13 = load i32, i32* %5
%14 = call i32 @RecvMessage_(%struct.ftpsub_buf* %12, i32 %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 -1, i32* %3
br label %18
17: ; preds = %11
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.ftpsub_buf = type { i32 }
define i32 @CmdRUN(%struct.ftpsub_buf* %0, i32 %1) {
%3 = tail call i32 @SendMessage_(%struct.ftpsub_buf* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @RecvMessage_(%struct.ftpsub_buf* %0, i32 %1)
%7 = icmp eq i32 %6, -1
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %10
}
void ListTests(void) {}


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

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

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

LLVM IR (-O2):
define void @ListTests() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRSETBKMODE_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 1, torev);
}


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

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

LLVM IR (-O0):
define void @U_WMRSETBKMODE_swap(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 i32 @U_WMRCORE_N16_swap(i8* %5, i32 1, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRSETBKMODE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 1, i32 %1)
ret void
}
int f02(f02a01, f02a02)
int f02a01;
int f02a02;
{ return f02a01 + f02a02; }


x86 assembly (clang, -O0):
<f02>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f02>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @f02(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f02(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t strcspn(char *, char *);
int main(int argc, char **argv) {
  size_t r;
  char s2[] = "ab";
  char s1[] = {'c', 'a'};
  char s3 = 0;
  r = strcspn(s1, s2);
  assert(r == 1);
  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)
mov    0xec3(%rip),%ax
mov    %ax,-0x1b(%rbp)
mov    0xebb(%rip),%al
mov    %al,-0x19(%rbp)
mov    0xeb2(%rip),%ax
mov    %ax,-0x1d(%rbp)
movb   $0x0,-0x1e(%rbp)
lea    -0x1d(%rbp),%rdi
lea    -0x1b(%rbp),%rsi
call   1030 <strcspn@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s2 = [3 x i8] c"ab\00"
@__const.main.s1 = [2 x i8] c"ca"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca [3 x i8]
%8 = alloca [2 x i8]
%9 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [3 x i8]* %7 to i8*
%11 = bitcast [2 x i8]* %8 to i8*
store i8 0, i8* %9
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%14 = call i64 @strcspn(i8* %12, i8* %13)
store i64 %14, i64* %6
%15 = load i64, i64* %6
%16 = icmp eq i64 %15, 1
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @assert(i32 1)
ret i32 0
}
void free_downtime_data(void) {}


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

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

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

LLVM IR (-O2):
define void @free_downtime_data() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime_r(int /*<<< orphan*/ *, struct tm *);
int test(void) {
  time_t time;
  struct tm *timestruct_pointer;
  struct tm timestruct;
  timestruct_pointer = gmtime_r(&time, &timestruct);
  return (timestruct_pointer != NULL);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gmtime_r@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca %struct.tm
%4 = call %struct.tm* @gmtime_r(i32* %1, %struct.tm* %3)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = icmp ne %struct.tm* %5, null
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = bitcast i32* %1 to i8*
%4 = bitcast %struct.tm* %2 to i8*
%5 = call %struct.tm* @gmtime_r(i32* %1, %struct.tm* %2)
%6 = icmp ne %struct.tm* %5, null
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
void response_header(int client, const char *filename) {
  char buf[1024];
  (void)filename;
  ssize_t n;
  strcpy(buf, "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nContent-Length: "
              "125\r\n\r\n");
  send(client, buf, strlen(buf), 0);
}


x86 assembly (clang, -O0):
<response_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x424(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x420(%rbp)
lea    -0x410(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x424(%rbp),%edi
mov    -0x420(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<response_header>:
push   %rbp
push   %rbx
sub    $0x408,%rsp
mov    %edi,%ebp
lea    0xebe(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
add    $0x408,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [66 x i8] c"HTTP/1.0 200 OK\0D\0AContent-Type: text/html\0D\0AContent-Length: 125\0D\0A\0D\0A\00"
define void @response_header(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [1024 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %3
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @send(i32 %10, i8* %11, i32 %13, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"HTTP/1.0 200 OK\0D\0AContent-Type: text/html\0D\0AContent-Length: 125\0D\0A\0D\0A\00"
define void @response_header(i32 %0, i8* nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @strlen(i8* %4)
%7 = call i32 @send(i32 %0, i8* %4, i32 %6, i32 0)
ret void
}
int test_any_even_one(unsigned x) {
  int mask = 1 << 0;
  while (mask) {
    if (x & mask)
      return 1;
    mask <<= 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_any_even_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1141 <test_any_even_one+0x41>
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1133 <test_any_even_one+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1148 <test_any_even_one+0x48>
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <test_any_even_one+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_any_even_one>:
xor    %eax,%eax
test   $0x55555555,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @test_any_even_one(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = and i32 %9, %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 1, i32* %2
br label %18
14: ; preds = %8
%15 = load i32, i32* %4
%16 = shl i32 %15, 2
store i32 %16, i32* %4
br label %5
17: ; preds = %5
store i32 0, i32* %2
br label %18
18: ; preds = %17, %13
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @test_any_even_one(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int sas_parse_current(char *Temperature) {
  if ((Temperature[4] == 0) && (Temperature[5] == 0))
    return Temperature[9];
  else
    return 0;
}


x86 assembly (clang, -O0):
<sas_parse_current>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x0,%eax
jne    113a <sas_parse_current+0x3a>
mov    -0x10(%rbp),%rax
movsbl 0x5(%rax),%eax
cmp    $0x0,%eax
jne    113a <sas_parse_current+0x3a>
mov    -0x10(%rbp),%rax
movsbl 0x9(%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <sas_parse_current+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sas_parse_current>:
xor    %eax,%eax
cmpb   $0x0,0x4(%rdi)
je     1109 <sas_parse_current+0x9>
ret
cmpb   $0x0,0x5(%rdi)
jne    1108 <sas_parse_current+0x8>
movsbl 0x9(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @sas_parse_current(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %0, i64 9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
br label %13
13: ; preds = %1, %5, %9
%14 = phi i32 [ %12, %9 ], [ 0, %5 ], [ 0, %1 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int /*<<< orphan*/ f2(int, int);
int /*<<< orphan*/ f3(int, int, int);
int main() {
  f1(1);
  f2(1, 2);
  f3(1, 2, 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <f1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f2@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <f3@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1050 <f1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f2@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <f3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f1(i32 1)
%2 = call i32 @f2(i32 1, i32 2)
%3 = call i32 @f3(i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 1)
%2 = tail call i32 @f2(i32 1, i32 2)
%3 = tail call i32 @f3(i32 1, i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
int binarySearchHelp(int *, int, int /*<<< orphan*/, int);
int binarySearch(int *arr, int key, int len) {
  return binarySearchHelp(arr, key, 0, len - 1);
}


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

x86 assembly (clang, -O2):
<binarySearch>:
lea    -0x1(%rdx),%ecx
xor    %edx,%edx
jmp    1030 <binarySearchHelp@plt>

LLVM IR (-O0):
define i32 @binarySearch(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = sub nsw i32 %9, 1
%11 = call i32 @binarySearchHelp(i32* %7, i32 %8, i32 0, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @binarySearch(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i32 @binarySearchHelp(i32* %0, i32 %1, i32 0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void Test(void) {
  char *str = (char *)malloc(100);
  strcpy(str, "hello");
  free(str);
  if (NULL != str) {
    strcpy(str, "world");
    printf(str);
  }
}


x86 assembly (clang, -O0):
<Test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1194 <Test+0x54>
mov    -0x8(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test>:
push   %rbx
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
test   %rbx,%rbx
je     1182 <Test+0x42>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
define void @Test() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
%8 = load i8*, i8** %1
%9 = icmp ne i8* null, %8
br i1 %9, label %10, label %15
10: ; preds = %0
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = load i8*, i8** %1
%14 = call i32 @printf(i8* %13)
br label %15
15: ; preds = %10, %0
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
define void @Test() {
%1 = tail call i64 @malloc(i32 100)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @free(i8* %2)
%5 = icmp eq i64 %1, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @printf(i8* %2)
br label %9
9: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(char str[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%c", str[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <printArray+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <printArray+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printArray+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printArray(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printArray(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int call_me();
int bar(void) { return call_me(); }


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

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

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

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @call_me()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ __NR_write;
long x86_syscall3(int /*<<< orphan*/, int, long, long);
long linux_write(int fd, const void *data, size_t len) {
  return x86_syscall3(__NR_write, fd, (long)data, (long)len);
}


x86 assembly (clang, -O0):
<linux_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <x86_syscall3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linux_write>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <x86_syscall3@plt>

LLVM IR (-O0):
@__NR_write = global i32 0
define i64 @linux_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @__NR_write
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = load i64, i64* %6
%12 = call i64 @x86_syscall3(i32 %7, i32 %8, i64 %10, i64 %11)
ret i64 %12
}

LLVM IR (-O2):
@__NR_write = global i32 0
define i64 @linux_write(i32 %0, i8* %1, i64 %2) {
%4 = load i32, i32* @__NR_write
%5 = ptrtoint i8* %1 to i64
%6 = tail call i64 @x86_syscall3(i32 %4, i32 %0, i64 %5, i64 %2)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *vfs_usage();
void vfs_showusage() { printf("usage : vfs %s", vfs_usage()); }


x86 assembly (clang, -O0):
<vfs_showusage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <vfs_usage@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfs_showusage>:
push   %rax
xor    %eax,%eax
call   1040 <vfs_usage@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"usage : vfs %s\00"
define void @vfs_showusage() {
%1 = call i8* (...) @vfs_usage()
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"usage : vfs %s\00"
define void @vfs_showusage() {
%1 = tail call i8* (...) @vfs_usage()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void func6(void) {}


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

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

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

LLVM IR (-O2):
define void @func6() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void halt(char *msg) {
  puts(msg);
  puts(", machine halted.\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<halt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
jmp    1131 <halt+0x21>

x86 assembly (clang, -O2):
<halt>:
push   %rax
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1130 <halt+0x20>

LLVM IR (-O0):
@.str = [19 x i8] c", machine halted.\0A\00"
define void @halt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %6
br label %6
}

LLVM IR (-O2):
@.str = [19 x i8] c", machine halted.\0A\00"
define void @halt(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
br label %4
}
void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.rt2x00_dev = type opaque
define void @rt2x00lib_free_eeprom_file(%struct.rt2x00_dev* nocapture %0) {
ret void
}
void reload_config(int sugnum) {}


x86 assembly (clang, -O0):
<reload_config>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @reload_config(i32 %0) {
ret void
}
void tv8532_setcontrast(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @tv8532_setcontrast(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo();
int main() {
  if (foo() != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x1,%eax
je     1146 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x1,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
int do_234() { return 234; }


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

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

LLVM IR (-O0):
define i32 @do_234() {
ret i32 234
}

LLVM IR (-O2):
define i32 @do_234() {
ret i32 234
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int n_bits;

/* Variables and functions */
int /*<<< orphan*/ *calloc(int, size_t);
uint32_t *bitmap_new(size_t n_bits) {
  size_t blocks;
  if (!n_bits)
    return NULL;
  blocks = (((n_bits) + 31) >> 5);
  return calloc(1, blocks * sizeof(uint32_t));
}


x86 assembly (clang, -O0):
<bitmap_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <bitmap_new+0x24>
movq   $0x0,-0x8(%rbp)
jmp    115a <bitmap_new+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1f,%rax
shr    $0x5,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
shl    $0x2,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_new>:
test   %rdi,%rdi
je     112e <bitmap_new+0x1e>
mov    %rdi,%rsi
add    $0x1f,%rsi
shr    $0x3,%rsi
and    $0xfffffffffffffffc,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32* @bitmap_new(i64 %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32* null, i32** %2
br label %15
8: ; preds = %1
%9 = load i64, i64* %3
%10 = add i64 %9, 31
%11 = lshr i64 %10, 5
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = mul i64 %12, 4
%14 = call i32* @calloc(i32 1, i64 %13)
store i32* %14, i32** %2
br label %15
15: ; preds = %8, %7
%16 = load i32*, i32** %2
ret i32* %16
}

LLVM IR (-O2):
define i32* @bitmap_new(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = add i64 %0, 31
%5 = lshr i64 %4, 3
%6 = and i64 %5, 2305843009213693948
%7 = tail call i32* @calloc(i32 1, i64 %6)
br label %8
8: ; preds = %1, %3
%9 = phi i32* [ %7, %3 ], [ null, %1 ]
ret i32* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void __attribute__((noreturn)) loopForever(int x) {
  for (;;) {
    printf("x: %d\n", x);
  }
}


x86 assembly (clang, -O0):
<loopForever>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <loopForever+0xb>

x86 assembly (clang, -O2):
<loopForever>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1120 <loopForever+0x10>

LLVM IR (-O0):
@.str = [7 x i8] c"x: %d\0A\00"
define void @loopForever(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %3
}

LLVM IR (-O2):
@.str = [7 x i8] c"x: %d\0A\00"
define void @loopForever(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %2
}
unsigned int cidr_from_netmask(const unsigned int mask) {
  int tmp = 0;
  while (!(mask & (1 << tmp)) && (tmp < 32))
    ++tmp;
  return (32 - tmp);
}


x86 assembly (clang, -O0):
<cidr_from_netmask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x10(%rbp),%ecx
and    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    113b <cidr_from_netmask+0x3b>
cmpl   $0x20,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    114b <cidr_from_netmask+0x4b>
jmp    1159 <cidr_from_netmask+0x59>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <cidr_from_netmask+0xe>
mov    $0x20,%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cidr_from_netmask>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rax),%ecx
bt     %eax,%edi
jb     111f <cidr_from_netmask+0x1f>
cmp    $0x20,%eax
mov    %ecx,%eax
jb     1110 <cidr_from_netmask+0x10>
mov    $0x21,%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cidr_from_netmask(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %9, %2 ]
%4 = shl nuw i32 1, %3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = icmp ult i32 %3, 32
%8 = select i1 %6, i1 %7, i1 false
%9 = add nuw nsw i32 %3, 1
br i1 %8, label %2, label %10
10: ; preds = %2
%11 = sub nuw nsw i32 32, %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ tcp_yeah_unregister();
void module_unregister_fake(void) {
  if (0)
    tcp_yeah_unregister();
}


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

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

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

LLVM IR (-O2):
define void @module_unregister_fake() {
ret void
}
float readjustment(float currentValue) {
  currentValue += currentValue * 0.0133;
  currentValue -= 0.51;
  return currentValue;
}


x86 assembly (clang, -O0):
<readjustment>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xee5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebb(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<readjustment>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xee1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @readjustment(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = call double @llvm.fmuladd.f64(double %4, double 1.330000e-02, double %6)
%8 = fptrunc double %7 to float
store float %8, float* %2
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = fsub double %10, 5.100000e-01
%12 = fptrunc double %11 to float
store float %12, float* %2
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @readjustment(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.330000e-02, double %2)
%4 = fptrunc double %3 to float
%5 = fpext float %4 to double
%6 = fadd double %5, -5.100000e-01
%7 = fptrunc double %6 to float
ret float %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void sprint_orl_data(char *str, uint8_t data) {
  sprintf(str,
          "ORL   A, #"
          "0x%02X"
          "                  ",
          data);
}


x86 assembly (clang, -O0):
<sprint_orl_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_orl_data>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"ORL A,x%02X \00"
define void @sprint_orl_data(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 i32 @sprintf(i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"ORL A,x%02X \00"
define void @sprint_orl_data(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int u_int;

/* Variables and functions */
#define ETHERTYPE_IP 129
#define ETHERTYPE_IPV6 128
int disp_ipv4();
int disp_ipv6();
int /*<<< orphan*/ putchar(char);
int layer3(u_int type) {
  switch (type) {
  case ETHERTYPE_IP:
    return disp_ipv4();
  case ETHERTYPE_IPV6:
    return disp_ipv6();
  default:
    putchar('\n');
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<layer3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x80,%eax
je     1173 <layer3+0x43>
jmp    1151 <layer3+0x21>
mov    -0xc(%rbp),%eax
sub    $0x81,%eax
jne    1182 <layer3+0x52>
jmp    1164 <layer3+0x34>
mov    $0x0,%al
call   1050 <disp_ipv4@plt>
mov    %eax,-0x4(%rbp)
jmp    1193 <layer3+0x63>
mov    $0x0,%al
call   1040 <disp_ipv6@plt>
mov    %eax,-0x4(%rbp)
jmp    1193 <layer3+0x63>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<layer3>:
cmp    $0x80,%edi
je     1147 <layer3+0x17>
cmp    $0x81,%edi
jne    114e <layer3+0x1e>
xor    %eax,%eax
jmp    1050 <disp_ipv4@plt>
xor    %eax,%eax
jmp    1040 <disp_ipv6@plt>
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @layer3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 129, label %5
i32 128, label %7
]
5: ; preds = %1
%6 = call i32 (...) @disp_ipv4()
store i32 %6, i32* %2
br label %12
7: ; preds = %1
%8 = call i32 (...) @disp_ipv6()
store i32 %8, i32* %2
br label %12
9: ; preds = %1
%10 = call i32 @putchar(i8 signext 10)
br label %11
11: ; preds = %9
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %7, %5
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @layer3(i32 %0) {
switch i32 %0, label %6 [
i32 129, label %2
i32 128, label %4
]
2: ; preds = %1
%3 = tail call i32 (...) @disp_ipv4()
br label %8
4: ; preds = %1
%5 = tail call i32 (...) @disp_ipv6()
br label %8
6: ; preds = %1
%7 = tail call i32 @putchar(i8 signext 10)
br label %8
8: ; preds = %6, %4, %2
%9 = phi i32 [ -1, %6 ], [ %5, %4 ], [ %3, %2 ]
ret i32 %9
}