xunge/DecIR huggingface dataset:
/* Type definitions */
struct tgl_state {
  int dummy;
};
struct connection {
  int dummy;
};

/* Variables and functions */
int tc_close(struct tgl_state *, struct connection *, int /*<<< orphan*/);
int rpc_close(struct tgl_state *TLS, struct connection *c) {
  return tc_close(TLS, c, 0);
}


x86 assembly (clang, -O0):
<rpc_close>:
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    %edx,%edx
call   1030 <tc_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpc_close>:
xor    %edx,%edx
jmp    1030 <tc_close@plt>

LLVM IR (-O0):
%struct.tgl_state = type { i32 }
%struct.connection = type { i32 }
define i32 @rpc_close(%struct.tgl_state* %0, %struct.connection* %1) {
%3 = alloca %struct.tgl_state*
%4 = alloca %struct.connection*
store %struct.tgl_state* %0, %struct.tgl_state** %3
store %struct.connection* %1, %struct.connection** %4
%5 = load %struct.tgl_state*, %struct.tgl_state** %3
%6 = load %struct.connection*, %struct.connection** %4
%7 = call i32 @tc_close(%struct.tgl_state* %5, %struct.connection* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.tgl_state = type { i32 }
%struct.connection = type { i32 }
define i32 @rpc_close(%struct.tgl_state* %0, %struct.connection* %1) {
%3 = tail call i32 @tc_close(%struct.tgl_state* %0, %struct.connection* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ vcputc0(char);
void vcputs0(char *s) {
  for (; *s; s++)
    vcputc0(*s);
}


x86 assembly (clang, -O0):
<vcputs0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <vcputs0+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <vcputc0@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <vcputs0+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @vcputs0(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @vcputc0(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
void util_zero(void *buf, int len) {
  char *zero = buf;
  while (len--)
    *zero++ = 0;
}


x86 assembly (clang, -O0):
<util_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     113e <util_zero+0x3e>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
jmp    1113 <util_zero+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_zero>:
test   %esi,%esi
je     1122 <util_zero+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @util_zero(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
void smbprofile_dump(void) { return; }


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

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

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

LLVM IR (-O2):
define void @smbprofile_dump() {
ret void
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int l2tp_peer_list_1_svc(void *, struct svc_req *);
int _l2tp_peer_list_1(void *argp, void *result, struct svc_req *rqstp) {
  return (l2tp_peer_list_1_svc(result, rqstp));
}


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

x86 assembly (clang, -O2):
<_l2tp_peer_list_1>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <l2tp_peer_list_1_svc@plt>

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define i32 @_l2tp_peer_list_1(i8* %0, i8* %1, %struct.svc_req* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.svc_req*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.svc_req* %2, %struct.svc_req** %6
%7 = load i8*, i8** %5
%8 = load %struct.svc_req*, %struct.svc_req** %6
%9 = call i32 @l2tp_peer_list_1_svc(i8* %7, %struct.svc_req* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define i32 @_l2tp_peer_list_1(i8* nocapture readnone %0, i8* %1, %struct.svc_req* %2) {
%4 = tail call i32 @l2tp_peer_list_1_svc(i8* %1, %struct.svc_req* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ check_flags(int, char **);
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ init(int, char **);
int main(int argc, char *argv[]) {
  check_flags(argc, argv);
  init(argc, argv);
  cleanup();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <check_flags@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <init@plt>
mov    $0x0,%al
call   1050 <cleanup@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <check_flags@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <init@plt>
xor    %eax,%eax
call   1050 <cleanup@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @check_flags(i32 %6, i8** %7)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @init(i32 %9, i8** %10)
%12 = call i32 (...) @cleanup()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @check_flags(i32 %0, i8** %1)
%4 = tail call i32 @init(i32 %0, i8** %1)
%5 = tail call i32 (...) @cleanup()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int back_bone(__attribute__((__unused__)) int argc,
              __attribute__((__unused__)) char **argv) {
  fprintf(stderr, "[BACK] "
                  "error"
                  ": "
                  "subcommand 'bone' not yet implemented"
                  "\n");
  return -1;
}


x86 assembly (clang, -O0):
<back_bone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<back_bone>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"[BACK] error: subcommand 'bone' not yet implemented\0A\00"
define i32 @back_bone(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"[BACK] error: subcommand 'bone' not yet implemented\0A\00"
define i32 @back_bone(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
void swapValues(float *array, int index1, int index2) {
  float value1 = array[index1];
  array[index1] = array[index2];
  array[index2] = value1;
}


x86 assembly (clang, -O0):
<swapValues>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapValues>:
movslq %esi,%rax
movss  (%rdi,%rax,4),%xmm0
movslq %edx,%rcx
movss  (%rdi,%rcx,4),%xmm1
movss  %xmm1,(%rdi,%rax,4)
movss  %xmm0,(%rdi,%rcx,4)
ret

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

LLVM IR (-O2):
define void @swapValues(float* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds float, float* %0, i64 %4
%6 = load float, float* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds float, float* %0, i64 %7
%9 = load float, float* %8
store float %9, float* %5
store float %6, float* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read_vertex(int, int, int **);
void read_graph(int vertex_count, int graph[100][100]) {
  int i;
  for (i = 0; i < vertex_count; i++) {
    read_vertex(i, vertex_count, graph);
  }
}


x86 assembly (clang, -O0):
<read_graph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114f <read_graph+0x3f>
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <read_vertex@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <read_graph+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_graph>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1133 <read_graph+0x23>
mov    %rsi,%r14
mov    %edi,%ebp
xor    %ebx,%ebx
nop
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
call   1030 <read_vertex@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1120 <read_graph+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @read_graph(i32 %0, [100 x i32]* %1) {
%3 = alloca i32
%4 = alloca [100 x i32]*
%5 = alloca i32
store i32 %0, i32* %3
store [100 x i32]* %1, [100 x i32]** %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = load [100 x i32]*, [100 x i32]** %4
%14 = bitcast [100 x i32]* %13 to i32**
%15 = call i32 @read_vertex(i32 %11, i32 %12, i32** %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @read_graph(i32 %0, [100 x i32]* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = bitcast [100 x i32]* %1 to i32**
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 0, %4 ], [ %9, %6 ]
%8 = tail call i32 @read_vertex(i32 %7, i32 %0, i32** %5)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
void CONF_load(void) {}


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

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

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

LLVM IR (-O2):
define void @CONF_load() {
ret void
}
/* Variables and functions */
char *get_glyph_gen(char *, char *, char, int);
char *get_glyph(char *iptr, char *optr, char mchar) {
  return get_glyph_gen(iptr, optr, mchar, 1);
}


x86 assembly (clang, -O0):
<get_glyph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%ecx
movsbl -0x11(%rbp),%edx
call   1030 <get_glyph_gen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_glyph>:
mov    $0x1,%ecx
jmp    1030 <get_glyph_gen@plt>

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

LLVM IR (-O2):
define i8* @get_glyph(i8* %0, i8* %1, i8 signext %2) {
%4 = tail call i8* @get_glyph_gen(i8* %0, i8* %1, i8 signext %2, i32 1)
ret i8* %4
}
void main(void) {
  int vetor = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int size = sizeof(vetor) / sizeof(int);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t timestamp_get(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @timestamp_get() {
ret i32 0
}
/* Variables and functions */
void *mxMalloc(size_t);
void *def_alloc_func(void *opaque, size_t items, size_t size) {
  (void)opaque, (void)items, (void)size;
  return mxMalloc(items * size);
}


x86 assembly (clang, -O0):
<def_alloc_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1030 <mxMalloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<def_alloc_func>:
mov    %rsi,%rdi
imul   %rdx,%rdi
jmp    1030 <mxMalloc@plt>

LLVM IR (-O0):
define i8* @def_alloc_func(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = mul i64 %10, %11
%13 = call i8* @mxMalloc(i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @def_alloc_func(i8* nocapture readnone %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i8* @mxMalloc(i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Error(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void Error1(int e) { Error(e, NULL, 0); }


x86 assembly (clang, -O0):
<Error1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <Error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Error1>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <Error@plt>

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

LLVM IR (-O2):
define void @Error1(i32 %0) {
%2 = tail call i32 @Error(i32 %0, i32* null, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wfd_cfg_wps_params_usage(void) {
  printf("\nUsage : wfd_cfg_wps_params [pin/pbc/none]");
  printf("\nIf pin/pbc/none is provided, 'set' is performed"
         " otherwise 'get' is performed.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_wfd_cfg_wps_params_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xef7(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"\0AUsage : wfd_cfg_wps_params [pin/pbc/none]\00"
@.str.1 = [80 x i8] c"\0AIf pin/pbc/none is provided, 'set' is performed otherwise 'get' is performed.\0A\00"
define void @print_wfd_cfg_wps_params_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"\0AUsage : wfd_cfg_wps_params [pin/pbc/none]\00"
@str = [79 x i8] c"\0AIf pin/pbc/none is provided, 'set' is performed otherwise 'get' is performed.\00"
define void @print_wfd_cfg_wps_params_usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str, i64 0, i64 0))
ret void
}
int gcd(int a, int b) {
  a = (a >= 0) ? a : -a;
  b = (b >= 0) ? b : -b;
  while (b > 0) {
    int x = b;
    b = a % b;
    a = x;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111f <gcd+0x1f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <gcd+0x27>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1142 <gcd+0x42>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114a <gcd+0x4a>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1175 <gcd+0x75>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <gcd+0x50>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
test   %esi,%esi
je     112e <gcd+0x2e>
mov    %esi,%edx
neg    %edx
cmovs  %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1120 <gcd+0x20>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %13
10: ; preds = %2
%11 = load i32, i32* %3
%12 = sub nsw i32 0, %11
br label %13
13: ; preds = %10, %8
%14 = phi i32 [ %9, %8 ], [ %12, %10 ]
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %4
br label %22
19: ; preds = %13
%20 = load i32, i32* %4
%21 = sub nsw i32 0, %20
br label %22
22: ; preds = %19, %17
%23 = phi i32 [ %18, %17 ], [ %21, %19 ]
store i32 %23, i32* %4
br label %24
24: ; preds = %27, %22
%25 = load i32, i32* %4
%26 = icmp sgt i32 %25, 0
br i1 %26, label %27, label %33
27: ; preds = %24
%28 = load i32, i32* %4
store i32 %28, i32* %5
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = srem i32 %29, %30
store i32 %31, i32* %4
%32 = load i32, i32* %5
store i32 %32, i32* %3
br label %24
33: ; preds = %24
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = icmp eq i32 %1, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ %9, %7 ], [ %3, %5 ]
%9 = phi i32 [ %10, %7 ], [ %6, %5 ]
%10 = urem i32 %8, %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %2
%13 = phi i32 [ %3, %2 ], [ %9, %7 ]
ret i32 %13
}
/* Variables and functions */
int f(int);
int g(int);
int h(int x) {
  if (f(x))
    x = g(x);
  else
    x = g(f(x));
  return x * 2;
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
cmp    $0x0,%eax
je     114c <h+0x2c>
mov    -0x4(%rbp),%edi
call   1040 <g@plt>
mov    %eax,-0x4(%rbp)
jmp    115e <h+0x3e>
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    %eax,%edi
call   1040 <g@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rbx
mov    %edi,%ebx
call   1030 <f@plt>
test   %eax,%eax
jne    1135 <h+0x15>
mov    %ebx,%edi
call   1030 <f@plt>
mov    %eax,%ebx
mov    %ebx,%edi
call   1040 <g@plt>
add    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @h(i32 %0) {
%2 = tail call i32 @f(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @f(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
%8 = tail call i32 @g(i32 %7)
%9 = shl nsw i32 %8, 1
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
void signal_handler(int sig, siginfo_t *info, void *unused) {
  int do_nothing = 0;
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @signal_handler(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
store i32 0, i32* %7
ret void
}

LLVM IR (-O2):
define void @signal_handler(i32 %0, i32* nocapture %1, i8* nocapture %2) {
ret void
}
RX0AX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((p0[x0]) <= (((int *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
movslq -0x14(%rbp),%rdx
mov    $0xa98ac7,%ecx
cmp    (%rcx,%rdx,4),%eax
jg     1141 <RX0AX1+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <RX0AX1+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0AX1>:
movslq %edx,%rax
mov    (%r8,%rax,4),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(,%rcx,4),%edx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @RX0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %10
%12 = load i32, i32* %11
%13 = icmp sle i32 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int cc();
int MAMain() {
  int a, b, c, d, e;
  a = 3;
  b = 3 + a;
  b = b + cc();
  c = b + a;
  d = c + a + a;
  e = 10;
  return a;
}


x86 assembly (clang, -O0):
<MAMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <cc@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAMain>:
push   %rax
xor    %eax,%eax
call   1030 <cc@plt>
mov    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @MAMain() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 3, i32* %1
%6 = load i32, i32* %1
%7 = add nsw i32 3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 (...) @cc()
%10 = add nsw i32 %8, %9
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = load i32, i32* %1
%13 = add nsw i32 %11, %12
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = load i32, i32* %1
%16 = add nsw i32 %14, %15
%17 = load i32, i32* %1
%18 = add nsw i32 %16, %17
store i32 %18, i32* %4
store i32 10, i32* %5
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @MAMain() {
%1 = tail call i32 (...) @cc()
ret i32 3
}
unsigned int hash(char *s) {
  unsigned int hashval;
  for (hashval = 0; *s != '\0'; s++)
    hashval = *s + 31 * hashval;
  return hashval % 50;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x32,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113c <hash+0x3c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
imul   $0x51eb851f,%rcx,%rcx
shr    $0x24,%rcx
imul   $0x32,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 50
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *, ...);
void Mali_JobError(int stat, int mask) {
  printk("Unexpected Job Interrupt:\n");
  printk("Int Status=%08x, Error Mask=%08x\n", stat, mask);
  printk("TEST FAILED\n\n");
  ;
}


x86 assembly (clang, -O0):
<Mali_JobError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mali_JobError>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <printk@plt>
lea    0xeef(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printk@plt>
lea    0xeff(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printk@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Unexpected Job Interrupt:\0A\00"
@.str.1 = [34 x i8] c"Int Status=%08x, Error Mask=%08x\0A\00"
@.str.2 = [14 x i8] c"TEST FAILED\0A\0A\00"
define void @Mali_JobError(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
%9 = call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Unexpected Job Interrupt:\0A\00"
@.str.1 = [34 x i8] c"Int Status=%08x, Error Mask=%08x\0A\00"
@.str.2 = [14 x i8] c"TEST FAILED\0A\0A\00"
define void @Mali_JobError(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1)
%5 = tail call i32 (i8*, ...) @printk(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("Hi World\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Hi World\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"Hi World\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char const *);
int _sd2txt_len(const char *key, char *val) {
  int ret = strlen(key);
  if (!*val)
    return ret;
  ret += strlen(val);
  ret++;
  return ret;
}


x86 assembly (clang, -O0):
<_sd2txt_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1144 <_sd2txt_len+0x34>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <_sd2txt_len+0x52>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sd2txt_len>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebx
cmpb   $0x0,(%r14)
je     1131 <_sd2txt_len+0x21>
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %eax,%ebx
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @_sd2txt_len(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %1)
%8 = add i32 %3, 1
%9 = add i32 %8, %7
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ %3, %2 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __chk_error(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int *, int /*<<< orphan*/);
void wait_for_child(pid_t pid) {
  int status;
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/dslutz/qemu/refs/heads/master/tests/"
              "tcg/multiarch/linux-test.c",
              397, (waitpid(pid, &status, 0)));
}


x86 assembly (clang, -O0):
<wait_for_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    %eax,%edx
lea    0xebe(%rip),%rdi
mov    $0x18d,%esi
call   1030 <__chk_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_child>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
lea    0xecc(%rip),%rdi
mov    $0x18d,%esi
mov    %eax,%edx
call   1030 <__chk_error@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dslutz/qemu/refs/heads/master/tests/tcg/multiarch/linux-test.c\00"
define void @wait_for_child(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @waitpid(i32 %4, i32* %3, i32 0)
%6 = call i32 @__chk_error(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 397, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dslutz/qemu/refs/heads/master/tests/tcg/multiarch/linux-test.c\00"
define void @wait_for_child(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @waitpid(i32 %0, i32* %2, i32 0)
%5 = call i32 @__chk_error(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 397, i32 %4)
ret void
}
int mixedfsizes(double *a, long double *b) {
  *a = 2.0;
  *b = 1.2;
  return *a;
}


x86 assembly (clang, -O0):
<mixedfsizes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movabs $0x4000000000000000,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
fldl   0xed9(%rip)
fstpt  (%rax)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixedfsizes>:
movabs $0x4000000000000000,%rax
mov    %rax,(%rdi)
fldl   0xeed(%rip)
fstpt  (%rsi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @mixedfsizes(double* %0, x86_fp80* %1) {
%3 = alloca double*
%4 = alloca x86_fp80*
store double* %0, double** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load double*, double** %3
store double 2.000000e+00, double* %5
%6 = load x86_fp80*, x86_fp80** %4
store x86_fp80 0xK3FFF9999999999999800, x86_fp80* %6
%7 = load double*, double** %3
%8 = load double, double* %7
%9 = fptosi double %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @mixedfsizes(double* nocapture writeonly %0, x86_fp80* nocapture writeonly %1) {
store double 2.000000e+00, double* %0
store x86_fp80 0xK3FFF9999999999999800, x86_fp80* %1
ret i32 2
}
void cmd_disp() {}


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

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

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

LLVM IR (-O2):
define void @cmd_disp() {
ret void
}
void setD(char *x, int n, int val) {
  if (n < 0 || n > 8)
    return;
  x[2] = (x[2] & ~(1 << n)) | (val ? (1 << n) : 0);
}


x86 assembly (clang, -O0):
<setD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1122 <setD+0x22>
cmpl   $0x8,-0xc(%rbp)
jle    1127 <setD+0x27>
jmp    117a <setD+0x7a>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     115f <setD+0x5f>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
jmp    1169 <setD+0x69>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    1169 <setD+0x69>
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setD>:
cmp    $0x8,%esi
ja     111f <setD+0x1f>
mov    $0x1,%eax
mov    %esi,%ecx
shl    %cl,%eax
movzbl 0x2(%rdi),%ecx
btr    %esi,%ecx
test   %edx,%edx
cmove  %edx,%eax
or     %ecx,%eax
mov    %al,0x2(%rdi)
ret

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

LLVM IR (-O2):
define void @setD(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp ugt i32 %1, 8
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 1, %1
%10 = xor i32 %9, -1
%11 = and i32 %8, %10
%12 = icmp eq i32 %2, 0
%13 = select i1 %12, i32 0, i32 %9
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %6
br label %16
16: ; preds = %3, %5
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
void uint8t2hex_lower(uint8_t v, uint8_t hex[2]) {
  const uint8_t tbl[0x10] = {'0', '1', '2', '3', '4', '5', '6', '7',
                             '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
  hex[1] = tbl[(v >> 0) & 0xf];
  hex[0] = tbl[(v >> 4) & 0xf];
  return;
}


x86 assembly (clang, -O0):
<uint8t2hex_lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x18(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x0,%eax
and    $0xf,%eax
cltq
mov    -0x20(%rbp,%rax,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
cltq
mov    -0x20(%rbp,%rax,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint8t2hex_lower>:
movzbl %dil,%eax
and    $0xf,%edi
lea    0xef2(%rip),%rcx
mov    (%rdi,%rcx,1),%dl
mov    %dl,0x1(%rsi)
shr    $0x4,%rax
mov    (%rax,%rcx,1),%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
@__const.uint8t2hex_lower.tbl = [16 x i8] c"0123456789abcdef"
define void @uint8t2hex_lower(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca [16 x i8]
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = bitcast [16 x i8]* %5 to i8*
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = ashr i32 %8, 0
%10 = and i32 %9, 15
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = ashr i32 %17, 4
%19 = and i32 %18, 15
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 0
store i8 %22, i8* %24
ret void
}

LLVM IR (-O2):
@__const.uint8t2hex_lower.tbl = [16 x i8] c"0123456789abcdef"
define void @uint8t2hex_lower(i8 signext %0, i8* nocapture writeonly %1) {
%3 = zext i8 %0 to i32
%4 = and i32 %3, 15
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [16 x i8], [16 x i8]* @__const.uint8t2hex_lower.tbl, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %3, 4
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [16 x i8], [16 x i8]* @__const.uint8t2hex_lower.tbl, i64 0, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %1
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ convert_time(double, int *);
struct timeval convert_timeval(double value) {
  struct timeval tv;
  int millisecs;
  tv.tv_sec = convert_time(value, &millisecs);
  tv.tv_usec = millisecs;
  return tv;
}


x86 assembly (clang, -O0):
<convert_timeval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x14(%rbp),%rdi
call   1030 <convert_time@plt>
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_timeval>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <convert_time@plt>
mov    0x4(%rsp),%ecx
shl    $0x20,%rax
or     %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @convert_timeval(double %0) {
%2 = alloca %struct.timeval
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
%5 = load double, double* %3
%6 = call i32 @convert_time(double %5, i32* %4)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store i32 %6, i32* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store i32 %8, i32* %9
%10 = bitcast %struct.timeval* %2 to i64*
%11 = load i64, i64* %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @convert_timeval(double %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @convert_time(double %0, i32* %2)
%5 = load i32, i32* %2
%6 = zext i32 %4 to i64
%7 = shl nuw i64 %6, 32
%8 = zext i32 %5 to i64
%9 = or i64 %7, %8
ret i64 %9
}
void set_rook(char *p) { *p |= (1 << 3); }


x86 assembly (clang, -O0):
<set_rook>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x8,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_rook>:
orb    $0x8,(%rdi)
ret

LLVM IR (-O0):
define void @set_rook(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = or i32 %5, 8
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
ret void
}

LLVM IR (-O2):
define void @set_rook(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = or i8 %2, 8
store i8 %3, i8* %0
ret void
}
int test_imm_9Bint8_mem(signed char *val) {
  return ((*val) & (-0x9B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Bint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff65,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Bint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff65,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Bint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -155
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}