xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
char *strcat(char *str, const char *cat) {
  str += strlen(str);
  do {
    *str++ = *cat;
  } while (*cat++);
  return str;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    1139 <strcat+0x29>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
cltq
add    %r14,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%ecx
mov    %cl,(%rax)
add    $0x1,%rax
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1130 <strcat+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
br label %6
6: ; preds = %6, %2
%7 = phi i8* [ %5, %2 ], [ %10, %6 ]
%8 = phi i8* [ %1, %2 ], [ %11, %6 ]
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %9, i8* %7
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  int vet[] = {4, 9, 1, 2};
  int i, *ptr;
  ptr = vet;
  for (i = 0; i < 4; i++) {
    printf("%d", *ptr++);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    1179 <main+0x69>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x30(%rbp)
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1144 <main+0x34>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 9)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
int execute_ppoll() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_ppoll() {
ret i32 0
}
producto(int a, int b) { return (a * b); }


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

x86 assembly (clang, -O2):
<producto>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @producto(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* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @producto(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("I can not haz argument.\n");
  } else {
    printf("I can haz argument: %s\n", argv[1]);
  }
  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)
cmpl   $0x2,-0x8(%rbp)
je     1143 <main+0x33>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1159 <main+0x49>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    113a <main+0x1a>
mov    0x8(%rsi),%rsi
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1146 <main+0x26>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"I can not haz argument.\0A\00"
@.str.1 = [24 x i8] c"I can haz argument: %s\0A\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 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"I can haz argument: %s\0A\00"
@str = [24 x i8] c"I can not haz argument.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6, %4
ret i32 0
}
/* Type definitions */
struct flock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ serialiseFLock(struct flock *);
int serverSendClient(int);
int serverSendLockClient(struct flock *request, int client) {
  serialiseFLock(request);
  return serverSendClient(client);
}


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

x86 assembly (clang, -O2):
<serverSendLockClient>:
push   %rbx
mov    %esi,%ebx
call   1030 <serialiseFLock@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <serverSendClient@plt>

