xunge/DecIR huggingface dataset:
char *_ltrim(char *pStr) {
  char *p;
  if ((pStr == (0)) || (*pStr == 0)) {
    return pStr;
  }
  p = pStr;
  while (*p == ' ' || *p == '\t')
    p++;
  return p;
}


x86 assembly (clang, -O0):
<_ltrim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1123 <_ltrim+0x23>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1130 <_ltrim+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1186 <_ltrim+0x86>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x19(%rbp)
je     115d <_ltrim+0x5d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    116d <_ltrim+0x6d>
jmp    117e <_ltrim+0x7e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <_ltrim+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ltrim>:
test   %rdi,%rdi
je     1124 <_ltrim+0x24>
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
jne    1118 <_ltrim+0x18>
ret
nop
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    $0x20,%cl
je     1110 <_ltrim+0x10>
cmp    $0x9,%cl
je     1110 <_ltrim+0x10>
jmp    110e <_ltrim+0xe>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @_ltrim(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3, %9
%7 = phi i8 [ %11, %9 ], [ %4, %3 ]
%8 = phi i8* [ %10, %9 ], [ %0, %3 ]
switch i8 %7, label %12 [
i8 32, label %9
i8 9, label %9
]
9: ; preds = %6, %6
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
br label %6
12: ; preds = %6, %1, %3
%13 = phi i8* [ %0, %3 ], [ null, %1 ], [ %8, %6 ]
ret i8* %13
}
int vout_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vout_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun8() {
  printf("This is func8. \n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"This is func8. \00"
define void @fun8() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool is_leap_year(const int year) {
  bool leap_year;
  if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) {
    leap_year = true;
  } else {
    leap_year = false;
  }
  return leap_year;
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <is_leap_year+0x4f>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <is_leap_year+0x43>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <is_leap_year+0x4f>
movl   $0x1,-0x8(%rbp)
jmp    1156 <is_leap_year+0x56>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
test   $0x3,%dil
jne    1143 <is_leap_year+0x43>
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
mov    $0x1,%eax
cmp    $0x28f5c28,%ecx
ja     1145 <is_leap_year+0x45>
movslq %edi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%edi
je     1145 <is_leap_year+0x45>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp ne i32 %5, 0
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
br i1 %9, label %11, label %10
10: ; preds = %4, %1
br label %11
11: ; preds = %4, %10
%12 = phi i32 [ 0, %10 ], [ 1, %4 ]
ret i32 %12
}
/* Variables and functions */
char *date_convert_international_string(char *);
char *date_convert_american2international(char *american) {
  return date_convert_international_string(american);
}


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

x86 assembly (clang, -O2):
<date_convert_american2international>:
jmp    1030 <date_convert_international_string@plt>

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

LLVM IR (-O2):
define i8* @date_convert_american2international(i8* %0) {
%2 = tail call i8* @date_convert_international_string(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func(void) {
  int localFunc;
  static int localFuncStatic;
  printf("localFunc=%d\n", localFunc);
  printf("localMainStatic=%d\n", localFuncStatic);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eff(%rip),%esi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
xor    %esi,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@func.localFuncStatic = internal global i32 0
@.str = [14 x i8] c"localFunc=%d\0A\00"
@.str.1 = [20 x i8] c"localMainStatic=%d\0A\00"
define void @func() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @func.localFuncStatic
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"localFunc=%d\0A\00"
@.str.1 = [20 x i8] c"localMainStatic=%d\0A\00"
define void @func() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
int tdb_create_rwlocks(int fd, unsigned int hash_size) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tdb_create_rwlocks(i32 %0, i32 %1) {
ret i32 0
}
double multiplex_2_extended_types_s9_decode(float value) {
  return ((double)value);
}


x86 assembly (clang, -O0):
<multiplex_2_extended_types_s9_decode>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplex_2_extended_types_s9_decode>:
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @multiplex_2_extended_types_s9_decode(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
ret double %4
}

LLVM IR (-O2):
define double @multiplex_2_extended_types_s9_decode(float %0) {
%2 = fpext float %0 to double
ret double %2
}
/* Variables and functions */
const char *_nl_expand_alias(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @_nl_expand_alias() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_nl_expand_alias() {
ret i8* null
}
void batadv_nc_update_nc_node(struct batadv_priv *bat_priv,
                              struct batadv_orig_node *orig_node,
                              struct batadv_orig_node *orig_neigh_node,
                              struct batadv_ogm_packet *ogm_packet,
                              int is_single_hop_neigh) {}


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

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

LLVM IR (-O0):
%struct.batadv_priv = type opaque
%struct.batadv_orig_node = type opaque
%struct.batadv_ogm_packet = type opaque
define void @batadv_nc_update_nc_node(%struct.batadv_priv* %0, %struct.batadv_orig_node* %1, %struct.batadv_orig_node* %2, %struct.batadv_ogm_packet* %3, i32 %4) {
%6 = alloca %struct.batadv_priv*
%7 = alloca %struct.batadv_orig_node*
%8 = alloca %struct.batadv_orig_node*
%9 = alloca %struct.batadv_ogm_packet*
%10 = alloca i32
store %struct.batadv_priv* %0, %struct.batadv_priv** %6
store %struct.batadv_orig_node* %1, %struct.batadv_orig_node** %7
store %struct.batadv_orig_node* %2, %struct.batadv_orig_node** %8
store %struct.batadv_ogm_packet* %3, %struct.batadv_ogm_packet** %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.batadv_priv = type opaque
%struct.batadv_orig_node = type opaque
%struct.batadv_ogm_packet = type opaque
define void @batadv_nc_update_nc_node(%struct.batadv_priv* nocapture %0, %struct.batadv_orig_node* nocapture %1, %struct.batadv_orig_node* nocapture %2, %struct.batadv_ogm_packet* nocapture %3, i32 %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ spx_ifft(void *, float *, float *);
void spx_ifft_float(void *table, float *in, float *out) {
  spx_ifft(table, in, out);
}


x86 assembly (clang, -O0):
<spx_ifft_float>:
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),%rdx
call   1030 <spx_ifft@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spx_ifft_float>:
jmp    1030 <spx_ifft@plt>

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

LLVM IR (-O2):
define void @spx_ifft_float(i8* %0, float* %1, float* %2) {
%4 = tail call i32 @spx_ifft(i8* %0, float* %1, float* %2)
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int at_tok_char(char **p_cur) {
  if (*p_cur == NULL) {
    return -1;
  }
  *p_cur = strchr(*p_cur, '(');
  if (*p_cur == NULL) {
    return -1;
  }
  (*p_cur)++;
  return 0;
}


x86 assembly (clang, -O0):
<at_tok_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1136 <at_tok_char+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <at_tok_char+0x70>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x28,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    116b <at_tok_char+0x5b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <at_tok_char+0x70>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_tok_char>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0xffffffff,%ebp
test   %rdi,%rdi
je     113e <at_tok_char+0x2e>
mov    $0x28,%esi
call   1030 <strchr@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     113e <at_tok_char+0x2e>
add    $0x1,%rax
mov    %rax,(%rbx)
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @at_tok_char(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i8* @strchr(i8* %2, i8 signext 40)
store i8* %5, i8** %0
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %8, i8** %0
br label %9
9: ; preds = %4, %1, %7
%10 = phi i32 [ 0, %7 ], [ -1, %1 ], [ -1, %4 ]
ret i32 %10
}
void RTSemRWIsWriteOwner(void) {}


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

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

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

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

/* Variables and functions */
void SHAREMIND_MAP_KEY_FREE_uint64_t(uint64_t *const dest) { (void)dest; }


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_uint64_t(i32* nocapture %0) {
ret void
}
int a_cas(volatile int *p, int t, int s) {
  __asm__("lock ; cmpxchg %3, %1"
          : "=a"(t), "=m"(*p)
          : "a"(t), "r"(s)
          : "memory");
  return t;
}


x86 assembly (clang, -O0):
<a_cas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_cas>:
mov    %esi,%eax
lock cmpxchg %edx,(%rdi)
ret

LLVM IR (-O0):
define i32 @a_cas(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 asm "lock ; cmpxchg $3, $1", "={ax},=*m,{ax},r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %7, i32 %8, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @a_cas(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 asm "lock ; cmpxchg $3, $1", "={ax},=*m,{ax},r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %1, i32 %2)
ret i32 %4
}
int double_to_d16(double x) { return (int)(x * 0x10000); }


x86 assembly (clang, -O0):
<double_to_d16>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_d16>:
mulsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @double_to_d16(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 6.553600e+04
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @double_to_d16(double %0) {
%2 = fmul double %0, 6.553600e+04
%3 = fptosi double %2 to i32
ret i32 %3
}
void test_zero() {
#pragma omp sections
  {}
}


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

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

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

LLVM IR (-O2):
define void @test_zero() {
ret void
}
int test_imm_4Fint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x4F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Fint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x4f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Fint64_midword_mem>:
testb  $0x4f,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Fint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 79
%7 = icmp ne i64 %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_4Fint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 5177344
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int yas_lis331dlh_read_reg(unsigned char, unsigned char *, int);
int yas_lis331dlh_read_reg_byte(unsigned char adr) {
  unsigned char buf;
  int err;
  err = yas_lis331dlh_read_reg(adr, &buf, 1);
  if (err == 0) {
    return buf;
  }
  return 0;
}


x86 assembly (clang, -O0):
<yas_lis331dlh_read_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x5(%rbp),%edi
call   1030 <yas_lis331dlh_read_reg@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <yas_lis331dlh_read_reg_byte+0x39>
movzbl -0x6(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <yas_lis331dlh_read_reg_byte+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_lis331dlh_read_reg_byte>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <yas_lis331dlh_read_reg@plt>
xor    %ecx,%ecx
test   %eax,%eax
movzbl 0x7(%rsp),%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_lis331dlh_read_reg_byte(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
%6 = load i8, i8* %3
%7 = call i32 @yas_lis331dlh_read_reg(i8 zeroext %6, i8* %4, i32 1)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @yas_lis331dlh_read_reg_byte(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @yas_lis331dlh_read_reg(i8 zeroext %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 0
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ex1();
int /*<<< orphan*/ ex2();
int /*<<< orphan*/ ex3();
int /*<<< orphan*/ ex4();
int /*<<< orphan*/ ex5();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  printf("LISTA DE EXERCICIOS DE FDA - 06\n");
  srand(time(NULL));
  ex1();
  ex2();
  ex3();
  ex4();
  ex5();
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe5a(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    $0x0,%al
call   1040 <ex1@plt>
mov    $0x0,%al
call   10b0 <ex2@plt>
mov    $0x0,%al
call   1050 <ex3@plt>
mov    $0x0,%al
call   10a0 <ex4@plt>
mov    $0x0,%al
call   1030 <ex5@plt>
mov    $0x0,%al
call   1080 <getchar@plt>
mov    $0x0,%al
call   1080 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe68(%rip),%rdi
call   1060 <puts@plt>
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
xor    %eax,%eax
call   1040 <ex1@plt>
xor    %eax,%eax
call   10b0 <ex2@plt>
xor    %eax,%eax
call   1050 <ex3@plt>
xor    %eax,%eax
call   10a0 <ex4@plt>
xor    %eax,%eax
call   1030 <ex5@plt>
xor    %eax,%eax
call   1080 <getchar@plt>
xor    %eax,%eax
call   1080 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"LISTA DE EXERCICIOS DE FDA - 06\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @ex1()
%6 = call i32 (...) @ex2()
%7 = call i32 (...) @ex3()
%8 = call i32 (...) @ex4()
%9 = call i32 (...) @ex5()
%10 = call i32 (...) @getchar()
%11 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@str = [32 x i8] c"LISTA DE EXERCICIOS DE FDA - 06\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @ex1()
%5 = tail call i32 (...) @ex2()
%6 = tail call i32 (...) @ex3()
%7 = tail call i32 (...) @ex4()
%8 = tail call i32 (...) @ex5()
%9 = tail call i32 (...) @getchar()
%10 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ prompt();
int sgetc(char *);
int getdir() {
  prompt();
  addstr("What direction (0=right, 1=down) ? ");
  return (sgetc("01") - '0');
}


x86 assembly (clang, -O0):
<getdir>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <prompt@plt>
lea    0xebe(%rip),%rdi
call   1050 <addstr@plt>
lea    0xed6(%rip),%rdi
call   1040 <sgetc@plt>
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdir>:
push   %rax
xor    %eax,%eax
call   1030 <prompt@plt>
lea    0xec1(%rip),%rdi
call   1050 <addstr@plt>
lea    0xed9(%rip),%rdi
call   1040 <sgetc@plt>
add    $0xffffffd0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"What direction (0=right, 1=down) ? \00"
@.str.1 = [3 x i8] c"01\00"
define i32 @getdir() {
%1 = call i32 (...) @prompt()
%2 = call i32 @addstr(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sgetc(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = sub nsw i32 %3, 48
ret i32 %4
}

LLVM IR (-O2):
@.str = [36 x i8] c"What direction (0=right, 1=down) ? \00"
@.str.1 = [3 x i8] c"01\00"
define i32 @getdir() {
%1 = tail call i32 (...) @prompt()
%2 = tail call i32 @addstr(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @sgetc(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = add nsw i32 %3, -48
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int conn();
int /*<<< orphan*/ send(int, void *, int, int /*<<< orphan*/);
void conn_and_send(int64_t cmd[2]) {
  int fd = conn();
  if (fd == -1)
    return;
  send(fd, (void *)cmd, sizeof(int64_t) * 2, 0);
  close(fd);
}


x86 assembly (clang, -O0):
<conn_and_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <conn@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1155 <conn_and_send+0x25>
jmp    1170 <conn_and_send+0x40>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    -0xc(%rbp),%edi
call   1050 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conn_and_send>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <conn@plt>
cmp    $0xffffffff,%eax
je     1162 <conn_and_send+0x32>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <close@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @conn_and_send(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 (...) @conn()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %1
br label %15
8: ; preds = %1
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
%11 = bitcast i32* %10 to i8*
%12 = call i32 @send(i32 %9, i8* %11, i32 8, i32 0)
%13 = load i32, i32* %3
%14 = call i32 @close(i32 %13)
br label %15
15: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @conn_and_send(i32* %0) {
%2 = tail call i32 (...) @conn()
%3 = icmp eq i32 %2, -1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = bitcast i32* %0 to i8*
%6 = tail call i32 @send(i32 %2, i8* %5, i32 8, i32 0)
%7 = tail call i32 @close(i32 %2)
br label %8
8: ; preds = %1, %4
ret void
}
/* Type definitions */
struct sock {
  int dummy;
};
struct sk_buff {
  int dummy;
};

/* Variables and functions */
int cap_netlink_send(struct sock *, struct sk_buff *);
int security_netlink_send(struct sock *sk, struct sk_buff *skb) {
  return cap_netlink_send(sk, skb);
}


x86 assembly (clang, -O0):
<security_netlink_send>:
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 <cap_netlink_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<security_netlink_send>:
jmp    1030 <cap_netlink_send@plt>

LLVM IR (-O0):
%struct.sock = type { i32 }
%struct.sk_buff = type { i32 }
define i32 @security_netlink_send(%struct.sock* %0, %struct.sk_buff* %1) {
%3 = alloca %struct.sock*
%4 = alloca %struct.sk_buff*
store %struct.sock* %0, %struct.sock** %3
store %struct.sk_buff* %1, %struct.sk_buff** %4
%5 = load %struct.sock*, %struct.sock** %3
%6 = load %struct.sk_buff*, %struct.sk_buff** %4
%7 = call i32 @cap_netlink_send(%struct.sock* %5, %struct.sk_buff* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.sock = type { i32 }
%struct.sk_buff = type { i32 }
define i32 @security_netlink_send(%struct.sock* %0, %struct.sk_buff* %1) {
%3 = tail call i32 @cap_netlink_send(%struct.sock* %0, %struct.sk_buff* %1)
ret i32 %3
}
/* Type definitions */
struct snd_kcontrol {
  int dummy;
};
struct snd_ctl_elem_info {
  int dummy;
};

/* Variables and functions */
int snd_ctl_enum_info(struct snd_ctl_elem_info *, int, int,
                      char const *const *);
int snd_ac97_ad198x_spdif_source_info(struct snd_kcontrol *kcontrol,
                                      struct snd_ctl_elem_info *uinfo) {
  static const char *const texts[2] = {"AC-Link", "A/D Converter"};
  return snd_ctl_enum_info(uinfo, 1, 2, texts);
}


x86 assembly (clang, -O0):
<snd_ac97_ad198x_spdif_source_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
lea    0x2cdb(%rip),%rcx
call   1030 <snd_ctl_enum_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snd_ac97_ad198x_spdif_source_info>:
mov    %rsi,%rdi
lea    0x2cf6(%rip),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
jmp    1030 <snd_ctl_enum_info@plt>

LLVM IR (-O0):
%struct.snd_kcontrol = type { i32 }
%struct.snd_ctl_elem_info = type { i32 }
@snd_ac97_ad198x_spdif_source_info.texts = internal constant [2 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i32 0, i32 0)]
@.str = [8 x i8] c"AC-Link\00"
@.str.1 = [14 x i8] c"A/D Converter\00"
define i32 @snd_ac97_ad198x_spdif_source_info(%struct.snd_kcontrol* %0, %struct.snd_ctl_elem_info* %1) {
%3 = alloca %struct.snd_kcontrol*
%4 = alloca %struct.snd_ctl_elem_info*
store %struct.snd_kcontrol* %0, %struct.snd_kcontrol** %3
store %struct.snd_ctl_elem_info* %1, %struct.snd_ctl_elem_info** %4
%5 = load %struct.snd_ctl_elem_info*, %struct.snd_ctl_elem_info** %4
%6 = call i32 @snd_ctl_enum_info(%struct.snd_ctl_elem_info* %5, i32 1, i32 2, i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @snd_ac97_ad198x_spdif_source_info.texts, i64 0, i64 0))
ret i32 %6
}

LLVM IR (-O2):
%struct.snd_kcontrol = type { i32 }
%struct.snd_ctl_elem_info = type { i32 }
@snd_ac97_ad198x_spdif_source_info.texts = internal constant [2 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i32 0, i32 0)]
@.str = [8 x i8] c"AC-Link\00"
@.str.1 = [14 x i8] c"A/D Converter\00"
define i32 @snd_ac97_ad198x_spdif_source_info(%struct.snd_kcontrol* nocapture readnone %0, %struct.snd_ctl_elem_info* %1) {
%3 = tail call i32 @snd_ctl_enum_info(%struct.snd_ctl_elem_info* %1, i32 1, i32 2, i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @snd_ac97_ad198x_spdif_source_info.texts, i64 0, i64 0))
ret i32 %3
}
int imu_aspirin_eoc(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @imu_aspirin_eoc() {
ret i32 1
}
/* Type definitions */
struct NetPacket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sendPacket(int, struct NetPacket *);
void sendPacketToAll(struct NetPacket *pkt) {
  int i;
  for (i = 0; i < 4; i++) {
    sendPacket(i, pkt);
  }
}


x86 assembly (clang, -O0):
<sendPacketToAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1147 <sendPacketToAll+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <sendPacket@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <sendPacketToAll+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendPacketToAll>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <sendPacket@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1030 <sendPacket@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <sendPacket@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <sendPacket@plt>

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

LLVM IR (-O2):
%struct.NetPacket = type { i32 }
define void @sendPacketToAll(%struct.NetPacket* %0) {
%2 = tail call i32 @sendPacket(i32 0, %struct.NetPacket* %0)
%3 = tail call i32 @sendPacket(i32 1, %struct.NetPacket* %0)
%4 = tail call i32 @sendPacket(i32 2, %struct.NetPacket* %0)
%5 = tail call i32 @sendPacket(i32 3, %struct.NetPacket* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int a;
  printf("input:");
  scanf("%d", &a);
  printf("he:%d", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"input:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"he:%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
void SSMR3PutGCUIntReg(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutGCUIntReg() {
ret void
}
unsigned long ptok(pages)
unsigned long pages;
{
  static unsigned long ps = 0;
  unsigned long tmp;
  static long size = (~(1 << (sizeof(long) * 8 - 1)));
  if (ps == 0)
    ps = (long)getpagesize();
  if (pages > ((~(1 << (sizeof(long) * 8 - 1))) / ps)) {
    tmp = pages / 1024;
    size = tmp * ps;
  } else {
    tmp = pages * ps;
    size = tmp / 1024;
  }
  return size;
}


x86 assembly (clang, -O0):
<ptok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,0x2f14(%rip)
jne    113a <ptok+0x2a>
mov    $0x0,%al
call   1030 <getpagesize@plt>
cltq
mov    %rax,0x2efe(%rip)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %ecx,%ecx
mov    %ecx,%edx
divq   0x2eeb(%rip)
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jbe    1181 <ptok+0x71>
mov    -0x8(%rbp),%rax
shr    $0xa,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   0x2ec3(%rip),%rax
mov    %rax,0x2eac(%rip)
jmp    11a0 <ptok+0x90>
mov    -0x8(%rbp),%rax
imul   0x2eab(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0xa,%rax
mov    %rax,0x2e88(%rip)
mov    0x2e81(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptok>:
push   %rbx
mov    %rdi,%rbx
mov    0x2f15(%rip),%rax
test   %rax,%rax
jne    1130 <ptok+0x20>
xor    %eax,%eax
call   1030 <getpagesize@plt>
cltq
mov    %rax,0x2f00(%rip)
imul   %rbx,%rax
shr    $0xa,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ptok.ps = internal global i64 0
@ptok.size = internal global i64 2147483647
define i64 @ptok(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* @ptok.ps
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 (...) @getpagesize()
%8 = sext i32 %7 to i64
store i64 %8, i64* @ptok.ps
br label %9
9: ; preds = %6, %1
%10 = load i64, i64* %2
%11 = load i64, i64* @ptok.ps
%12 = udiv i64 poison, %11
%13 = icmp ugt i64 %10, %12
br i1 %13, label %14, label %20
14: ; preds = %9
%15 = load i64, i64* %2
%16 = udiv i64 %15, 1024
store i64 %16, i64* %3
%17 = load i64, i64* %3
%18 = load i64, i64* @ptok.ps
%19 = mul i64 %17, %18
store i64 %19, i64* @ptok.size
br label %26
20: ; preds = %9
%21 = load i64, i64* %2
%22 = load i64, i64* @ptok.ps
%23 = mul i64 %21, %22
store i64 %23, i64* %3
%24 = load i64, i64* %3
%25 = udiv i64 %24, 1024
store i64 %25, i64* @ptok.size
br label %26
26: ; preds = %20, %14
%27 = load i64, i64* @ptok.size
ret i64 %27
}

LLVM IR (-O2):
@ptok.ps = internal unnamed_addr global i64 0
define i64 @ptok(i64 %0) {
%2 = load i64, i64* @ptok.ps
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (...) @getpagesize()
%6 = sext i32 %5 to i64
store i64 %6, i64* @ptok.ps
br label %7
7: ; preds = %1, %4
%8 = phi i64 [ %2, %1 ], [ %6, %4 ]
%9 = mul i64 %8, %0
%10 = lshr i64 %9, 10
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ current_view();
scalar_t__ errno;
int /*<<< orphan*/ error_throw(int);
char *get_input(char *);
int /*<<< orphan*/ goto_line(int /*<<< orphan*/, int);
int strtol(char *, int /*<<< orphan*/, int);
void goto_action() {
  char *lno = get_input("l:");
  errno = 0;
  int a = strtol(lno, 0, 10);
  if (errno)
    error_throw(0x00000002 | 0x10000000);
  goto_line(current_view(), a);
}


x86 assembly (clang, -O0):
<goto_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1070 <get_input@plt>
mov    %rax,-0x8(%rbp)
mov    0x2e71(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e50(%rip),%rax
cmpq   $0x0,(%rax)
je     11a4 <goto_action+0x54>
mov    $0x10000002,%edi
call   1030 <error_throw@plt>
mov    $0x0,%al
call   1040 <current_view@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1060 <goto_line@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<goto_action>:
push   %r14
push   %rbx
push   %rax
lea    0xea5(%rip),%rdi
call   1070 <get_input@plt>
mov    0x2e79(%rip),%r14
movq   $0x0,(%r14)
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,%ebx
cmpq   $0x0,(%r14)
je     118f <goto_action+0x3f>
mov    $0x10000002,%edi
call   1030 <error_throw@plt>
xor    %eax,%eax
call   1040 <current_view@plt>
mov    %eax,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <goto_line@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"l:\00"
@errno = global i64 0
define void @goto_action() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @get_input(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %1
store i64 0, i64* @errno
%4 = load i8*, i8** %1
%5 = call i32 @strtol(i8* %4, i32 0, i32 10)
store i32 %5, i32* %2
%6 = load i64, i64* @errno
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @error_throw(i32 268435458)
br label %10
10: ; preds = %8, %0
%11 = call i32 (...) @current_view()
%12 = load i32, i32* %2
%13 = call i32 @goto_line(i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"l:\00"
@errno = global i64 0
define void @goto_action() {
%1 = tail call i8* @get_input(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i64 0, i64* @errno
%2 = tail call i32 @strtol(i8* %1, i32 0, i32 10)
%3 = load i64, i64* @errno
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @error_throw(i32 268435458)
br label %7
7: ; preds = %5, %0
%8 = tail call i32 (...) @current_view()
%9 = tail call i32 @goto_line(i32 %8, i32 %2)
ret void
}
/* Type definitions */
struct HashTable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hash_table_free_fun(struct HashTable *,
                                       int /*<<< orphan*/ *);
void hash_table_free(struct HashTable *table) {
  hash_table_free_fun(table, NULL);
}


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

x86 assembly (clang, -O2):
<hash_table_free>:
xor    %esi,%esi
jmp    1030 <hash_table_free_fun@plt>

LLVM IR (-O0):
%struct.HashTable = type { i32 }
define void @hash_table_free(%struct.HashTable* %0) {
%2 = alloca %struct.HashTable*
store %struct.HashTable* %0, %struct.HashTable** %2
%3 = load %struct.HashTable*, %struct.HashTable** %2
%4 = call i32 @hash_table_free_fun(%struct.HashTable* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.HashTable = type { i32 }
define void @hash_table_free(%struct.HashTable* %0) {
%2 = tail call i32 @hash_table_free_fun(%struct.HashTable* %0, i32* null)
ret void
}
void gdk_x11_xatom_to_atom_for_display() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_xatom_to_atom_for_display() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void w2h_file_close(int fd) {
  if (1 != fd || 2 != fd)
    return;
  close(fd);
}


x86 assembly (clang, -O0):
<w2h_file_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
cmp    -0x4(%rbp),%eax
jne    1137 <w2h_file_close+0x27>
mov    $0x2,%eax
cmp    -0x4(%rbp),%eax
je     113c <w2h_file_close+0x2c>
jmp    1144 <w2h_file_close+0x34>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @w2h_file_close(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ toupper(int);
void uninitvar_toupper(int character) {
  int c;
  (void)toupper(c);
  int *pc = &c;
  (void)toupper(*pc);
  (void)toupper(character);
  int *pChar = &character;
  (void)toupper(*pChar);
}


x86 assembly (clang, -O0):
<uninitvar_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @uninitvar_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32 %0, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @toupper(i32 %6)
store i32* %3, i32** %4
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = call i32 @toupper(i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @toupper(i32 %11)
store i32* %2, i32** %5
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = call i32 @toupper(i32 %14)
ret void
}

LLVM IR (-O2):
define void @uninitvar_toupper(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ shutdown_td_api();
void cs_api_exit() { shutdown_td_api(); }


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

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

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

LLVM IR (-O2):
define void @cs_api_exit() {
%1 = tail call i32 (...) @shutdown_td_api()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ strncmp(char *, char *, int);
void strncmp_less() {
  Assert_real((strncmp("equal", "notequal", 5) < 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/string/strncmp.c",
              20, ("Should be < 0"));
}


x86 assembly (clang, -O0):
<strncmp_less>:
push   %rbp
mov    %rsp,%rbp
lea    0xed8(%rip),%rdi
lea    0xece(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeba(%rip),%rsi
mov    $0x14,%edx
lea    0xf52(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_less>:
push   %rax
lea    0xedb(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
shr    $0x3f,%rax
lea    0xec5(%rip),%rsi
lea    0xf62(%rip),%rcx
mov    %eax,%edi
mov    $0x14,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"equal\00"
@.str.1 = [9 x i8] c"notequal\00"
@.str.2 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/string/strncmp.c\00"
@.str.3 = [14 x i8] c"Should be < 0\00"
define void @strncmp_less() {
%1 = call i64 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 5)
%2 = icmp slt i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.2, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"equal\00"
@.str.1 = [9 x i8] c"notequal\00"
@.str.2 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/string/strncmp.c\00"
@.str.3 = [14 x i8] c"Should be < 0\00"
define void @strncmp_less() {
%1 = tail call i64 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 5)
%2 = lshr i64 %1, 63
%3 = trunc i64 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.2, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret void
}