xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ sbser_receive(void *, unsigned char *, int);
int sbser_flush(void *_data) {
  unsigned char dump = 0xAE;
  while (sbser_receive(_data, &dump, 1) > 0) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<sbser_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0xae,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <sbser_receive@plt>
cmp    $0x0,%rax
jle    1141 <sbser_flush+0x31>
jmp    1120 <sbser_flush+0x10>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbser_flush>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movb   $0xae,0x7(%rsp)
lea    0x7(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <sbser_receive@plt>
test   %rax,%rax
jg     1130 <sbser_flush+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @sbser_flush(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 -82, i8* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = call i64 @sbser_receive(i8* %5, i8* %3, i32 1)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @sbser_flush(i8* %0) {
%2 = alloca i8
store i8 -82, i8* %2
br label %3
3: ; preds = %3, %1
%4 = call i64 @sbser_receive(i8* %0, i8* %2, i32 1)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void FprintTabs(FILE *f, unsigned int layer) {
  unsigned int i;
  for (i = 0; i < layer; ++i)
    fprintf(f, "\t");
  return;
}


x86 assembly (clang, -O0):
<FprintTabs>:
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
jae    1150 <FprintTabs+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <FprintTabs+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FprintTabs>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     1132 <FprintTabs+0x22>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    $0x9,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
jne    1120 <FprintTabs+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
define void @FprintTabs(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @FprintTabs(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @fputc(i32 9, i32* %0)
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
void *_memory_reallocate(void *, size_t, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void *rprealloc(void *ptr, size_t size) {
  return _memory_reallocate(ptr, size, 0, 0);
}


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

x86 assembly (clang, -O2):
<rprealloc>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <_memory_reallocate@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ printf(char *, char const *);
FILE *safe_fopen(const char *file_name, const char *mode) {
  FILE *stream = fopen(file_name, mode);
  if (stream == NULL) {
    printf("ERROR: loading file at %s\n", file_name);
    exit(1);
  }
  return stream;
}


x86 assembly (clang, -O0):
<safe_fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <safe_fopen+0x46>
mov    -0x8(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_fopen>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <safe_fopen+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"ERROR: loading file at %s\0A\00"
define i32* @safe_fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@.str = [27 x i8] c"ERROR: loading file at %s\0A\00"
define noalias i32* @safe_fopen(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32* %3
}
unsigned long long max_memory() { return 640; }


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

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

LLVM IR (-O0):
define i64 @max_memory() {
ret i64 640
}

LLVM IR (-O2):
define i64 @max_memory() {
ret i64 640
}
int __def_heap_data_copy(void *_dst, const void *_src) {
  _dst = (void *)_src;
  return 1;
}


x86 assembly (clang, -O0):
<__def_heap_data_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__def_heap_data_copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
store i8* %5, i8** %3
ret i32 1
}

LLVM IR (-O2):
define i32 @__def_heap_data_copy(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
/* Type definitions */
struct reset_control {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
int reset_control_deassert(struct reset_control *rstc) {
  WARN_ON(1);
  return 0;
}


x86 assembly (clang, -O0):
<reset_control_deassert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <WARN_ON@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.reset_control = type { i32 }
define i32 @reset_control_deassert(%struct.reset_control* %0) {
%2 = alloca %struct.reset_control*
store %struct.reset_control* %0, %struct.reset_control** %2
%3 = call i32 @WARN_ON(i32 1)
ret i32 0
}

LLVM IR (-O2):
%struct.reset_control = type { i32 }
define i32 @reset_control_deassert(%struct.reset_control* nocapture readnone %0) {
%2 = tail call i32 @WARN_ON(i32 1)
ret i32 0
}
void lgtd_lifx_gateway_handle_ip_state(
    struct lgtd_lifx_gateway *gw, const struct lgtd_lifx_packet_header *hdr,
    const struct lgtd_lifx_packet_ip_state *pkt) {
  (void)gw;
  (void)hdr;
  (void)pkt;
}


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

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

LLVM IR (-O0):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
%struct.lgtd_lifx_packet_ip_state = type opaque
define void @lgtd_lifx_gateway_handle_ip_state(%struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_packet_header* %1, %struct.lgtd_lifx_packet_ip_state* %2) {
%4 = alloca %struct.lgtd_lifx_gateway*
%5 = alloca %struct.lgtd_lifx_packet_header*
%6 = alloca %struct.lgtd_lifx_packet_ip_state*
store %struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_gateway** %4
store %struct.lgtd_lifx_packet_header* %1, %struct.lgtd_lifx_packet_header** %5
store %struct.lgtd_lifx_packet_ip_state* %2, %struct.lgtd_lifx_packet_ip_state** %6
%7 = load %struct.lgtd_lifx_gateway*, %struct.lgtd_lifx_gateway** %4
%8 = load %struct.lgtd_lifx_packet_header*, %struct.lgtd_lifx_packet_header** %5
%9 = load %struct.lgtd_lifx_packet_ip_state*, %struct.lgtd_lifx_packet_ip_state** %6
ret void
}

LLVM IR (-O2):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
%struct.lgtd_lifx_packet_ip_state = type opaque
define void @lgtd_lifx_gateway_handle_ip_state(%struct.lgtd_lifx_gateway* nocapture %0, %struct.lgtd_lifx_packet_header* nocapture %1, %struct.lgtd_lifx_packet_ip_state* nocapture %2) {
ret void
}
int f(int x) {
  if (x > 100) {
    return x;
  } else {
    x = x + 1;
    return f(x);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jle    1130 <f+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <f+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x66,%edi
mov    $0x65,%eax
cmovge %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 101)
ret i32 %2
}
/* Variables and functions */
char *mmalloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *notImplemented(void) {
  char *output = mmalloc(17);
  strcpy(output, "not implemented\n");
  return output;
}


x86 assembly (clang, -O0):
<notImplemented>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x11,%edi
call   1040 <mmalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notImplemented>:
push   %rbx
mov    $0x11,%edi
call   1040 <mmalloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"not implemented\0A\00"
define i8* @notImplemented() {
%1 = alloca i8*
%2 = call i8* @mmalloc(i32 17)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
@.str = [17 x i8] c"not implemented\0A\00"
define i8* @notImplemented() {
%1 = tail call i8* @mmalloc(i32 17)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void print_item(const struct item *item) {}


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

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

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

LLVM IR (-O2):
%struct.item = type opaque
define void @print_item(%struct.item* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
extern void mocks_verboseAssertStringEquals(char *expected, char *actual) {
  if (strcmp(expected, actual)) {
    fprintf(stderr, "\n*** MOCKS: expected [%s] got [%s]!!! ***\n", expected,
            actual);
  }
}


x86 assembly (clang, -O0):
<mocks_verboseAssertStringEquals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1164 <mocks_verboseAssertStringEquals+0x44>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mocks_verboseAssertStringEquals>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strcmp@plt>
test   %rax,%rax
je     1156 <mocks_verboseAssertStringEquals+0x36>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"\0A*** MOCKS: expected [%s] got [%s]!!! ***\0A\00"
define void @mocks_verboseAssertStringEquals(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
br label %14
14: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"\0A*** MOCKS: expected [%s] got [%s]!!! ***\0A\00"
define void @mocks_verboseAssertStringEquals(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %8
8: ; preds = %5, %2
ret void
}
int idig(char c) { return (c >= '0') && (c <= '9'); }


x86 assembly (clang, -O0):
<idig>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <idig+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idig>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @idig(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @idig(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fnQueens(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int iNo;
  printf("Enter the no of Queenes : ");
  scanf("%d", &iNo);
  fnQueens(1, iNo);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <fnQueens@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
mov    $0x1,%edi
call   1030 <fnQueens@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter the no of Queenes : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fnQueens(i32 1, i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter the no of Queenes : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 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), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fnQueens(i32 1, i32 %5)
ret i32 0
}
void glLightxv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glLightxv() {
ret void
}
void vzero(float *v) {
  {
    *(v + 0) = (float)0.0;
    *(v + 1) = (float)0.0;
    *(v + 2) = (float)0.0;
    return;
  }
}


x86 assembly (clang, -O0):
<vzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vzero>:
movq   $0x0,(%rdi)
movl   $0x0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vzero(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
ret void
}

LLVM IR (-O2):
define void @vzero(float* nocapture writeonly %0) {
store float 0.000000e+00, float* %0
%2 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %2
%3 = getelementptr inbounds float, float* %0, i64 2
store float 0.000000e+00, float* %3
ret void
}
/* Variables and functions */
int TCP_ListenTo(int /*<<< orphan*/ *, char const *);
int TCP_Listen(const char *port) { return TCP_ListenTo(NULL, port); }


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

x86 assembly (clang, -O2):
<TCP_Listen>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <TCP_ListenTo@plt>

LLVM IR (-O0):
define i32 @TCP_Listen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @TCP_ListenTo(i32* null, i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @TCP_Listen(i8* %0) {
%2 = tail call i32 @TCP_ListenTo(i32* null, i8* %0)
ret i32 %2
}
int duplicate_suppression_of_size() {}


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

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

LLVM IR (-O0):
define i32 @duplicate_suppression_of_size() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @duplicate_suppression_of_size() {
ret i32 undef
}
int tmax(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @tmax() {
ret i32 2
}

LLVM IR (-O2):
define i32 @tmax() {
ret i32 2
}
int do_570() { return 570; }


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

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

LLVM IR (-O0):
define i32 @do_570() {
ret i32 570
}

LLVM IR (-O2):
define i32 @do_570() {
ret i32 570
}
int test_imm_1Fint8_reg(signed char val) {
  return ((val) & (0x1F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Fint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x1f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Fint8_reg>:
test   $0x1f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Fint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 31
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_1Fint8_reg(i8 signext %0) {
%2 = and i8 %0, 31
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void snormzero(unsigned a[1]) {
  if (a[0] == 0x80000000)
    a[0] = 0;
}


x86 assembly (clang, -O0):
<snormzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x80000000,(%rax)
jne    1122 <snormzero+0x22>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<snormzero>:
cmpl   $0x80000000,(%rdi)
jne    110e <snormzero+0xe>
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @snormzero(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, -2147483648
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 0, i32* %9
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @snormzero(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, -2147483648
br i1 %3, label %4, label %5
4: ; preds = %1
store i32 0, i32* %0
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
unsigned int UARTRegConfigModeEnable(unsigned int, int);
unsigned int UARTAutobaudParityGet(unsigned int baseAdd) {
  unsigned int lcrRegValue = 0;
  unsigned int retVal = 0;
  lcrRegValue = UARTRegConfigModeEnable(baseAdd, (0x0080));
  retVal = ((*((volatile unsigned int *)(baseAdd + (0x38)))) & (0x000000C0u));
  (*((volatile unsigned int *)(baseAdd + (0xC)))) = lcrRegValue;
  return retVal;
}


x86 assembly (clang, -O0):
<UARTAutobaudParityGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x80,%esi
call   1030 <UARTRegConfigModeEnable@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x38,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0xc0,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTAutobaudParityGet>:
push   %rbx
mov    %edi,%ebx
mov    $0x80,%esi
call   1030 <UARTRegConfigModeEnable@plt>
lea    0x38(%rbx),%edx
mov    $0xc0,%ecx
and    (%rdx),%ecx
add    $0xc,%ebx
mov    %eax,(%rbx)
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @UARTAutobaudParityGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = call i32 @UARTRegConfigModeEnable(i32 %5, i32 128)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = add i32 %7, 56
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 192
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = add i32 %14, 12
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store volatile i32 %13, i32* %17
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @UARTAutobaudParityGet(i32 %0) {
%2 = tail call i32 @UARTRegConfigModeEnable(i32 %0, i32 128)
%3 = add i32 %0, 56
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 192
%8 = add i32 %0, 12
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %2, i32* %10
ret i32 %7
}
char *glob_lbl(lbl)
char *lbl;
{
  char *gl, *Malloc();
  gl = Malloc(strlen(lbl) + 3);
  sprintf(gl, "\"%s\"", lbl);
  return (gl);
}


x86 assembly (clang, -O0):
<glob_lbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x3,%rdi
mov    $0x0,%al
call   1030 <Malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9a(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glob_lbl>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x3(%rax),%rdi
xor    %eax,%eax
call   1030 <Malloc@plt>
mov    %rax,%rbx
lea    0xeaf(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\22%s\22\00"
define i8* @glob_lbl(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 3
%7 = call i8* (i64, ...) bitcast (i8* (...)* @Malloc to i8* (i64, ...)*)(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"\22%s\22\00"
define i8* @glob_lbl(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 3
%4 = tail call i8* (i64, ...) bitcast (i8* (...)* @Malloc to i8* (i64, ...)*)(i64 %3)
%5 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int putchar(int c) {
  while (!((*(volatile uint8_t *)0x5240) & (1 << 7)))
    ;
  (*(volatile uint8_t *)0x5241) = c;
  return c;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x5240,%eax
mov    (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <putchar+0x28>
jmp    112d <putchar+0x2d>
jmp    1107 <putchar+0x7>
mov    -0x4(%rbp),%ecx
mov    $0x5241,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
testl  $0x80,0x5240
je     1110 <putchar+0x10>
mov    %eax,0x5241
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i32, i32* inttoptr (i64 21056 to i32*)
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
store volatile i32 %10, i32* inttoptr (i64 21057 to i32*)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @putchar(i32 returned %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 21056 to i32*)
%4 = and i32 %3, 128
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i32 %0, i32* inttoptr (i64 21057 to i32*)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  struct date {
    int month;
    int day;
    int year;
  };
  struct date today, *datePtr;
  datePtr = &today;
  datePtr->month = 10;
  datePtr->day = 12;
  datePtr->year = 2015;
  printf("Today's date is %i/%i/%.2i.\n", datePtr->month, datePtr->day,
         datePtr->year % 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xc,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x7df,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x1c(%rbp),%edx
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
mov    $0xc,%edx
mov    $0xf,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.date = type { i32, i32, i32 }
@.str = [29 x i8] c"Today's date is %i/%i/%.2i.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.date
%3 = alloca %struct.date*
store i32 0, i32* %1
store %struct.date* %2, %struct.date** %3
%4 = load %struct.date*, %struct.date** %3
%5 = getelementptr inbounds %struct.date, %struct.date* %4, i32 0, i32 0
store i32 10, i32* %5
%6 = load %struct.date*, %struct.date** %3
%7 = getelementptr inbounds %struct.date, %struct.date* %6, i32 0, i32 1
store i32 12, i32* %7
%8 = load %struct.date*, %struct.date** %3
%9 = getelementptr inbounds %struct.date, %struct.date* %8, i32 0, i32 2
store i32 2015, i32* %9
%10 = load %struct.date*, %struct.date** %3
%11 = getelementptr inbounds %struct.date, %struct.date* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load %struct.date*, %struct.date** %3
%14 = getelementptr inbounds %struct.date, %struct.date* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = load %struct.date*, %struct.date** %3
%17 = getelementptr inbounds %struct.date, %struct.date* %16, i32 0, i32 2
%18 = load i32, i32* %17
%19 = srem i32 %18, 100
%20 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %15, i32 %19)
ret i32 0
}

LLVM IR (-O2):
%struct.date = type { i32, i32, i32 }
@.str = [29 x i8] c"Today's date is %i/%i/%.2i.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 10, i32 12, i32 15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M581_f(char *s) {
  debug("M581_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M581_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M581_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M581_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M581_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M581_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M581_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/);
mode_t umask(mode_t mode) { return syscall(60, mode); }


x86 assembly (clang, -O0):
<umask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x3c,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umask>:
mov    %edi,%esi
mov    $0x3c,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @umask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @syscall(i32 60, i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @umask(i32 %0) {
%2 = tail call i32 @syscall(i32 60, i32 %0)
ret i32 %2
}
signed short signedshort_id(signed short x) { return x; }


x86 assembly (clang, -O0):
<signedshort_id>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedshort_id>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @signedshort_id(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
ret i16 %3
}

LLVM IR (-O2):
define signext i16 @signedshort_id(i16 returned signext %0) {
ret i16 %0
}
/* Variables and functions */
void *v(size_t);
void *w(size_t n) { return v(n); }


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

x86 assembly (clang, -O2):
<w>:
jmp    1030 <v@plt>

LLVM IR (-O0):
define i8* @w(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @v(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @w(i64 %0) {
%2 = tail call i8* @v(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef scalar_t__ wchar_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
wint_t putwc(wchar_t wc, FILE *stream) { return fputc((char)wc, stream); }


x86 assembly (clang, -O0):
<putwc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putwc>:
movsbl %dil,%edi
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define i32 @putwc(i64 %0, i32* nocapture %1) {
%3 = trunc i64 %0 to i8
%4 = tail call i32 @fputc(i8 signext %3, i32* %1)
ret i32 %4
}
void *yy_flex_xmalloc(size)
int size;
{
  void *result = yy_flex_alloc(size);
  if (!result)
    flexfatal("memory allocation failed in yy_flex_xmalloc()");
  return result;
}


x86 assembly (clang, -O0):
<yy_flex_xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <yy_flex_alloc@plt>
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <yy_flex_xmalloc+0x34>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <flexfatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yy_flex_xmalloc>:
push   %rbx
xor    %eax,%eax
call   1030 <yy_flex_alloc@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    113c <yy_flex_xmalloc+0x1c>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <flexfatal@plt>
movslq %ebx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"memory allocation failed in yy_flex_xmalloc()\00"
define i8* @yy_flex_xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @yy_flex_alloc to i32 (i32, ...)*)(i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @flexfatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [46 x i8] c"memory allocation failed in yy_flex_xmalloc()\00"
define i8* @yy_flex_xmalloc(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @yy_flex_alloc to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @flexfatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = sext i32 %2 to i64
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void report_error(char *msg) {
  write(1, "0", 1);
  write(1, msg, strlen(msg));
  close(1);
  exit(0);
}


x86 assembly (clang, -O0):
<report_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edx
lea    0xea8(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <close@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<report_error>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <close@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define void @report_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @write(i32 1, i8* %4, i32 %6)
%8 = call i32 @close(i32 1)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define void @report_error(i8* %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 1, i8* %0, i32 %3)
%5 = tail call i32 @close(i32 1)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *);
void so2_oops_exit(void) { pr_info("oops exit\n"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"oops exit\0A\00"
define void @so2_oops_exit() {
%1 = call i32 @pr_info(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"oops exit\0A\00"
define void @so2_oops_exit() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strn_catf(char *, size_t, char *, char const *);
int strn_cat(char *dst, size_t size, const char *src) {
  return strn_catf(dst, size, "%s", src);
}


x86 assembly (clang, -O0):
<strn_cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rdx
call   1030 <strn_catf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strn_cat>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdx
jmp    1030 <strn_catf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @strn_cat(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @strn_catf(i8* %0, i64 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %4
}
/* Variables and functions */
char *my_strdup(char *);
scalar_t__ strcmp(char *, char *);
char *a_or(char *pcL, char *pcR) {
  if (strcmp(pcL, "TRUE") == 0)
    return my_strdup("TRUE");
  else
    return my_strdup(pcR);
}


x86 assembly (clang, -O0):
<a_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115f <a_or+0x3f>
lea    0xeaf(%rip),%rdi
call   1040 <my_strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    116c <a_or+0x4c>
mov    -0x18(%rbp),%rdi
call   1040 <my_strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_or>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
cmove  %r14,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <my_strdup@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"TRUE\00"
define i8* @a_or(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i8* @my_strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %10, i8** %3
br label %14
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = call i8* @my_strdup(i8* %12)
store i8* %13, i8** %3
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"TRUE\00"
define i8* @a_or(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1
%6 = tail call i8* @my_strdup(i8* %5)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ getyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ stdscr;
void gui_getyx(int *y, int *x) { getyx(stdscr, *y, *x); }


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

x86 assembly (clang, -O2):
<gui_getyx>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%ecx
mov    (%rsi),%edx
mov    %eax,%edi
mov    %ecx,%esi
jmp    1030 <getyx@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @gui_getyx(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @stdscr
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = call i32 @getyx(i32 %5, i32 %7, i32 %9)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @gui_getyx(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* @stdscr
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @getyx(i32 %3, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msg_func();
int /*<<< orphan*/ write(int, char *, int);
int main() {
  msg_func();
  write(1, "Good done!\n", 12);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <msg_func@plt>
mov    $0x1,%edi
lea    0xebe(%rip),%rsi
mov    $0xc,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <msg_func@plt>
lea    0xed1(%rip),%rsi
mov    $0x1,%edi
mov    $0xc,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Good done!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @msg_func()
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Good done!\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @msg_func()
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int **);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int *a = (int *)malloc(sizeof(*a));
  *a = 2;
  foo(&a);
  printf("after a = %d\n", *a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
lea    -0x8(%rbp),%rdi
call   1050 <foo@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,(%rsp)
movl   $0x2,(%rax)
mov    %rsp,%rdi
call   1050 <foo@plt>
mov    (%rsp),%rax
mov    (%rax),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"after a = %d\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
store i32 2, i32* %4
%5 = call i32 @foo(i32** %1)
%6 = load i32*, i32** %1
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"after a = %d\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = tail call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %1
store i32 2, i32* %4
%5 = call i32 @foo(i32** %1)
%6 = load i32*, i32** %1
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}