LLVM IR (-O0):
%struct.flock = type { i32 }
define i32 @serverSendLockClient(%struct.flock* %0, i32 %1) {
%3 = alloca %struct.flock*
%4 = alloca i32
store %struct.flock* %0, %struct.flock** %3
store i32 %1, i32* %4
%5 = load %struct.flock*, %struct.flock** %3
%6 = call i32 @serialiseFLock(%struct.flock* %5)
%7 = load i32, i32* %4
%8 = call i32 @serverSendClient(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.flock = type { i32 }
define i32 @serverSendLockClient(%struct.flock* %0, i32 %1) {
%3 = tail call i32 @serialiseFLock(%struct.flock* %0)
%4 = tail call i32 @serverSendClient(i32 %1)
ret i32 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int *, int *);
int main(int argc, char **argv) {
  int a = 5;
  int c = 17;
  printf("a's address is %p, c's address is %p\n", &a, &c);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x11,-0x18(%rbp)
lea    0xec5(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <printf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
movl   $0x11,(%rsp)
lea    0xed9(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <printf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"a's address is %p, c's address is %p\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
store i32 17, i32* %7
%8 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@.str = [38 x i8] c"a's address is %p, c's address is %p\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 5, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 17, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
void G(float o) {}


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

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

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

LLVM IR (-O2):
define void @G(float %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ d2i_of_void;
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *PEM_ASN1_read(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *, void **,
                                  int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ PEM_STRING_X509_TRUSTED;
scalar_t__ d2i_X509_AUX;
X509 *PEM_read_X509_AUX(FILE *fp, X509 **x, pem_password_cb *cb, void *u) {
  return PEM_ASN1_read((d2i_of_void *)d2i_X509_AUX, PEM_STRING_X509_TRUSTED, fp,
                       (void **)x, cb, u);
}


x86 assembly (clang, -O0):
<PEM_read_X509_AUX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <PEM_ASN1_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_X509_AUX>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <PEM_ASN1_read@plt>

LLVM IR (-O0):
@d2i_X509_AUX = global i64 0
@PEM_STRING_X509_TRUSTED = global i32 0
define i32* @PEM_read_X509_AUX(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i64, i64* @d2i_X509_AUX
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* @PEM_STRING_X509_TRUSTED
%12 = load i32*, i32** %5
%13 = load i32**, i32*** %6
%14 = bitcast i32** %13 to i8**
%15 = load i32*, i32** %7
%16 = load i8*, i8** %8
%17 = call i32* @PEM_ASN1_read(i32* %10, i32 %11, i32* %12, i8** %14, i32* %15, i8* %16)
ret i32* %17
}

LLVM IR (-O2):
@d2i_X509_AUX = global i64 0
@PEM_STRING_X509_TRUSTED = global i32 0
define i32* @PEM_read_X509_AUX(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = load i64, i64* @d2i_X509_AUX
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_X509_TRUSTED
%8 = bitcast i32** %1 to i8**
%9 = tail call i32* @PEM_ASN1_read(i32* %6, i32 %7, i32* %0, i8** %8, i32* %2, i8* %3)
ret i32* %9
}
/* Type definitions */
struct stackLink {
  int dummy;
};

/* Variables and functions */
void initStack1(struct stackLink *s) { s = NULL; }


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

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

LLVM IR (-O0):
%struct.stackLink = type { i32 }
define void @initStack1(%struct.stackLink* %0) {
%2 = alloca %struct.stackLink*
store %struct.stackLink* %0, %struct.stackLink** %2
store %struct.stackLink* null, %struct.stackLink** %2
ret void
}

LLVM IR (-O2):
%struct.stackLink = type { i32 }
define void @initStack1(%struct.stackLink* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int i;
  scanf("%i", &i);
  printf("%i", i < 23 ? 0 : (i - 23) / 105 + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x17,-0x14(%rbp)
jge    115a <main+0x3a>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    116e <main+0x4e>
mov    -0x14(%rbp),%eax
sub    $0x17,%eax
mov    $0x69,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
xor    %esi,%esi
cmp    $0x17,%eax
jl     1159 <main+0x39>
add    $0xffffffe9,%eax
imul   $0x38138139,%rax,%rcx
shr    $0x20,%rcx
sub    %ecx,%eax
shr    %eax
add    %ecx,%eax
shr    $0x6,%eax
add    $0x1,%eax
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 23
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = add nsw i32 %6, -23
%10 = udiv i32 %9, 105
%11 = add nuw nsw i32 %10, 1
br label %12
12: ; preds = %2, %8
%13 = phi i32 [ %11, %8 ], [ 0, %2 ]
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ i;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  unsigned int i = 0;
  printf("%d\n", sizeof(i));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void copiar(FILE *tx, FILE *tx2) {
  char aux[3001];
  while (fgets(aux, 3001, tx) != NULL)
    fputs(aux, tx2);
}


x86 assembly (clang, -O0):
<copiar>:
push   %rbp
mov    %rsp,%rbp
sub    $0xbd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xbd0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0xbb9,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1167 <copiar+0x47>
lea    -0xbd0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fputs@plt>
jmp    1133 <copiar+0x13>
add    $0xbd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copiar>:
push   %r15
push   %r14
push   %rbx
sub    $0xbc0,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%rdi
mov    $0xbb9,%esi
mov    %r15,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     1170 <copiar+0x50>
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fputs@plt>
mov    %rbx,%rdi
mov    $0xbb9,%esi
mov    %r15,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
jne    1150 <copiar+0x30>
add    $0xbc0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @copiar(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [3001 x i8]
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %11, %2
%7 = getelementptr inbounds [3001 x i8], [3001 x i8]* %5, i64 0, i64 0
%8 = load i32*, i32** %3
%9 = call i32* @fgets(i8* %7, i32 3001, i32* %8)
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = getelementptr inbounds [3001 x i8], [3001 x i8]* %5, i64 0, i64 0
%13 = load i32*, i32** %4
%14 = call i32 @fputs(i8* %12, i32* %13)
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @copiar(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca [3001 x i8]
%4 = getelementptr inbounds [3001 x i8], [3001 x i8]* %3, i64 0, i64 0
%5 = call i32* @fgets(i8* %4, i32 3001, i32* %0)
%6 = icmp eq i32* %5, null
br i1 %6, label %11, label %7
7: ; preds = %2, %7
%8 = call i32 @fputs(i8* %4, i32* %1)
%9 = call i32* @fgets(i8* %4, i32 3001, i32* %0)
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %7
11: ; preds = %7, %2
ret void
}
/* Variables and functions */
int writemend();
int writemsg(int);
int writestring(char *);
int writemstr(int msg, char *p) {
  int x;
  x = writemsg(msg);
  if (x == (1))
    x = writestring(p);
  if (x == (1))
    x = writemend();
  return (x);
}


x86 assembly (clang, -O0):
<writemstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <writemsg@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1160 <writemstr+0x30>
mov    -0x10(%rbp),%rdi
call   1050 <writestring@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1174 <writemstr+0x44>
mov    $0x0,%al
call   1030 <writemend@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writemstr>:
push   %rbx
mov    %rsi,%rbx
call   1040 <writemsg@plt>
cmp    $0x1,%eax
jne    1153 <writemstr+0x23>
mov    %rbx,%rdi
call   1050 <writestring@plt>
cmp    $0x1,%eax
jne    1153 <writemstr+0x23>
xor    %eax,%eax
pop    %rbx
jmp    1030 <writemend@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @writemstr(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = call i32 @writemsg(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @writestring(i8* %11)
store i32 %12, i32* %5
br label %13
13: ; preds = %10, %2
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (...) @writemend()
store i32 %17, i32* %5
br label %18
18: ; preds = %16, %13
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @writemstr(i32 %0, i8* %1) {
%3 = tail call i32 @writemsg(i32 %0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @writestring(i8* %1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (...) @writemend()
br label %10
10: ; preds = %2, %8, %5
%11 = phi i32 [ %9, %8 ], [ %6, %5 ], [ %3, %2 ]
ret i32 %11
}
int isPrime(int num, int primes[], int primeCount) {
  int i;
  for (i = 0; i < primeCount; i++)
    if (num % primes[i] == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1158 <isPrime+0x58>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rsi
cltd
idivl  (%rcx,%rsi,4)
cmp    $0x0,%edx
jne    1145 <isPrime+0x45>
movl   $0x0,-0x4(%rbp)
jmp    115f <isPrime+0x5f>
jmp    114a <isPrime+0x4a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <isPrime+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
mov    $0x1,%r8d
test   %edx,%edx
jle    1134 <isPrime+0x34>
mov    %edi,%r9d
mov    %edx,%ecx
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r9d,%eax
cltd
idivl  (%rsi,%rdi,4)
test   %edx,%edx
je     1138 <isPrime+0x38>
add    $0x1,%rdi
cmp    %rdi,%rcx
jne    1120 <isPrime+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @isPrime(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%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 0, i32* %8
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load i32, i32* %5
%15 = load i32*, i32** %6
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = srem i32 %14, %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %13
store i32 0, i32* %4
br label %28
23: ; preds = %13
br label %24
24: ; preds = %23
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %9
27: ; preds = %9
store i32 1, i32* %4
br label %28
28: ; preds = %27, %22
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @isPrime(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %16
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %15, %6
br i1 %8, label %16, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %15, %7 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = srem i32 %0, %12
%14 = icmp eq i32 %13, 0
%15 = add nuw nsw i64 %10, 1
br i1 %14, label %16, label %7
16: ; preds = %9, %7, %3
%17 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %17
}
/* Variables and functions */
int printf(char *, int, int);
int test2(void) {
  struct A {
    unsigned char data;
  } a = {'c'};
  struct B {
    struct A a;
    int i;
  } b = {a, 42};
  struct C {
    struct B b;
  } c = {b};
  return printf("{{{%c}, %d}}\n", c.b.a.data, c.b.i);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee2(%rip),%al
mov    %al,-0x8(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0x10(%rbp)
movl   $0x2a,-0xc(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movzbl -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
lea    0xee9(%rip),%rdi
mov    $0x63,%esi
mov    $0x2a,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.A = type { i8 }
%struct.B = type { %struct.A, i32 }
%struct.C = type { %struct.B }
@__const.test2.a = %struct.A { i8 99 }
@.str = [14 x i8] c"{{{%c}, %d}}\0A\00"
define i32 @test2() {
%1 = alloca %struct.A
%2 = alloca %struct.B
%3 = alloca %struct.C
%4 = bitcast %struct.A* %1 to i8*
%5 = getelementptr inbounds %struct.B, %struct.B* %2, i32 0, i32 0
%6 = bitcast %struct.A* %5 to i8*
%7 = bitcast %struct.A* %1 to i8*
%8 = getelementptr inbounds %struct.B, %struct.B* %2, i32 0, i32 1
store i32 42, i32* %8
%9 = getelementptr inbounds %struct.C, %struct.C* %3, i32 0, i32 0
%10 = bitcast %struct.B* %9 to i8*
%11 = bitcast %struct.B* %2 to i8*
%12 = getelementptr inbounds %struct.C, %struct.C* %3, i32 0, i32 0
%13 = getelementptr inbounds %struct.B, %struct.B* %12, i32 0, i32 0
%14 = getelementptr inbounds %struct.A, %struct.A* %13, i32 0, i32 0
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = getelementptr inbounds %struct.C, %struct.C* %3, i32 0, i32 0
%18 = getelementptr inbounds %struct.B, %struct.B* %17, i32 0, i32 1
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
@.str = [14 x i8] c"{{{%c}, %d}}\0A\00"
define i32 @test2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 99, i32 42)
ret i32 %1
}
unsigned int u16from_buf(unsigned char *buf) {
  return (buf[0] | (buf[1] << 8));
}


x86 assembly (clang, -O0):
<u16from_buf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u16from_buf>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @u16from_buf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @u16from_buf(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
unsigned kol_btn_get() { asm volatile("int $0x40" ::"a"(17)); }


x86 assembly (clang, -O0):
<kol_btn_get>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%eax
int    $0x40
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_btn_get>:
mov    $0x11,%eax
int    $0x40
ret

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

LLVM IR (-O2):
define i32 @kol_btn_get() {
tail call void asm sideeffect "int $$0x40", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 17)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  printf("! DO NOT EDIT THIS FILE. \n");
  printf("! It is created from f90_unix_env_const.c\n");
  printf("integer, parameter :: dir_kind = %d\n", sizeof(DIR *));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"! DO NOT EDIT THIS FILE. \0A\00"
@.str.1 = [43 x i8] c"! It is created from f90_unix_env_const.c\0A\00"
@.str.2 = [37 x i8] c"integer, parameter :: dir_kind = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i64 8)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [37 x i8] c"integer, parameter :: dir_kind = %d\0A\00"
@str = [26 x i8] c"! DO NOT EDIT THIS FILE. \00"
@str.3 = [42 x i8] c"! It is created from f90_unix_env_const.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i64 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  int i;
  for (i = 1; i < argc; i++)
    puts(argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @puts(i8* dereferenceable(1) %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 i32 0
}
long des(const long *w, long len) {
  long acc = 0;
  for (; len > 1; len--, w++) {
    if (*w > *(w + 1))
      acc++;
  }
  return acc;
}


x86 assembly (clang, -O0):
<des>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
jle    1162 <des+0x62>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%rax
jle    1140 <des+0x40>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1145 <des+0x45>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <des+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<des>:
cmp    $0x2,%rsi
jl     1140 <des+0x40>
mov    (%rdi),%rcx
add    $0x1,%rsi
add    $0x8,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rdi),%r8
xor    %edx,%edx
cmp    %r8,%rcx
setg   %dl
add    %rdx,%rax
add    $0xffffffffffffffff,%rsi
add    $0x8,%rdi
mov    %r8,%rcx
cmp    $0x2,%rsi
ja     1120 <des+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @des(i64* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 1
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = load i64, i64* %0
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %12, %6 ], [ %5, %4 ]
%8 = phi i64 [ %15, %6 ], [ 0, %4 ]
%9 = phi i64 [ %16, %6 ], [ %1, %4 ]
%10 = phi i64* [ %11, %6 ], [ %0, %4 ]
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = icmp sgt i64 %7, %12
%14 = zext i1 %13 to i64
%15 = add nuw nsw i64 %8, %14
%16 = add nsw i64 %9, -1
%17 = icmp ugt i64 %9, 2
br i1 %17, label %6, label %18
18: ; preds = %6, %2
%19 = phi i64 [ 0, %2 ], [ %15, %6 ]
ret i64 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
unsigned long ftell(int /*<<< orphan*/ *);
unsigned long flength(FILE *in) {
  fseek(in, 0, SEEK_END);
  return ftell(in);
}


x86 assembly (clang, -O0):
<flength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flength>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ftell@plt>

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @flength(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_END
%5 = call i32 @fseek(i32* %3, i32 0, i32 %4)
%6 = load i32*, i32** %2
%7 = call i64 @ftell(i32* %6)
ret i64 %7
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @flength(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
ret i64 %4
}
void SetOpenMPMaximumThreads(const int threads) { (void)threads; }


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

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

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

LLVM IR (-O2):
define void @SetOpenMPMaximumThreads(i32 %0) {
ret void
}
unsigned char zigzagenc8(char x) { return x << 1 ^ x >> 7; }


x86 assembly (clang, -O0):
<zigzagenc8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
shl    $0x1,%eax
movsbl -0x1(%rbp),%ecx
sar    $0x7,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zigzagenc8>:
lea    (%rdi,%rdi,1),%eax
sar    $0x7,%dil
xor    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @zigzagenc8(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = shl i32 %4, 1
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = ashr i32 %7, 7
%9 = xor i32 %5, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @zigzagenc8(i8 signext %0) {
%2 = shl i8 %0, 1
%3 = ashr i8 %0, 7
%4 = xor i8 %2, %3
ret i8 %4
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int waitpid(int, int *, int /*<<< orphan*/);
void sig_child(int signo) {
  pid_t pid;
  int state;
  while ((pid = waitpid(-1, &state, WNOHANG)) > 0)
    printf("child pid[%d] terminated.\n", pid);
}


x86 assembly (clang, -O0):
<sig_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0xc(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1162 <sig_child+0x42>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <sig_child+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_child>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2eb8(%rip),%r15
mov    (%r15),%edx
lea    0xc(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
test   %eax,%eax
jle    117e <sig_child+0x5e>
lea    0xeb3(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1040 <waitpid@plt>
test   %eax,%eax
jg     1160 <sig_child+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [27 x i8] c"child pid[%d] terminated.\0A\00"
define void @sig_child(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %4, i32 %6)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [27 x i8] c"child pid[%d] terminated.\0A\00"
define void @sig_child(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %11, %7 ], [ %5, %1 ]
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @WNOHANG
%11 = call i32 @waitpid(i32 -1, i32* %2, i32 %10)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %7, label %13
13: ; preds = %7, %1
ret void
}
void cmd3(char *str, char c, int index) {
  if (index != 0)
    cmd3(str, *(str + (strlen(str)) - index), index - 1);
  *(str + index) = c;
}


x86 assembly (clang, -O0):
<cmd3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1180 <cmd3+0x60>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
movslq -0x10(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
mov    (%rax,%rcx,1),%al
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
movsbl %al,%esi
call   1040 <cmd3@plt>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd3>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
test   %edx,%edx
je     1156 <cmd3+0x36>
mov    %edx,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    %rbx,%rax
movslq %ebp,%r15
sub    %r15,%rax
movsbl (%rax),%esi
add    $0xffffffff,%ebp
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <cmd3@plt>
jmp    1159 <cmd3+0x39>
xor    %r15d,%r15d
mov    %r14b,(%rbx,%r15,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @cmd3(i8* nocapture %0, i8 signext %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = sext i32 %2 to i64
%9 = sub nsw i64 0, %8
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = add nsw i32 %2, -1
tail call void @cmd3(i8* %0, i8 signext %11, i32 %12)
br label %13
13: ; preds = %3, %5
%14 = phi i64 [ %8, %5 ], [ 0, %3 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 %1, i8* %15
ret void
}
int do_741() { return 741; }


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

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

LLVM IR (-O0):
define i32 @do_741() {
ret i32 741
}

LLVM IR (-O2):
define i32 @do_741() {
ret i32 741
}
int toi_usm_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @toi_usm_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void grace_output_grace_home_link(void) {
  printf("<br><p>For more information, visit the <a "
         "href=\"http://plasma-gate.weizmann.ac.il/Grace/\" target=_new>Grace "
         "Home Page.</a>");
}


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

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

LLVM IR (-O0):
@.str = [123 x i8] c"<br><p>For more information, visit the <a href=\22http://plasma-gate.weizmann.ac.il/Grace/\22 target=_new>Grace Home Page.</a>\00"
define void @grace_output_grace_home_link() {
%1 = call i32 @printf(i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [123 x i8] c"<br><p>For more information, visit the <a href=\22http://plasma-gate.weizmann.ac.il/Grace/\22 target=_new>Grace Home Page.</a>\00"
define void @grace_output_grace_home_link() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([123 x i8], [123 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_BAuint16_mem(unsigned short *val) {
  return ((*val) & (-0xBA << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BAuint16_mem>:
movzwl (%rdi),%eax
test   $0xff46,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BAuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -186
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
unsigned long long strtoull(char const *, char **, int);
unsigned long long strtoull_l(const char *nptr, char **endptr, int base,
                              locale_t loc) {
  return strtoull(nptr, endptr, base);
}


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

x86 assembly (clang, -O2):
<strtoull_l>:
jmp    1030 <strtoull@plt>

LLVM IR (-O0):
define i64 @strtoull_l(i8* %0, i8** %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8**, i8*** %6
%11 = load i32, i32* %7
%12 = call i64 @strtoull(i8* %9, i8** %10, i32 %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @strtoull_l(i8* %0, i8** nocapture %1, i32 %2, i32 %3) {
%5 = tail call i64 @strtoull(i8* %0, i8** %1, i32 %2)
ret i64 %5
}