xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ memcpy(char *, char *, scalar_t__);
scalar_t__ strlen(char *);
char *str_dup(char *s) {
  char *ret = malloc(strlen(s) + 1);
  memcpy(ret, s, strlen(s) + 1);
  return ret;
}


x86 assembly (clang, -O0):
<str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @str_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 1
%13 = call i32 @memcpy(i8* %8, i8* %9, i64 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @str_dup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %3)
ret i8* %4
}
/* Type definitions */
struct pp_instance {
  int dummy;
};
struct pp_globals {
  int dummy;
};

/* Variables and functions */
struct pp_instance *INST(struct pp_globals *, int);
struct pp_instance *pp_sim_get_slave(struct pp_globals *ppg) {
  return INST(ppg, 1);
}


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

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

LLVM IR (-O0):
%struct.pp_instance = type { i32 }
%struct.pp_globals = type { i32 }
define %struct.pp_instance* @pp_sim_get_slave(%struct.pp_globals* %0) {
%2 = alloca %struct.pp_globals*
store %struct.pp_globals* %0, %struct.pp_globals** %2
%3 = load %struct.pp_globals*, %struct.pp_globals** %2
%4 = call %struct.pp_instance* @INST(%struct.pp_globals* %3, i32 1)
ret %struct.pp_instance* %4
}

LLVM IR (-O2):
%struct.pp_instance = type { i32 }
%struct.pp_globals = type { i32 }
define %struct.pp_instance* @pp_sim_get_slave(%struct.pp_globals* %0) {
%2 = tail call %struct.pp_instance* @INST(%struct.pp_globals* %0, i32 1)
ret %struct.pp_instance* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  scanf("%d", &x);
  printf("%d", 0x10);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 16)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int bar(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int foo(int /*<<< orphan*/);
int main() {
  if (foo(0) != 0x0000ffff)
    abort();
  if (bar(0) != 0xffff0000)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1050 <foo@plt>
cmp    $0xffff,%eax
je     1168 <main+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <bar@plt>
cmp    $0xffff0000,%eax
je     1181 <main+0x41>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <foo@plt>
cmp    $0xffff,%eax
jne    1164 <main+0x24>
xor    %edi,%edi
call   1040 <bar@plt>
cmp    $0xffff0000,%eax
jne    1164 <main+0x24>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 0)
%3 = icmp ne i32 %2, 65535
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @bar(i32 0)
%8 = icmp ne i32 %7, -65536
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = icmp eq i32 %1, 65535
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @bar(i32 0)
%7 = icmp eq i32 %6, -65536
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 @exit(i32 0)
unreachable
}
signed int PutChar(char *pStr, char c) {
  *pStr = c;
  return (1);
}


x86 assembly (clang, -O0):
<PutChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @PutChar(i8* nocapture writeonly %0, i8 signext %1) {
store i8 %1, i8* %0
ret i32 1
}
char *extractfilename(char *p) {
  char *ret = p;
  while (*p) {
    if (*p == '\\')
      ret = p + 1;
    ++p;
  }
  return ret;
}


x86 assembly (clang, -O0):
<extractfilename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <extractfilename+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1139 <extractfilename+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <extractfilename+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractfilename>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <extractfilename+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x5c,%dl
je     1110 <extractfilename+0x10>
test   %dl,%dl
jne    1113 <extractfilename+0x13>
ret

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

