xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ reverse_transcribe(char *, char *, int);
int /*<<< orphan*/ simple_count_copys(int *, char *, int, int *, int);
void count_copys(int *flat, char *s, int n, int *reps) {
  char ss[256];
  simple_count_copys(flat, s, n, reps, 1);
  reverse_transcribe(s, ss, n);
  simple_count_copys(flat, ss, n, reps, 0);
}


x86 assembly (clang, -O0):
<count_copys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%r8d
call   1040 <simple_count_copys@plt>
mov    -0x10(%rbp),%rdi
lea    -0x120(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <reverse_transcribe@plt>
mov    -0x8(%rbp),%rdi
lea    -0x120(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1040 <simple_count_copys@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_copys>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x100,%rsp
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r15
mov    $0x1,%r8d
call   1040 <simple_count_copys@plt>
mov    %rsp,%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
call   1030 <reverse_transcribe@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
xor    %r8d,%r8d
call   1040 <simple_count_copys@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @count_copys(i32* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca [256 x i8]
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%10 = load i32*, i32** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = call i32 @simple_count_copys(i32* %10, i8* %11, i32 %12, i32* %13, i32 1)
%15 = load i8*, i8** %6
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%17 = load i32, i32* %7
%18 = call i32 @reverse_transcribe(i8* %15, i8* %16, i32 %17)
%19 = load i32*, i32** %5
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%21 = load i32, i32* %7
%22 = load i32*, i32** %8
%23 = call i32 @simple_count_copys(i32* %19, i8* %20, i32 %21, i32* %22, i32 0)
ret void
}

LLVM IR (-O2):
define void @count_copys(i32* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = tail call i32 @simple_count_copys(i32* %0, i8* %1, i32 %2, i32* %3, i32 1)
%8 = call i32 @reverse_transcribe(i8* %1, i8* %6, i32 %2)
%9 = call i32 @simple_count_copys(i32* %0, i8* %6, i32 %2, i32* %3, i32 0)
ret void
}
void hw_disable_movement_detect(void) { ; }


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

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

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

LLVM IR (-O2):
define void @hw_disable_movement_detect() {
ret void
}
int func1(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @func1() {
ret i32 42
}

LLVM IR (-O2):
define i32 @func1() {
ret i32 42
}
void foo119(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo119(i32 %0) {
ret void
}
int isascii7(const char *str) {
  char c;
  if (!str)
    return 1;
  while ((c = *str++)) {
    if (c & 0x80)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isascii7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <isascii7+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    116a <isascii7+0x6a>
jmp    1124 <isascii7+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1163 <isascii7+0x63>
movsbl -0x11(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     115e <isascii7+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    116a <isascii7+0x6a>
jmp    1124 <isascii7+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii7>:
mov    $0x1,%eax
test   %rdi,%rdi
je     1121 <isascii7+0x21>
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
test   %cl,%cl
je     1121 <isascii7+0x21>
add    $0x1,%rdi
test   %cl,%cl
jns    1110 <isascii7+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isascii7(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %7
%4 = phi i8* [ %8, %7 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp sgt i8 %5, -1
br i1 %9, label %3, label %10
10: ; preds = %3, %7, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
long b64url_ctrl(BIO *b, int cmd, long num, void *ptr) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @b64url_ctrl(i32* nocapture readnone %0, i32 %1, i64 %2, i8* nocapture readnone %3) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned int f5(unsigned int x, unsigned int y) {
  unsigned int r = x + y;
  if (r >= y)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     113a <f5+0x2a>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
push   %rbx
mov    %edi,%ebx
add    %esi,%ebx
jb     111e <f5+0xe>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f5(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = icmp ult i32 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int updateRepeatCount(int repeatCount, int symbolValue,
                      int previousSymbolValue) {
  if (symbolValue == previousSymbolValue) {
    ++repeatCount;
  } else {
    repeatCount = 1;
  }
  return repeatCount;
}


x86 assembly (clang, -O0):
<updateRepeatCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1127 <updateRepeatCount+0x27>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112e <updateRepeatCount+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateRepeatCount>:
lea    0x1(%rdi),%ecx
cmp    %edx,%esi
mov    $0x1,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @updateRepeatCount(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* %5
%8 = load i32, i32* %6
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %14
13: ; preds = %3
store i32 1, i32* %4
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
define i32 @updateRepeatCount(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
%5 = add nsw i32 %0, 1
%6 = select i1 %4, i32 %5, i32 1
ret i32 %6
}
const char *arith_vers_ID(void) { return "a"; }


x86 assembly (clang, -O0):
<arith_vers_ID>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arith_vers_ID>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define i8* @arith_vers_ID() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define i8* @arith_vers_ID() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
void APPS_ADC_SAR_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @APPS_ADC_SAR_SaveConfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RadioAlarmP__0__RadioAlarm__cancel(unsigned int);
void SoftwareAckLayerC__0__RadioAlarm__cancel(void) {
  RadioAlarmP__0__RadioAlarm__cancel(1U);
}


x86 assembly (clang, -O0):
<SoftwareAckLayerC__0__RadioAlarm__cancel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <RadioAlarmP__0__RadioAlarm__cancel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SoftwareAckLayerC__0__RadioAlarm__cancel>:
mov    $0x1,%edi
jmp    1030 <RadioAlarmP__0__RadioAlarm__cancel@plt>

LLVM IR (-O0):
define void @SoftwareAckLayerC__0__RadioAlarm__cancel() {
%1 = call i32 @RadioAlarmP__0__RadioAlarm__cancel(i32 1)
ret void
}

LLVM IR (-O2):
define void @SoftwareAckLayerC__0__RadioAlarm__cancel() {
%1 = tail call i32 @RadioAlarmP__0__RadioAlarm__cancel(i32 1)
ret void
}
/* Variables and functions */
scalar_t__ _nss_systemd_block(int);
int /*<<< orphan*/ assert_se(int);
void _nss_systemd_unblockp(bool *b) {
  if (*b)
    assert_se(_nss_systemd_block(false) >= 0);
}


x86 assembly (clang, -O0):
<_nss_systemd_unblockp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1151 <_nss_systemd_unblockp+0x31>
xor    %edi,%edi
call   1040 <_nss_systemd_block@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert_se@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_systemd_unblockp>:
push   %rax
cmpl   $0x0,(%rdi)
je     113c <_nss_systemd_unblockp+0x1c>
xor    %edi,%edi
call   1040 <_nss_systemd_block@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <assert_se@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @_nss_systemd_unblockp(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i64 @_nss_systemd_block(i32 0)
%6 = lshr i64 %5, 63
%7 = trunc i64 %6 to i32
%8 = xor i32 %7, 1
%9 = tail call i32 @assert_se(i32 %8)
br label %10
10: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print_buffer(char *buffer, int length) {
  int i = 0;
  for (i = 0; i < length; i++)
    printf("%c", buffer[i]);
}


x86 assembly (clang, -O0):
<print_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <print_buffer+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <print_buffer+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buffer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <print_buffer+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_buffer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print_buffer(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int uart_puts(uint32_t base_address, unsigned char *string) { return 0; }


x86 assembly (clang, -O0):
<uart_puts>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @uart_puts(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ errno;
int close(int fd) {
  (void)fd;
  errno = EBADF;
  return -1;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EBADF = global i32 0
@errno = global i32 0
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @EBADF
store i32 %4, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
define i32 @close(i32 %0) {
%2 = load i32, i32* @EBADF
store i32 %2, i32* @errno
ret i32 -1
}
void ScaleColsUp2_16_C() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ recvfrom(int, ...);
int /*<<< orphan*/ write(int, char *, int);
void TraitementSock(int sock) {
  char buf[256];
  int taillemessage;
  recvfrom(sock, &taillemessage, sizeof(taillemessage), 0,
           (struct sockaddr *)NULL, NULL);
  recvfrom(sock, buf, taillemessage, 0, (struct sockaddr *)NULL, NULL);
  write(1, buf, taillemessage);
}


x86 assembly (clang, -O0):
<TraitementSock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x114(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
mov    $0x0,%al
call   1040 <recvfrom@plt>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    -0x114(%rbp),%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
mov    $0x0,%al
call   1040 <recvfrom@plt>
lea    -0x110(%rbp),%rsi
mov    -0x114(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TraitementSock>:
push   %r14
push   %rbx
sub    $0x118,%rsp
mov    %edi,%ebx
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
call   1040 <recvfrom@plt>
mov    0xc(%rsp),%edx
lea    0x10(%rsp),%r14
mov    %ebx,%edi
mov    %r14,%rsi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
call   1040 <recvfrom@plt>
mov    0xc(%rsp),%edx
mov    $0x1,%edi
mov    %r14,%rsi
call   1030 <write@plt>
add    $0x118,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define void @TraitementSock(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i32, ...) @recvfrom(i32 %5, i32* %4, i64 4, i32 0, %struct.sockaddr* null, i8* null)
%7 = load i32, i32* %2
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 (i32, ...) @recvfrom(i32 %7, i8* %8, i32 %9, i32 0, %struct.sockaddr* null, i8* null)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%12 = load i32, i32* %4
%13 = call i32 @write(i32 1, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define void @TraitementSock(i32 %0) {
%2 = alloca [256 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = bitcast i32* %3 to i8*
%6 = call i32 (i32, ...) @recvfrom(i32 %0, i32* %3, i64 4, i32 0, %struct.sockaddr* null, i8* null)
%7 = load i32, i32* %3
%8 = call i32 (i32, ...) @recvfrom(i32 %0, i8* %4, i32 %7, i32 0, %struct.sockaddr* null, i8* null)
%9 = load i32, i32* %3
%10 = call i32 @write(i32 1, i8* %4, i32 %9)
ret void
}
unsigned long b_ethernet_rx(void *mem, unsigned long iid) {
  unsigned long tlong;
  asm volatile("call *0x00100058" : "=c"(tlong) : "D"(mem), "d"(iid));
  return tlong;
}


x86 assembly (clang, -O0):
<b_ethernet_rx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
call   *0x100058
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_ethernet_rx>:
mov    %rsi,%rdx
call   *0x100058
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @b_ethernet_rx(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "call *0x00100058", "={cx},{di},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @b_ethernet_rx(i8* %0, i64 %1) {
%3 = tail call i64 asm sideeffect "call *0x00100058", "={cx},{di},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit_with(char *, int /*<<< orphan*/, int);
void usage(int status) {
  exit_with(
      "Usage: waitmax [-s SIGNUM] MAXTIME PROGRAM [ARGS...]\n"
      "\n"
      "Execute PROGRAM as a subprocess. If PROGRAM does not exit before "
      "MAXTIME\n"
      "seconds, it will be killed with SIGTERM or an alternative signal.\n"
      "\n"
      "   -s, --signal SIGNUM   kill with SIGNUM on timeout\n"
      "   -h, --help            this help\n"
      "   -V, --version         show version an exit\n",
      0, status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
xor    %esi,%esi
call   1030 <exit_with@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
xor    %esi,%esi
jmp    1030 <exit_with@plt>

LLVM IR (-O0):
@.str = [329 x i8] c"Usage: waitmax [-s SIGNUM] MAXTIME PROGRAM [ARGS...]\0A\0AExecute PROGRAM as a subprocess. If PROGRAM does not exit before MAXTIME\0Aseconds, it will be killed with SIGTERM or an alternative signal.\0A\0A -s, --signal SIGNUM kill with SIGNUM on timeout\0A -h, --help this help\0A -V, --version show version an exit\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit_with(i8* getelementptr inbounds ([329 x i8], [329 x i8]* @.str, i64 0, i64 0), i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [329 x i8] c"Usage: waitmax [-s SIGNUM] MAXTIME PROGRAM [ARGS...]\0A\0AExecute PROGRAM as a subprocess. If PROGRAM does not exit before MAXTIME\0Aseconds, it will be killed with SIGTERM or an alternative signal.\0A\0A -s, --signal SIGNUM kill with SIGNUM on timeout\0A -h, --help this help\0A -V, --version show version an exit\0A\00"
define void @usage(i32 %0) {
%2 = tail call i32 @exit_with(i8* getelementptr inbounds ([329 x i8], [329 x i8]* @.str, i64 0, i64 0), i32 0, i32 %0)
ret void
}
int main() {
  int x;
  x = 5555;
  x++;
  return x;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5555, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

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

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void cspace(FILE *out) { fputc(' ', out); }


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

x86 assembly (clang, -O2):
<cspace>:
mov    %rdi,%rsi
mov    $0x20,%edi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @cspace(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputc(i8 signext 32, i32* %3)
ret void
}

LLVM IR (-O2):
define void @cspace(i32* nocapture %0) {
%2 = tail call i32 @fputc(i8 signext 32, i32* %0)
ret void
}
void fd182(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  p02B:
    goto p02B;
    goto a;
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  a:;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd182>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd182+0x7>

x86 assembly (clang, -O2):
<fd182>:
jmp    1100 <fd182>

LLVM IR (-O0):
define void @fd182(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; preds = %32
br label %32
33: ; No predecessors!
%34 = load i32, i32* %2
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %36, %33
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd182(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
struct fshash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct fshash *);
void fshash_fini(struct fshash *htab) { free(htab); }


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

x86 assembly (clang, -O2):
<fshash_fini>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.fshash = type { i32 }
define void @fshash_fini(%struct.fshash* nocapture %0) {
%2 = tail call i32 @free(%struct.fshash* %0)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t SDL_Swap16(uint16_t x) { return ((x << 8) | (x >> 8)); }


x86 assembly (clang, -O0):
<SDL_Swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_Swap16>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @SDL_Swap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @SDL_Swap16(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *emalloc(size_t s) {
  void *p = malloc(s);
  if (p == NULL) {
    fprintf(stderr, "[emalloc] Failed to allocate memory.");
    exit(2);
  }
  return p;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <emalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <emalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"[emalloc] Failed to allocate memory.\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 2)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"[emalloc] Failed to allocate memory.\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 2)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int label_isend(const uint8_t *label) { return ((*label) == 0x00); }


x86 assembly (clang, -O0):
<label_isend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<label_isend>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @label_isend(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @label_isend(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
caseps() {}


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

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

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

LLVM IR (-O2):
define i32 @caseps() {
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int EXIT_SUCCESS;
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(scalar_t__ *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ time(int /*<<< orphan*/ *);
int main(void) {
  time_t cur;
  cur = time(NULL);
  printf("Seconds since the Epoch: %d\n", (unsigned int)cur);
  printf("%s\n", asctime(localtime(&cur)));
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
mov    %rax,%rsi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1070 <time@plt>
mov    %rax,(%rsp)
lea    0xe9d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rsp,%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1050 <asctime@plt>
mov    %rax,%rdi
call   1040 <puts@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Seconds since the Epoch: %d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 @time(i32* null)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @localtime(i64* %2)
%8 = call i8* @asctime(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@.str = [29 x i8] c"Seconds since the Epoch: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i64 @time(i32* null)
store i64 %3, i64* %1
%4 = trunc i64 %3 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @localtime(i64* %1)
%7 = call i8* @asctime(i32 %6)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
/* Variables and functions */
int PAPI_set_debug(int);
void PAPIF_SET_DEBUG(int *debug, int *check) {
  *check = PAPI_set_debug(*debug);
}


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

x86 assembly (clang, -O2):
<PAPIF_SET_DEBUG>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_set_debug@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PAPIF_SET_DEBUG(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_set_debug(i32 %3)
store i32 %4, i32* %1
ret void
}
int getParent(int i) { return i / 2; }


x86 assembly (clang, -O0):
<getParent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<getParent>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @getParent(i32 %0) {
%2 = sdiv i32 %0, 2
ret i32 %2
}
const double pi() { return 3.141592654; }


x86 assembly (clang, -O0):
<pi>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pi>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @pi() {
ret double 0x400921FB54524550
}

LLVM IR (-O2):
define double @pi() {
ret double 0x400921FB54524550
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ str_replace_first(char *, char *, char *);
int main(int argc, char **argv) {
  if (4 != argc) {
    printf("Nombre de param\212tres insuffisants");
    return 1;
  }
  str_replace_first(argv[1], argv[2], argv[3]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%eax
cmp    -0x8(%rbp),%eax
je     115c <main+0x3c>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1180 <main+0x60>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
call   1040 <str_replace_first@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x4,%edi
jne    113e <main+0x1e>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rax
mov    0x18(%rsi),%rdx
mov    %rax,%rsi
call   1040 <str_replace_first@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Nombre de param\8Atres insuffisants\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 4, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %21
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 3
%19 = load i8*, i8** %18
%20 = call i32 @str_replace_first(i8* %13, i8* %16, i8* %19)
store i32 0, i32* %3
br label %21
21: ; preds = %10, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [34 x i8] c"Nombre de param\8Atres insuffisants\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %14
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8*, i8** %1, i64 3
%12 = load i8*, i8** %11
%13 = tail call i32 @str_replace_first(i8* %8, i8* %10, i8* %12)
br label %14
14: ; preds = %6, %4
%15 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  while (1) {
    printf("sleeping...\n");
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

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

LLVM IR (-O2):
@str = [12 x i8] c"sleeping...\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
br label %1
}
void sys_pollmidiqueue(void) {}


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

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

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

LLVM IR (-O2):
define void @sys_pollmidiqueue() {
ret void
}
void emit_ordering_greater(struct processor_explicatory_state *process_state,
                           struct modern_stream *stream, void *stream_state,
                           struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_ordering_greater>:
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)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_ordering_greater(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_ordering_greater(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void do_stuff(int my_arg) {
  int my_local = my_arg + 2;
  int i;
  for (i = 0; i < my_local; ++i)
    printf("i = %d\n", i);
}


x86 assembly (clang, -O0):
<do_stuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1154 <do_stuff+0x44>
mov    -0xc(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <do_stuff+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_stuff>:
push   %rbp
push   %r14
push   %rbx
cmp    $0xffffffff,%edi
jl     1141 <do_stuff+0x31>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <do_stuff+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"i = %d\0A\00"
define void @do_stuff(i32 %0) {
%2 = icmp sgt i32 %0, -2
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = add i32 %0, 1
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw i32 %6, 1
%9 = icmp eq i32 %6, %4
br i1 %9, label %10, label %5
10: ; preds = %5, %1
ret void
}
int test_imm_53uint16_reg(unsigned short val) {
  return ((val) & (-0x53 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_53uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffad,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_53uint16_reg>:
test   $0xffad,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_53uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -83
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Check_forallowchange();
int /*<<< orphan*/ Check_fordenychange();
void Check_forchange(int signal) {
  Check_fordenychange();
  Check_forallowchange();
}


x86 assembly (clang, -O0):
<Check_forchange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Check_fordenychange@plt>
mov    $0x0,%al
call   1040 <Check_forallowchange@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Check_forchange(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Check_fordenychange()
%4 = call i32 (...) @Check_forallowchange()
ret void
}

LLVM IR (-O2):
define void @Check_forchange(i32 %0) {
%2 = tail call i32 (...) @Check_fordenychange()
%3 = tail call i32 (...) @Check_forallowchange()
ret void
}
void cpuID(unsigned i, unsigned j, unsigned regs[4]) {
  asm volatile("cpuid"
               : "=a"(regs[0]), "=b"(regs[1]), "=c"(regs[2]), "=d"(regs[3])
               : "a"(i), "c"(j));
}


x86 assembly (clang, -O0):
<cpuID>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
cpuid
mov    %eax,%r9d
mov    -0x28(%rbp),%rax
mov    %ecx,%esi
mov    -0x20(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,0x4(%rdi)
mov    %esi,0x8(%rcx)
mov    %edx,0xc(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuID>:
push   %rbx
mov    %rdx,%r8
mov    %esi,%ecx
mov    %edi,%eax
cpuid
mov    %eax,(%r8)
mov    %ebx,0x4(%r8)
mov    %ecx,0x8(%r8)
mov    %edx,0xc(%r8)
pop    %rbx
ret

LLVM IR (-O0):
define void @cpuID(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** %6
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32*, i32** %6
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32*, i32** %6
%14 = getelementptr inbounds i32, i32* %13, i64 3
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %15, i32 %16)
%18 = extractvalue { i32, i32, i32, i32 } %17, 0
%19 = extractvalue { i32, i32, i32, i32 } %17, 1
%20 = extractvalue { i32, i32, i32, i32 } %17, 2
%21 = extractvalue { i32, i32, i32, i32 } %17, 3
store i32 %18, i32* %8
store i32 %19, i32* %10
store i32 %20, i32* %12
store i32 %21, i32* %14
ret void
}

LLVM IR (-O2):
define void @cpuID(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = getelementptr inbounds i32, i32* %2, i64 1
%5 = getelementptr inbounds i32, i32* %2, i64 2
%6 = getelementptr inbounds i32, i32* %2, i64 3
%7 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
%8 = extractvalue { i32, i32, i32, i32 } %7, 0
%9 = extractvalue { i32, i32, i32, i32 } %7, 1
%10 = extractvalue { i32, i32, i32, i32 } %7, 2
%11 = extractvalue { i32, i32, i32, i32 } %7, 3
store i32 %8, i32* %2
store i32 %9, i32* %4
store i32 %10, i32* %5
store i32 %11, i32* %6
ret void
}