xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Free(void *);
void *Malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *realloc(void *, size_t);
void *Realloc(void *_Ptr, size_t _Block) {
  _Ptr = realloc(_Ptr, _Block);
  if (_Ptr == NULL) {
    void *_NewPtr = Malloc(_Block);
    memcpy(_NewPtr, _Ptr, _Block);
    Free(_Ptr);
    return _NewPtr;
  }
  return _Ptr;
}


x86 assembly (clang, -O0):
<Realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11a0 <Realloc+0x60>
mov    -0x18(%rbp),%rdi
call   1030 <Malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1060 <Free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11a8 <Realloc+0x68>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1050 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1173 <Realloc+0x33>
mov    %r14,%rdi
call   1030 <Malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memcpy@plt>
xor    %edi,%edi
call   1060 <Free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @Realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %22
12: ; preds = %2
%13 = load i64, i64* %5
%14 = call i8* @Malloc(i64 %13)
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = load i8*, i8** %4
%17 = load i64, i64* %5
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %4
%20 = call i32 @Free(i8* %19)
%21 = load i8*, i8** %6
store i8* %21, i8** %3
br label %24
22: ; preds = %2
%23 = load i8*, i8** %4
store i8* %23, i8** %3
br label %24
24: ; preds = %22, %12
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @Realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i8* @Malloc(i64 %1)
%7 = tail call i32 @memcpy(i8* %6, i8* null, i64 %1)
%8 = tail call i32 @Free(i8* null)
br label %9
9: ; preds = %2, %5
%10 = phi i8* [ %6, %5 ], [ %3, %2 ]
ret i8* %10
}
/* Type definitions */
struct peer {
  int dummy;
};

/* Variables and functions */
scalar_t__ PEER_PORT(struct peer *);
int peer_is_not_exist(struct peer *p) { return 0 == PEER_PORT(p); }