LLVM IR (-O2):
define i8* @extractfilename(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 92, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ RxD0Interrupt();
void USART1_IRQHandler(void) { RxD0Interrupt(); }


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

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

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

LLVM IR (-O2):
define void @USART1_IRQHandler() {
%1 = tail call i32 (...) @RxD0Interrupt()
ret void
}
/* Variables and functions */
scalar_t__ mc_double_value(char const *);
float mc_float_value(const char *value) {
  return (float)mc_double_value(value);
}


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

x86 assembly (clang, -O2):
<mc_float_value>:
push   %rax
call   1030 <mc_double_value@plt>
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mc_float_value(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mc_double_value(i8* %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @mc_float_value(i8* %0) {
%2 = tail call i64 @mc_double_value(i8* %0)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Variables and functions */
int ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr_fd(int fd, const char *s) {
  if (!s)
    write(fd, "(null)", 6);
  else
    write(fd, s, ft_strlen(s));
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <ft_putstr_fd+0x33>
mov    -0x4(%rbp),%edi
lea    0xebc(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
jmp    1178 <ft_putstr_fd+0x58>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
test   %rsi,%rsi
je     113e <ft_putstr_fd+0x1e>
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
jmp    114c <ft_putstr_fd+0x2c>
lea    0xebb(%rip),%rsi
mov    %ebp,%edi
mov    $0x6,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
define void @ft_putstr_fd(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
br label %9
6: ; preds = %2
%7 = tail call i32 @ft_strlen(i8* %1)
%8 = tail call i32 @write(i32 %0, i8* %1, i32 %7)
br label %9
9: ; preds = %6, %4
ret void
}
/* Variables and functions */
size_t RapidJson_growing_policy(size_t, size_t);
size_t calc_new_capacity(size_t capacity, size_t elem_size) {
  return RapidJson_growing_policy(capacity, elem_size);
}


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

x86 assembly (clang, -O2):
<calc_new_capacity>:
jmp    1030 <RapidJson_growing_policy@plt>

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

LLVM IR (-O2):
define i64 @calc_new_capacity(i64 %0, i64 %1) {
%3 = tail call i64 @RapidJson_growing_policy(i64 %0, i64 %1)
ret i64 %3
}
/* Type definitions */
struct rnet_message {
  int dummy;
};

/* Variables and functions */
int add_field(struct rnet_message **, char *, int /*<<< orphan*/, char *,
              size_t);
int /*<<< orphan*/ strlen(char *);
int rnet_message_add_buffer(struct rnet_message **msg, char *key, char *buffer,
                            size_t len) {
  return add_field(msg, key, strlen(key), buffer, len);
}


x86 assembly (clang, -O0):
<rnet_message_add_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <add_field@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnet_message_add_buffer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    %r15,%rcx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <add_field@plt>

LLVM IR (-O0):
%struct.rnet_message = type { i32 }
define i32 @rnet_message_add_buffer(%struct.rnet_message** %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca %struct.rnet_message**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store %struct.rnet_message** %0, %struct.rnet_message*** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load %struct.rnet_message**, %struct.rnet_message*** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %6
%12 = call i32 @strlen(i8* %11)
%13 = load i8*, i8** %7
%14 = load i64, i64* %8
%15 = call i32 @add_field(%struct.rnet_message** %9, i8* %10, i32 %12, i8* %13, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.rnet_message = type { i32 }
define i32 @rnet_message_add_buffer(%struct.rnet_message** %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @add_field(%struct.rnet_message** %0, i8* %1, i32 %5, i8* %2, i64 %3)
ret i32 %6
}
/* Variables and functions */
scalar_t__ FNM_NOMATCH;
scalar_t__ fnmatch(char const *, char *, int /*<<< orphan*/);
int do_test(void) {
  const char *pattern = "[[:alpha:]'[:alpha:]\0]";
  return fnmatch(pattern, "a", 0) != FNM_NOMATCH;
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xee9(%rip),%rsi
xor    %edx,%edx
call   1030 <fnmatch@plt>
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef8(%rip),%rsi
xor    %edx,%edx
call   1030 <fnmatch@plt>
mov    0x2ebb(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"[[:alpha:]'[:alpha:]\00]\00"
@.str.1 = [2 x i8] c"a\00"
@FNM_NOMATCH = global i64 0
define i32 @do_test() {
%1 = alloca i8*
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i64 @fnmatch(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 0)
%4 = load i64, i64* @FNM_NOMATCH
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [23 x i8] c"[[:alpha:]'[:alpha:]\00]\00"
@.str.1 = [2 x i8] c"a\00"
@FNM_NOMATCH = global i64 0
define i32 @do_test() {
%1 = tail call i64 @fnmatch(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 0)
%2 = load i64, i64* @FNM_NOMATCH
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct uwsgi_lock_item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ uwsgi_lock_ipcsem(struct uwsgi_lock_item *);
void uwsgi_rlock_ipcsem(struct uwsgi_lock_item *uli) { uwsgi_lock_ipcsem(uli); }


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

x86 assembly (clang, -O2):
<uwsgi_rlock_ipcsem>:
jmp    1030 <uwsgi_lock_ipcsem@plt>

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

LLVM IR (-O2):
%struct.uwsgi_lock_item = type { i32 }
define void @uwsgi_rlock_ipcsem(%struct.uwsgi_lock_item* %0) {
%2 = tail call i32 @uwsgi_lock_ipcsem(%struct.uwsgi_lock_item* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_delete_line();
int /*<<< orphan*/ lnbegin();
int delete_line(void) {
  lnbegin();
  do_delete_line();
}


x86 assembly (clang, -O0):
<delete_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <lnbegin@plt>
mov    $0x0,%al
call   1030 <do_delete_line@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_line>:
push   %rax
xor    %eax,%eax
call   1040 <lnbegin@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <do_delete_line@plt>

LLVM IR (-O0):
define i32 @delete_line() {
%1 = alloca i32
%2 = call i32 (...) @lnbegin()
%3 = call i32 (...) @do_delete_line()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @delete_line() {
%1 = tail call i32 (...) @lnbegin()
%2 = tail call i32 (...) @do_delete_line()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  int i = 0;
  int j = 100;
  while (i <= 100)
    printf("Number -> %d\n", i++);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %esi,%esi
lea    0xee4(%rip),%rbx
nopl   0x0(%rax)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %ebp,%esi
cmp    $0x65,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Number -> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 100, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %4
11: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Number -> %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = icmp eq i32 %3, 101
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int exists_character(char *, int);
int character_exists(char *buffer, int c) {
  return exists_character(buffer, c);
}


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

x86 assembly (clang, -O2):
<character_exists>:
jmp    1030 <exists_character@plt>

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

LLVM IR (-O2):
define i32 @character_exists(i8* %0, i32 %1) {
%3 = tail call i32 @exists_character(i8* %0, i32 %1)
ret i32 %3
}
void SSIDataGet(unsigned long ulBase, unsigned long *pulData) {
  ;
  while (!((*((volatile unsigned long *)(ulBase + 0x0000000C))) & 0x00000004)) {
  }
  *pulData = (*((volatile unsigned long *)(ulBase + 0x00000008)));
}


x86 assembly (clang, -O0):
<SSIDataGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rax
and    $0x4,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112e <SSIDataGet+0x2e>
jmp    1133 <SSIDataGet+0x33>
jmp    110c <SSIDataGet+0xc>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIDataGet>:
testq  $0x4,0xc(%rdi)
je     1100 <SSIDataGet>
mov    0x8(%rdi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @SSIDataGet(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
br label %5
5: ; preds = %13, %2
%6 = load i64, i64* %3
%7 = add i64 %6, 12
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 4
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
%15 = load i64, i64* %3
%16 = add i64 %15, 8
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = load i64*, i64** %4
store i64 %18, i64* %19
ret void
}

LLVM IR (-O2):
define void @SSIDataGet(i64 %0, i64* nocapture writeonly %1) {
%3 = add i64 %0, 12
%4 = inttoptr i64 %3 to i64*
br label %5
5: ; preds = %5, %2
%6 = load volatile i64, i64* %4
%7 = and i64 %6, 4
%8 = icmp eq i64 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
%10 = add i64 %0, 8
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
store i64 %12, i64* %1
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int y_root;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmotion_y_root(void *_p, int _v) {
  ((XEvent *)_p)->xmotion.y_root = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xmotion_y_root>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xmotion_y_root>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xmotion_y_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  unsigned long long tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t sr_utime(void) {
  struct timeval t;
  gettimeofday(&t, NULL);
  return t.tv_sec * 1000000ULL + t.tv_usec;
}


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

x86 assembly (clang, -O2):
<sr_utime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @sr_utime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = add i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @sr_utime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("I am going to exec an 'ls' program in current process\n");
  execl("fork2", "fork2", 0);
  printf("I execed 'ls' program\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf00(%rip),%rsi
xor    %edx,%edx
mov    %rsi,%rdi
call   1040 <execl@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1040 <execl@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"I am going to exec an 'ls' program in current process\0A\00"
@.str.1 = [6 x i8] c"fork2\00"
@.str.2 = [23 x i8] c"I execed 'ls' program\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @execl(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"fork2\00"
@str = [54 x i8] c"I am going to exec an 'ls' program in current process\00"
@str.3 = [22 x i8] c"I execed 'ls' program\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @execl(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void derefC(char *pc) {
  *pc = 'C';
  printf("%c\n", *pc);
}


x86 assembly (clang, -O0):
<derefC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x43,(%rax)
mov    -0x8(%rbp),%rax
lea    0xed2(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<derefC>:
movb   $0x43,(%rdi)
lea    0xee6(%rip),%rdi
mov    $0x43,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define void @derefC(i8* nocapture writeonly %0) {
store i8 67, i8* %0
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 67)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int posix_mem_offset(const void *restrict addr, size_t len,
                     off_t *restrict offset, size_t *restrict config_len,
                     int *restrict fildes) {
  return 0;
}


x86 assembly (clang, -O0):
<posix_mem_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @posix_mem_offset(i8* noalias %0, i64 %1, i32* noalias %2, i64* noalias %3, i32* noalias %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i64*
%10 = alloca i32*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i32* %2, i32** %8
store i64* %3, i64** %9
store i32* %4, i32** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @posix_mem_offset(i8* noalias nocapture readnone %0, i64 %1, i32* noalias nocapture readnone %2, i64* noalias nocapture readnone %3, i32* noalias nocapture readnone %4) {
ret i32 0
}
/* Variables and functions */
void *malloc(long);
void *G_MALLOC(long n) { return malloc(n); }


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

x86 assembly (clang, -O2):
<G_MALLOC>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @G_MALLOC(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
void *alloc(unsigned long);
int /*<<< orphan*/ byte_zero(void *, unsigned long);
void *alloc_zero(unsigned long size) {
  void *ptr = alloc(size);
  if (ptr)
    byte_zero(ptr, size);
  return ptr;
}


x86 assembly (clang, -O0):
<alloc_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1151 <alloc_zero+0x31>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <byte_zero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_zero>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113f <alloc_zero+0x1f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <byte_zero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @alloc_zero(i64 %0) {
%2 = tail call i8* @alloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @byte_zero(i8* %2, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int test_int() {
  int i;
  int reds[2] = {0};
#pragma acc parallel loop
  for (i = 0; i < 4096; i++) {
#pragma acc atomic
    reds[0]--;
#pragma acc atomic
    --reds[1];
  }
  for (i = 0; i < 2; i++) {
    if (reds[i] != -(4096)) {
      return i + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1000,-0x8(%rbp)
jge    115c <test_int+0x4c>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <test_int+0x1f>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11a0 <test_int+0x90>
movslq -0x8(%rbp),%rax
cmpl   $0xfffff000,-0x10(%rbp,%rax,4)
ff
je     118d <test_int+0x7d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11a7 <test_int+0x97>
jmp    1192 <test_int+0x82>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1163 <test_int+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_int() {
ret i32 0
}
/* Type definitions */
struct addrinfo {
  int /*<<< orphan*/ ai_protocol;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
};

/* Variables and functions */
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int get_socket(struct addrinfo *res) {
  int s = -1;
  if (res != NULL) {
    s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
  }
  return s;
}


x86 assembly (clang, -O0):
<get_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114a <get_socket+0x3a>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
call   1030 <socket@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_socket>:
test   %rdi,%rdi
je     1124 <get_socket+0x14>
mov    0x8(%rdi),%eax
mov    (%rdi),%edx
mov    0x4(%rdi),%esi
mov    %eax,%edi
jmp    1030 <socket@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32, i32 }
define i32 @get_socket(%struct.addrinfo* %0) {
%2 = icmp eq %struct.addrinfo* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %0, i64 0, i32 2
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %0, i64 0, i32 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %0, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i32 @socket(i32 %5, i32 %7, i32 %9)
br label %11
11: ; preds = %3, %1
%12 = phi i32 [ %10, %3 ], [ -1, %1 ]
ret i32 %12
}
void foo678() {}


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

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

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

LLVM IR (-O2):
define void @foo678() {
ret void
}
void init_guard_brd(int fV[((5 + 2) * (10 + 2))]) {
  int j;
  for (j = 0; j < ((5 + 2) * (10 + 2)); j++)
    fV[j] = 0;
}


x86 assembly (clang, -O0):
<init_guard_brd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x54,-0xc(%rbp)
jge    1136 <init_guard_brd+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init_guard_brd+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_guard_brd>:
push   %rax
mov    $0x150,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @init_guard_brd(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Copyright(void) {
  fprintf(
      stderr,
      "===================================================================\n"
      " TS 26.104                                                         \n"
      " REL-5 V5.4.0 2004-03                                              \n"
      " REL-6 V6.1.0 2004-03                                              \n"
      " 3GPP AMR Floating-point Speech Encoder                            \n"
      "===================================================================\n");
}


x86 assembly (clang, -O0):
<Copyright>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Copyright>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [409 x i8] c"===================================================================\0A TS 26.104 \0A REL-5 V5.4.0 2004-03 \0A REL-6 V6.1.0 2004-03 \0A 3GPP AMR Floating-point Speech Encoder \0A===================================================================\0A\00"
define void @Copyright() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([409 x i8], [409 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [409 x i8] c"===================================================================\0A TS 26.104 \0A REL-5 V5.4.0 2004-03 \0A REL-6 V6.1.0 2004-03 \0A 3GPP AMR Floating-point Speech Encoder \0A===================================================================\0A\00"
define void @Copyright() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([409 x i8], [409 x i8]* @.str, i64 0, i64 0))
ret void
}
void uart1_clear_rts() { (*((volatile unsigned long *)0xE0028004)) = 1 << 10; }


x86 assembly (clang, -O0):
<uart1_clear_rts>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0028004,%eax
movq   $0x400,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart1_clear_rts>:
mov    $0xe0028004,%eax
movq   $0x400,(%rax)
ret

LLVM IR (-O0):
define void @uart1_clear_rts() {
store volatile i64 1024, i64* inttoptr (i64 3758260228 to i64*)
ret void
}

LLVM IR (-O2):
define void @uart1_clear_rts() {
store volatile i64 1024, i64* inttoptr (i64 3758260228 to i64*)
ret void
}
int wnm_scan_process(struct wpa_supplicant *wpa_s, int reply_on_fail) {
  return 0;
}


x86 assembly (clang, -O0):
<wnm_scan_process>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
define i32 @wnm_scan_process(%struct.wpa_supplicant* %0, i32 %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca i32
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define i32 @wnm_scan_process(%struct.wpa_supplicant* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int ENOSYS;
int pthread_attr_setinheritsched(pthread_attr_t *attr, int sched) {
  return (ENOSYS);
}


x86 assembly (clang, -O0):
<pthread_attr_setinheritsched>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_attr_setinheritsched>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_attr_setinheritsched(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
ret i32 %3
}
void charset_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @charset_deinit() {
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c = EOF;
  printf("The value of 'EOF' is %d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [26 x i8] c"The value of 'EOF' is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @EOF
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [26 x i8] c"The value of 'EOF' is %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _irc_queue_insert(int, char *, char *, ...);
int join(char *chan, char *key) {
  if (key)
    _irc_queue_insert(5, "JOIN %s %s", chan, key);
  else
    _irc_queue_insert(5, "JOIN %s", chan);
  return 0;
}


x86 assembly (clang, -O0):
<join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114b <join+0x3b>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x5,%edi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <_irc_queue_insert@plt>
jmp    1162 <join+0x52>
mov    -0x8(%rbp),%rdx
mov    $0x5,%edi
lea    0xeb0(%rip),%rsi
mov    $0x0,%al
call   1030 <_irc_queue_insert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join>:
push   %rax
mov    %rdi,%rdx
test   %rsi,%rsi
je     1131 <join+0x21>
mov    %rsi,%rcx
lea    0xedd(%rip),%rsi
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <_irc_queue_insert@plt>
jmp    1144 <join+0x34>
lea    0xed3(%rip),%rsi
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <_irc_queue_insert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"JOIN %s %s\00"
@.str.1 = [8 x i8] c"JOIN %s\00"
define i32 @join(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (i32, i8*, i8*, ...) @_irc_queue_insert(i32 5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %8
6: ; preds = %2
%7 = tail call i32 (i32, i8*, i8*, ...) @_irc_queue_insert(i32 5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %4
ret i32 0
}
int p_wm_get() { return -142; }


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

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

LLVM IR (-O0):
define i32 @p_wm_get() {
ret i32 -142
}

LLVM IR (-O2):
define i32 @p_wm_get() {
ret i32 -142
}