x86 assembly (clang, -O0):
<peer_is_not_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <PEER_PORT@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peer_is_not_exist>:
push   %rax
call   1030 <PEER_PORT@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.peer = type { i32 }
define i32 @peer_is_not_exist(%struct.peer* %0) {
%2 = alloca %struct.peer*
store %struct.peer* %0, %struct.peer** %2
%3 = load %struct.peer*, %struct.peer** %2
%4 = call i64 @PEER_PORT(%struct.peer* %3)
%5 = icmp eq i64 0, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.peer = type { i32 }
define i32 @peer_is_not_exist(%struct.peer* %0) {
%2 = tail call i64 @PEER_PORT(%struct.peer* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ hash_keccak(int, int /*<<< orphan*/ const *,
                               int /*<<< orphan*/, int, int /*<<< orphan*/ *,
                               int, int /*<<< orphan*/);
int hash_shake256(uint8_t *h, uint64_t l, const uint8_t *m, uint64_t n) {
  hash_keccak(17 * 8, m, n, 0x1f, h, 136, l);
  return 1;
}


x86 assembly (clang, -O0):
<hash_shake256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%r8
mov    -0xc(%rbp),%eax
mov    $0x88,%r9d
mov    $0x1f,%ecx
mov    %r9d,%edi
mov    %eax,(%rsp)
call   1030 <hash_keccak@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_shake256>:
push   %rax
mov    %rdi,%r8
mov    %esi,(%rsp)
mov    $0x88,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    $0x1f,%ecx
mov    $0x88,%r9d
call   1030 <hash_keccak@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hash_shake256(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %7
%10 = load i32, i32* %8
%11 = load i32*, i32** %5
%12 = load i32, i32* %6
%13 = call i32 @hash_keccak(i32 136, i32* %9, i32 %10, i32 31, i32* %11, i32 136, i32 %12)
ret i32 1
}

LLVM IR (-O2):
define i32 @hash_shake256(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @hash_keccak(i32 136, i32* %2, i32 %3, i32 31, i32* %0, i32 136, i32 %1)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
void foo(jmp_buf buf, int i) {
  printf("Inside foo: %d\n", i);
  longjmp(buf, i);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <longjmp@plt>

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <longjmp@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Inside foo: %d\0A\00"
define void @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @longjmp(i32 %7, i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"Inside foo: %d\0A\00"
define void @foo(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @longjmp(i32 %0, i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
int waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void traitement_signal(int sig) {
  printf("Signal %d reçu\n", sig);
  if (waitpid(-1, NULL, WNOHANG) == -1) {
    perror("waitpid");
  }
}


x86 assembly (clang, -O0):
<traitement_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <waitpid@plt>
cmp    $0xffffffff,%eax
jne    1176 <traitement_signal+0x46>
lea    0xea0(%rip),%rdi
call   1050 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traitement_signal>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <waitpid@plt>
cmp    $0xffffffff,%eax
je     115b <traitement_signal+0x2b>
pop    %rax
ret
lea    0xeaf(%rip),%rdi
pop    %rax
jmp    1050 <perror@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Signal %d re\C3\A7u\0A\00"
@WNOHANG = global i32 0
@.str.1 = [8 x i8] c"waitpid\00"
define void @traitement_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @WNOHANG
%6 = call i32 @waitpid(i32 -1, i32* null, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Signal %d re\C3\A7u\0A\00"
@WNOHANG = global i32 0
@.str.1 = [8 x i8] c"waitpid\00"
define void @traitement_signal(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @WNOHANG
%4 = tail call i32 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}
void UnusedISR(void) {
  while (1) {
    ;
  }
}


x86 assembly (clang, -O0):
<UnusedISR>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UnusedISR+0x9>
jmp    1109 <UnusedISR+0x9>

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

LLVM IR (-O0):
define void @UnusedISR() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @UnusedISR() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
double calka(double, double, double);
double calkaD(double a, double b, double delta) { return calka(a, b, delta); }


x86 assembly (clang, -O0):
<calkaD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <calka@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calkaD>:
jmp    1030 <calka@plt>

LLVM IR (-O0):
define double @calkaD(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @calka(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @calkaD(double %0, double %1, double %2) {
%4 = tail call double @calka(double %0, double %1, double %2)
ret double %4
}
/* Variables and functions */
bool is_even(int n) { return ((n & 1) == 0); }


x86 assembly (clang, -O0):
<is_even>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_even>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_even(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void cl(int *ip) { printf("%d\n", *ip); }


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

x86 assembly (clang, -O2):
<cl>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @cl(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int main() {
  int e = 55;
  int d = 44;
  int c = 33;
  int b = 22;
  int a = 11;
  int g;
  g = (29 / a) * ((29 / b) * ((29 / c) * ((29 / d) * (29 / e))));
  return g;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x37,-0x8(%rbp)
movl   $0x2c,-0xc(%rbp)
movl   $0x21,-0x10(%rbp)
movl   $0x16,-0x14(%rbp)
movl   $0xb,-0x18(%rbp)
mov    $0x1d,%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,-0x20(%rbp)
mov    $0x1d,%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,%ecx
mov    $0x1d,%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x24(%rbp)
mov    $0x1d,%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%esi
mov    $0x1d,%eax
cltd
idivl  -0x8(%rbp)
mov    -0x24(%rbp),%edx
mov    %eax,%edi
mov    -0x20(%rbp),%eax
imul   %edi,%esi
imul   %esi,%edx
imul   %edx,%ecx
imul   %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 55, i32* %2
store i32 44, i32* %3
store i32 33, i32* %4
store i32 22, i32* %5
store i32 11, i32* %6
%8 = load i32, i32* %6
%9 = sdiv i32 29, %8
%10 = load i32, i32* %5
%11 = sdiv i32 29, %10
%12 = load i32, i32* %4
%13 = sdiv i32 29, %12
%14 = load i32, i32* %3
%15 = sdiv i32 29, %14
%16 = load i32, i32* %2
%17 = sdiv i32 29, %16
%18 = mul nsw i32 %15, %17
%19 = mul nsw i32 %13, %18
%20 = mul nsw i32 %11, %19
%21 = mul nsw i32 %9, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
int setnonblocking(int fd) {
  int old_option = fcntl(fd, F_GETFL);
  int new_option = old_option | O_NONBLOCK;
  fcntl(fd, F_SETFL, new_option);
  return old_option;
}


x86 assembly (clang, -O0):
<setnonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ead(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setnonblocking>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    %eax,%ebp
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
or     %ebp,%edx
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @setnonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @F_GETFL
%7 = call i32 (i32, i32, ...) @fcntl(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* @O_NONBLOCK
%10 = or i32 %8, %9
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = load i32, i32* @F_SETFL
%13 = load i32, i32* %4
%14 = call i32 (i32, i32, ...) @fcntl(i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @setnonblocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = load i32, i32* @O_NONBLOCK
%5 = or i32 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %5)
ret i32 %3
}
void change_bit(int nr, volatile void *addr) {
  int mask;
  volatile unsigned int *a = addr;
  unsigned long flags;
  a += nr >> 5;
  mask = 1 << (nr & 0x1f);
  local_irq_save(flags);
  *a ^= mask;
  local_irq_restore(flags);
}


x86 assembly (clang, -O0):
<change_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x0,%al
call   1030 <local_irq_save@plt>
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
xor    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rdi
mov    $0x0,%al
call   1040 <local_irq_restore@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_bit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ecx
mov    %edi,%eax
sar    $0x5,%eax
movslq %eax,%rbx
mov    $0x1,%ebp
shl    %cl,%ebp
xor    %eax,%eax
call   1030 <local_irq_save@plt>
xor    %ebp,(%r14,%rbx,4)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <local_irq_restore@plt>

LLVM IR (-O0):
define void @change_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %6
%10 = load i32, i32* %3
%11 = ashr i32 %10, 5
%12 = load i32*, i32** %6
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i32, i32* %12, i64 %13
store i32* %14, i32** %6
%15 = load i32, i32* %3
%16 = and i32 %15, 31
%17 = shl i32 1, %16
store i32 %17, i32* %5
%18 = load i64, i64* %7
%19 = call i32 (i64, ...) bitcast (i32 (...)* @local_irq_save to i32 (i64, ...)*)(i64 %18)
%20 = load i32, i32* %5
%21 = load i32*, i32** %6
%22 = load volatile i32, i32* %21
%23 = xor i32 %22, %20
store volatile i32 %23, i32* %21
%24 = load i64, i64* %7
%25 = call i32 (i64, ...) bitcast (i32 (...)* @local_irq_restore to i32 (i64, ...)*)(i64 %24)
ret void
}

LLVM IR (-O2):
define void @change_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
%4 = ashr i32 %0, 5
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %3, i64 %5
%7 = and i32 %0, 31
%8 = shl nuw i32 1, %7
%9 = tail call i32 (i64, ...) bitcast (i32 (...)* @local_irq_save to i32 (i64, ...)*)(i64 undef)
%10 = load volatile i32, i32* %6
%11 = xor i32 %10, %8
store volatile i32 %11, i32* %6
%12 = tail call i32 (i64, ...) bitcast (i32 (...)* @local_irq_restore to i32 (i64, ...)*)(i64 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ afficherBonusNouveauLvlPersonnage();
int /*<<< orphan*/ ajouterBonusNouveauLvlPersonnage(int /*<<< orphan*/);
int /*<<< orphan*/ choisirBonusNouveauLvlPersonnage();
void bonusNouveauLvlPersonnage(void) {
  afficherBonusNouveauLvlPersonnage();
  ajouterBonusNouveauLvlPersonnage(choisirBonusNouveauLvlPersonnage());
}


x86 assembly (clang, -O0):
<bonusNouveauLvlPersonnage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <afficherBonusNouveauLvlPersonnage@plt>
mov    $0x0,%al
call   1030 <choisirBonusNouveauLvlPersonnage@plt>
mov    %eax,%edi
call   1050 <ajouterBonusNouveauLvlPersonnage@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bonusNouveauLvlPersonnage>:
push   %rax
xor    %eax,%eax
call   1040 <afficherBonusNouveauLvlPersonnage@plt>
xor    %eax,%eax
call   1030 <choisirBonusNouveauLvlPersonnage@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <ajouterBonusNouveauLvlPersonnage@plt>

LLVM IR (-O0):
define void @bonusNouveauLvlPersonnage() {
%1 = call i32 (...) @afficherBonusNouveauLvlPersonnage()
%2 = call i32 (...) @choisirBonusNouveauLvlPersonnage()
%3 = call i32 @ajouterBonusNouveauLvlPersonnage(i32 %2)
ret void
}

LLVM IR (-O2):
define void @bonusNouveauLvlPersonnage() {
%1 = tail call i32 (...) @afficherBonusNouveauLvlPersonnage()
%2 = tail call i32 (...) @choisirBonusNouveauLvlPersonnage()
%3 = tail call i32 @ajouterBonusNouveauLvlPersonnage(i32 %2)
ret void
}
void dq_version(int *major, int *minor) {
  *major = 2;
  *minor = 2;
}


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

x86 assembly (clang, -O2):
<dq_version>:
movl   $0x2,(%rdi)
movl   $0x2,(%rsi)
ret

LLVM IR (-O0):
define void @dq_version(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
store i32 2, i32* %5
%6 = load i32*, i32** %4
store i32 2, i32* %6
ret void
}

LLVM IR (-O2):
define void @dq_version(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 2, i32* %0
store i32 2, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int pipe(int *);
int xpipe(int filedes[2]) {
  int err = pipe(filedes);
  if (err) {
    perror("pipe() failed");
    exit(1);
  }
  return err;
}


x86 assembly (clang, -O0):
<xpipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pipe@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1168 <xpipe+0x38>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xpipe>:
push   %rax
call   1030 <pipe@plt>
test   %eax,%eax
jne    113e <xpipe+0xe>
xor    %eax,%eax
pop    %rcx
ret
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"pipe() failed\00"
define i32 @xpipe(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Starting Open Diagnostics.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Starting Open Diagnostics.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"Starting Open Diagnostics.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_3() {

#pragma GCC diagnostic ignored "-Wunused-variable"

  int x;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @test_3() {
%1 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @test_3() {
ret i32 0
}
/* Variables and functions */
int get_st1_prop();
int get_st3_prop();
int get_st2_value(void) { return get_st1_prop() + get_st3_prop(); }


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

x86 assembly (clang, -O2):
<get_st2_value>:
push   %rbx
xor    %eax,%eax
call   1040 <get_st1_prop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <get_st3_prop@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_st2_value() {
%1 = call i32 (...) @get_st1_prop()
%2 = call i32 (...) @get_st3_prop()
%3 = add nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_st2_value() {
%1 = tail call i32 (...) @get_st1_prop()
%2 = tail call i32 (...) @get_st3_prop()
%3 = add nsw i32 %2, %1
ret i32 %3
}
int rfact(sr)
register char *sr;
{
  int ret = 0;
  if (sr = strchr(sr, '*')) {
    ret = atoi(++sr);
  }
  return (ret <= 0 ? 1 : ret);
}


x86 assembly (clang, -O0):
<rfact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1165 <rfact+0x45>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <atoi@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     117c <rfact+0x5c>
mov    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1182 <rfact+0x62>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfact>:
push   %rax
mov    $0x2a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     114c <rfact+0x2c>
add    $0x1,%rax
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <atoi@plt>
mov    %eax,%ecx
test   %eax,%eax
mov    $0x1,%eax
cmovg  %ecx,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rfact(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i32 42)
store i8* %5, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %9)
store i32 %10, i32* %3
br label %11
11: ; preds = %7, %1
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
br label %17
15: ; preds = %11
%16 = load i32, i32* %3
br label %17
17: ; preds = %15, %14
%18 = phi i32 [ 1, %14 ], [ %16, %15 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @rfact(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 42)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %5)
%7 = icmp sgt i32 %6, 1
%8 = select i1 %7, i32 %6, i32 1
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %10
}
int ima35_rescale(int step, unsigned int code) {
  const int recon_levels[8] = {1, 3, 6, 10, 15, 21, 28, 36};
  int diff = step * recon_levels[code & 0x07] >> 3;
  if (code & 8)
    diff = -diff;
  return diff;
}


x86 assembly (clang, -O0):
<ima35_rescale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee9(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee6(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0x7,%ecx
mov    %ecx,%ecx
imul   -0x30(%rbp,%rcx,4),%eax
sar    $0x3,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1163 <ima35_rescale+0x63>
xor    %eax,%eax
sub    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ima35_rescale>:
mov    %esi,%eax
and    $0x7,%eax
lea    0xef4(%rip),%rcx
imul   (%rcx,%rax,4),%edi
sar    $0x3,%edi
mov    %edi,%eax
neg    %eax
test   $0x8,%sil
cmove  %edi,%eax
ret

LLVM IR (-O0):
@__const.ima35_rescale.recon_levels = [8 x i32] [i32 1, i32 3, i32 6, i32 10, i32 15, i32 21, i32 28, i32 36]
define i32 @ima35_rescale(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [8 x i32]
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = bitcast [8 x i32]* %5 to i8*
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = and i32 %9, 7
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = mul nsw i32 %8, %13
%15 = ashr i32 %14, 3
store i32 %15, i32* %6
%16 = load i32, i32* %4
%17 = and i32 %16, 8
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %2
%20 = load i32, i32* %6
%21 = sub nsw i32 0, %20
store i32 %21, i32* %6
br label %22
22: ; preds = %19, %2
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
@__const.ima35_rescale.recon_levels = [8 x i32] [i32 1, i32 3, i32 6, i32 10, i32 15, i32 21, i32 28, i32 36]
define i32 @ima35_rescale(i32 %0, i32 %1) {
%3 = and i32 %1, 7
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [8 x i32], [8 x i32]* @__const.ima35_rescale.recon_levels, i64 0, i64 %4
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, %0
%8 = ashr i32 %7, 3
%9 = and i32 %1, 8
%10 = icmp eq i32 %9, 0
%11 = sub nsw i32 0, %8
%12 = select i1 %10, i32 %8, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *doit(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  char *result = doit(0);
  if (*result == 'r' && result[1] == 'i')
    exit(0);
  abort();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <doit@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x72,%eax
jne    1172 <main+0x42>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x69,%eax
jne    1172 <main+0x42>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <doit@plt>
cmpb   $0x72,(%rax)
jne    114a <main+0x1a>
cmpb   $0x69,0x1(%rax)
jne    114a <main+0x1a>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @doit(i32 0)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 114
br i1 %7, label %8, label %16
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 105
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = call i32 @exit(i32 0)
unreachable
16: ; preds = %8, %0
%17 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @doit(i32 0)
%2 = load i8, i8* %1
%3 = icmp eq i8 %2, 114
br i1 %3, label %4, label %10
4: ; preds = %0
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 105
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %4, %0
%11 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int write(int, unsigned char *, int);
int smf_prog_change(int fd, char channel, char prog) {
  unsigned char data[3];
  data[0] = 0x00;
  data[1] = 0xC0 + channel;
  data[2] = prog;
  return write(fd, data, 3);
}


x86 assembly (clang, -O0):
<smf_prog_change>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movb   $0x0,-0x9(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xc0,%eax
mov    %al,-0x8(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smf_prog_change>:
push   %rax
movb   $0x0,0x5(%rsp)
add    $0xc0,%sil
mov    %sil,0x6(%rsp)
mov    %dl,0x7(%rsp)
lea    0x5(%rsp),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @smf_prog_change(i32 %0, i8 signext %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca [3 x i8]
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
store i8 0, i8* %8
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = add nsw i32 192, %10
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 1
store i8 %12, i8* %13
%14 = load i8, i8* %6
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 2
store i8 %14, i8* %15
%16 = load i32, i32* %4
%17 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%18 = call i32 @write(i32 %16, i8* %17, i32 3)
ret i32 %18
}

LLVM IR (-O2):
define i32 @smf_prog_change(i32 %0, i8 signext %1, i8 signext %2) {
%4 = alloca [3 x i8]
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
store i8 0, i8* %5
%6 = add i8 %1, -64
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 1
store i8 %6, i8* %7
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 2
store i8 %2, i8* %8
%9 = call i32 @write(i32 %0, i8* %5, i32 3)
ret i32 %9
}
int function3(void) {
  int a[5] = {1, 2, 3, 4, 5, [1] = 10};
  return a[1];
}


x86 assembly (clang, -O0):
<function3>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.function3.a = [5 x i32] [i32 1, i32 10, i32 3, i32 4, i32 5]
define i32 @function3() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @function3() {
ret i32 10
}
/* Type definitions */
struct catmc_atomic_int {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_int *);
void catmc_atomic_int_destroy(struct catmc_atomic_int *wrapper) {
  free(wrapper);
}


x86 assembly (clang, -O0):
<catmc_atomic_int_destroy>:
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):
<catmc_atomic_int_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.catmc_atomic_int = type { i32 }
define void @catmc_atomic_int_destroy(%struct.catmc_atomic_int* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_int* %0)
ret void
}
float percent60(int n) { return 0.6 * n; }


x86 assembly (clang, -O0):
<percent60>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeec(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<percent60>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @percent60(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double 6.000000e-01, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @percent60(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 6.000000e-01
%4 = fptrunc double %3 to float
ret float %4
}
void copyTask(void *taskDest[(3 + 1)], void *taskSrc[(3 + 1)]) {
  int i;
  for (i = 0; i < (3 + 1); i++)
    taskDest[i] = taskSrc[i];
}


x86 assembly (clang, -O0):
<copyTask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1143 <copyTask+0x43>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copyTask+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyTask>:
mov    (%rsi),%rax
mov    %rax,(%rdi)
mov    0x8(%rsi),%rax
mov    %rax,0x8(%rdi)
mov    0x10(%rsi),%rax
mov    %rax,0x10(%rdi)
mov    0x18(%rsi),%rax
mov    %rax,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @copyTask(i8** nocapture writeonly %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
store i8* %3, i8** %0
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8*, i8** %0, i64 1
store i8* %5, i8** %6
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %0, i64 2
store i8* %8, i8** %9
%10 = getelementptr inbounds i8*, i8** %1, i64 3
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %0, i64 3
store i8* %11, i8** %12
ret void
}
double __floatsidf(int i __attribute__((unused))) { return 0.0; }


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

x86 assembly (clang, -O2):
<__floatsidf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @__floatsidf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @__floatsidf(i32 %0) {
ret double 0.000000e+00
}
/* Variables and functions */
double asin(double);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  double param, result;
  param = 0.5;
  result = asin(param) * 180.0 / 3.14159265;
  printf("The arc sine of %f is %.3f degrees\n", param, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <asin@plt>
movsd  0xeba(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"The arc sine of %f is %.3f degrees\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 5.000000e-01, double* %2
%4 = load double, double* %2
%5 = call double @asin(double %4)
%6 = fmul double %5, 1.800000e+02
%7 = fdiv double %6, 0x400921FB53C8D4F1
store double %7, double* %3
%8 = load double, double* %2
%9 = load double, double* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double %8, double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"The arc sine of %f is %.3f degrees\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double 5.000000e-01, double 0x403E000000933B42)
ret i32 0
}
/* Variables and functions */
unsigned char VIM_HIF_GetReg8(int);
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_IPP_SetSizeBypassEnable(unsigned char bBypassbit) {
  unsigned char bTemp;
  bTemp = VIM_HIF_GetReg8((0x1c00 + 0x050));
  bTemp |= bBypassbit;
  VIM_HIF_SetReg8((0x1c00 + 0x050), bTemp);
}


x86 assembly (clang, -O0):
<VIM_IPP_SetSizeBypassEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1c50,%edi
call   1040 <VIM_HIF_GetReg8@plt>
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
mov    $0x1c50,%edi
movzbl -0x2(%rbp),%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_IPP_SetSizeBypassEnable>:
push   %rbx
mov    %edi,%ebx
mov    $0x1c50,%edi
call   1040 <VIM_HIF_GetReg8@plt>
or     %bl,%al
movzbl %al,%esi
mov    $0x1c50,%edi
pop    %rbx
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_IPP_SetSizeBypassEnable(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = call zeroext i8 @VIM_HIF_GetReg8(i32 7248)
store i8 %4, i8* %3
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = or i32 %8, %6
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i8, i8* %3
%12 = call i32 @VIM_HIF_SetReg8(i32 7248, i8 zeroext %11)
ret void
}

LLVM IR (-O2):
define void @VIM_IPP_SetSizeBypassEnable(i8 zeroext %0) {
%2 = tail call zeroext i8 @VIM_HIF_GetReg8(i32 7248)
%3 = or i8 %2, %0
%4 = tail call i32 @VIM_HIF_SetReg8(i32 7248, i8 zeroext %3)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void DESIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0xFFFF8030))) &=
      ~((ui32IntFlags & 0x00070000) >> 16);
  (*((volatile uint32_t *)(ui32Base + 0x00000040))) &=
      ~(ui32IntFlags & 0x0000ffff);
}


x86 assembly (clang, -O0):
<DESIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
and    $0x70000,%edx
sar    $0x10,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0xffff8030,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0xffff,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x40,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESIntDisable>:
mov    %esi,%eax
not    %eax
shr    $0x10,%esi
not    %esi
or     $0xfffffff8,%esi
lea    -0x7fd0(%rdi),%ecx
and    %esi,(%rcx)
or     $0xffff0000,%eax
movslq %edi,%rcx
and    %eax,0x40(%rcx)
ret

LLVM IR (-O0):
define void @DESIntDisable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 458752
%7 = ashr i32 %6, 16
%8 = xor i32 %7, -1
%9 = load i32, i32* %3
%10 = add i32 %9, -32720
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, %8
store volatile i32 %14, i32* %12
%15 = load i32, i32* %4
%16 = and i32 %15, 65535
%17 = xor i32 %16, -1
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 64
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
%22 = load volatile i32, i32* %21
%23 = and i32 %22, %17
store volatile i32 %23, i32* %21
ret void
}

LLVM IR (-O2):
define void @DESIntDisable(i32 %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 7
%5 = xor i32 %4, -1
%6 = add i32 %0, -32720
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, %5
store volatile i32 %10, i32* %8
%11 = and i32 %1, 65535
%12 = xor i32 %11, -1
%13 = add nsw i32 %0, 64
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = and i32 %16, %12
store volatile i32 %17, i32* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2cmaster_ClearARLoss(int);
void i2c1master_ClearARLoss(void) { i2cmaster_ClearARLoss(1); }


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

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

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

LLVM IR (-O2):
define void @i2c1master_ClearARLoss() {
%1 = tail call i32 @i2cmaster_ClearARLoss(i32 1)
ret void
}
void RTStrToInt16Full(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToInt16Full() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pw__data(int);
void pw_flush() { pw__data(-1); }


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

x86 assembly (clang, -O2):
<pw_flush>:
mov    $0xffffffff,%edi
jmp    1030 <pw__data@plt>

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

LLVM IR (-O2):
define void @pw_flush() {
%1 = tail call i32 @pw__data(i32 -1)
ret void
}
/* Variables and functions */
unsigned long _pcicfgread(int, int, int, int, int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
unsigned long mon_pcicfgread(int interface, int bus, int dev, int func,
                             int reg) {
  unsigned long retval;
  monLock();
  retval = _pcicfgread(interface, bus, dev, func, reg);
  monUnlock();
  return (retval);
}


x86 assembly (clang, -O0):
<mon_pcicfgread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1040 <_pcicfgread@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_pcicfgread>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1040 <_pcicfgread@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @mon_pcicfgread(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = call i32 (...) @monLock()
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = call i64 @_pcicfgread(i32 %13, i32 %14, i32 %15, i32 %16, i32 %17)
store i64 %18, i64* %11
%19 = call i32 (...) @monUnlock()
%20 = load i64, i64* %11
ret i64 %20
}

LLVM IR (-O2):
define i64 @mon_pcicfgread(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 (...) @monLock()
%7 = tail call i64 @_pcicfgread(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
%8 = tail call i32 (...) @monUnlock()
ret i64 %7
}