xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ pow(int, int);
bool isPowerOfThree3(int n) { return n > 0 && (int)pow(3, 19) % n == 0; }


x86 assembly (clang, -O0):
<isPowerOfThree3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1146 <isPowerOfThree3+0x36>
mov    $0x3,%edi
mov    $0x13,%esi
call   1030 <pow@plt>
cltd
idivl  -0x4(%rbp)
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfThree3>:
test   %edi,%edi
jle    1132 <isPowerOfThree3+0x22>
push   %rbx
mov    %edi,%ebx
mov    $0x3,%edi
mov    $0x13,%esi
call   1030 <pow@plt>
cltd
idiv   %ebx
xor    %eax,%eax
test   %edx,%edx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPowerOfThree3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = call i64 @pow(i32 3, i32 19)
%7 = trunc i64 %6 to i32
%8 = load i32, i32* %2
%9 = srem i32 %7, %8
%10 = icmp eq i32 %9, 0
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ false, %1 ], [ %10, %5 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isPowerOfThree3(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = tail call i64 @pow(i32 3, i32 19)
%5 = trunc i64 %4 to i32
%6 = srem i32 %5, %0
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %10
}
/* Variables and functions */
int char_to_r40(char);
int r40_valid_char(char ch, int allow_lowercase) {
  if (char_to_r40(ch) != -1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<r40_valid_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %esi,-0xc(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <char_to_r40@plt>
cmp    $0xffffffff,%eax
je     113f <r40_valid_char+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <r40_valid_char+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r40_valid_char>:
push   %rax
call   1030 <char_to_r40@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @r40_valid_char(i8 signext %0, i32 %1) {
%3 = tail call i32 @char_to_r40(i8 signext %0)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int islandPerimeter(int **, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int island[4][4] = {{0, 1, 0, 0}, {1, 1, 1, 0}, {0, 1, 0, 0}, {1, 1, 0, 0}};
  int p = islandPerimeter((int **)island, 4, 4);
  printf("%d\n", p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x4,%edx
mov    %edx,%esi
call   1050 <islandPerimeter@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
call   1040 <islandPerimeter@plt>
lea    0xed4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

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

LLVM IR (-O2):
@__const.main.island = [4 x [4 x i32]] [[4 x i32] [i32 0, i32 1, i32 0, i32 0], [4 x i32] [i32 1, i32 1, i32 1, i32 0], [4 x i32] [i32 0, i32 1, i32 0, i32 0], [4 x i32] [i32 1, i32 1, i32 0, i32 0]]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x [4 x i32]]
%2 = bitcast [4 x [4 x i32]]* %1 to i8*
%3 = bitcast [4 x [4 x i32]]* %1 to i32**
%4 = call i32 @islandPerimeter(i32** %3, i32 4, i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VIM_USER_FreeMemory(void *);
void Avi_Free(void *mem) { VIM_USER_FreeMemory(mem); }


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

x86 assembly (clang, -O2):
<Avi_Free>:
jmp    1030 <VIM_USER_FreeMemory@plt>

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

LLVM IR (-O2):
define void @Avi_Free(i8* %0) {
%2 = tail call i32 @VIM_USER_FreeMemory(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int *p = NULL;
  printf("%d\n", *p);
  exit(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)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\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
store i32* null, i32** %6
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int genwqe_card_close(void *);
int card_close(void *card_data) { return genwqe_card_close(card_data); }


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

x86 assembly (clang, -O2):
<card_close>:
jmp    1030 <genwqe_card_close@plt>

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

LLVM IR (-O2):
define i32 @card_close(i8* %0) {
%2 = tail call i32 @genwqe_card_close(i8* %0)
ret i32 %2
}
/* Variables and functions */
int firstBadVersion(int);
int /*<<< orphan*/ printf(char *, int);
void test(int n) {
  int i = firstBadVersion(n);
  printf("First: %d", i);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <firstBadVersion@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
call   1040 <firstBadVersion@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"First: %d\00"
define void @test(i32 %0) {
%2 = tail call i32 @firstBadVersion(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int x26_process_request(struct mypacket *packet) { return 0; }


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

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

LLVM IR (-O0):
%struct.mypacket = type opaque
define i32 @x26_process_request(%struct.mypacket* %0) {
%2 = alloca %struct.mypacket*
store %struct.mypacket* %0, %struct.mypacket** %2
ret i32 0
}

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x26_process_request(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
unsigned int numdb_hash(struct dbt *table, void *a) { return (unsigned int)a; }


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

x86 assembly (clang, -O2):
<numdb_hash>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
%struct.dbt = type opaque
define i32 @numdb_hash(%struct.dbt* %0, i8* %1) {
%3 = alloca %struct.dbt*
%4 = alloca i8*
store %struct.dbt* %0, %struct.dbt** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = ptrtoint i8* %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.dbt = type opaque
define i32 @numdb_hash(%struct.dbt* nocapture readnone %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
ret i32 %4
}
void SERVO_PWM_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @SERVO_PWM_RestoreConfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int *ptr = a;
  int i;
  for (i = 0; i < 3; i++) {
    printf("%d ", *ptr);
    ptr += sizeof(int);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x3,-0x3c(%rbp)
jge    1189 <main+0x69>
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x38(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1153 <main+0x33>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(double);
int main(void) {
  f(2.0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(double 2.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(double 2.000000e+00)
ret i32 0
}
/* Variables and functions */
char *ft_uitobase(unsigned long long, unsigned int, unsigned int);
char *ft_itobase(long long int n, unsigned int base, unsigned int pad) {
  return (ft_uitobase((unsigned long long int)n, base, pad));
}


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

x86 assembly (clang, -O2):
<ft_itobase>:
jmp    1030 <ft_uitobase@plt>

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

LLVM IR (-O2):
define i8* @ft_itobase(i64 %0, i32 %1, i32 %2) {
%4 = tail call i8* @ft_uitobase(i64 %0, i32 %1, i32 %2)
ret i8* %4
}
int util_fini() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @util_fini() {
ret i32 0
}
int general_store(element)
int element;
{
  switch (element) {
  case 25:
  case 30:
  case 32:
  case 80:
  case 77:
  case 15:
  case 13:
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<general_store>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffff3,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x43,%eax
ja     113c <general_store+0x3c>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1143 <general_store+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<general_store>:
add    $0xfffffff3,%edi
cmp    $0x43,%edi
ja     111e <general_store+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @general_store(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 25, label %5
i32 30, label %5
i32 32, label %5
i32 80, label %5
i32 77, label %5
i32 15, label %5
i32 13, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @general_store(i32 %0) {
switch i32 %0, label %2 [
i32 25, label %3
i32 30, label %3
i32 32, label %3
i32 80, label %3
i32 77, label %3
i32 15, label %3
i32 13, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
char *strchr(char const *, char const);
int main(void) {
  const char p[] = "hello";
  char *q = strchr(p, p[0]);
  q[0] = 'x';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rdi
movsbl -0xa(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x78,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x6f,0x4(%rsp)
movl   $0x6c6c6568,(%rsp)
mov    %rsp,%rdi
mov    $0x68,%esi
call   1030 <strchr@plt>
movb   $0x78,(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.p = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = load i8, i8* %6
%8 = call i8* @strchr(i8* %5, i8 signext %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 120, i8* %10
ret i32 0
}

LLVM IR (-O2):
@__const.main.p = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i8* @strchr(i8* %2, i8 signext 104)
store i8 120, i8* %3
ret i32 0
}
/* Variables and functions */
int rand();
int d6() { return (rand() % 6) + 1; }


x86 assembly (clang, -O0):
<d6>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d6>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @d6() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @d6() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ BaroAltitudeHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void BaroAltitudeUpdated() { UAVObjUpdated(BaroAltitudeHandle()); }


x86 assembly (clang, -O0):
<BaroAltitudeUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <BaroAltitudeHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BaroAltitudeUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <BaroAltitudeHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @BaroAltitudeUpdated() {
%1 = call i32 (...) @BaroAltitudeHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @BaroAltitudeUpdated() {
%1 = tail call i32 (...) @BaroAltitudeHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
float acos_f(float x) {
  return ((-0.69813170079773212f * x * x - 0.87266462599716477f) * x +
          1.5707963267948966f);
}


x86 assembly (clang, -O0):
<acos_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef7(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xedd(%rip),%xmm1
addss  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xec4(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<acos_f>:
movss  0xef8(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
addss  0xeec(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @acos_f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 0xBFE6571840000000, %3
%5 = load float, float* %2
%6 = call float @llvm.fmuladd.f32(float %4, float %5, float 0xBFEBECDE60000000)
%7 = load float, float* %2
%8 = call float @llvm.fmuladd.f32(float %6, float %7, float 0x3FF921FB60000000)
ret float %8
}

LLVM IR (-O2):
define float @acos_f(float %0) {
%2 = fmul float %0, 0xBFE6571840000000
%3 = tail call float @llvm.fmuladd.f32(float %2, float %0, float 0xBFEBECDE60000000)
%4 = tail call float @llvm.fmuladd.f32(float %3, float %0, float 0x3FF921FB60000000)
ret float %4
}
float f2(__attribute__((vector_size(16))) float a, int b) { return a[b]; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movaps %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x3,%eax
movss  -0x10(%rbp,%rax,4),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movaps %xmm0,-0x18(%rsp)
and    $0x3,%edi
movss  -0x18(%rsp,%rdi,4),%xmm0
ret

LLVM IR (-O0):
define float @f2(<4 x float> %0, i32 %1) {
%3 = alloca <4 x float>
%4 = alloca i32
store <4 x float> %0, <4 x float>* %3
store i32 %1, i32* %4
%5 = load <4 x float>, <4 x float>* %3
%6 = load i32, i32* %4
%7 = extractelement <4 x float> %5, i32 %6
ret float %7
}

LLVM IR (-O2):
define float @f2(<4 x float> %0, i32 %1) {
%3 = extractelement <4 x float> %0, i32 %1
ret float %3
}
void cc_line_start(void) {}


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

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

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

LLVM IR (-O2):
define void @cc_line_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdout;
int posix_reader(char *str) {
  int number;
  printf("Digit the %s: ", str);
  fflush(stdout);
  scanf("%d", &number);
  return number;
}


x86 assembly (clang, -O0):
<posix_reader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xeae(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_reader>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xeba(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Digit the %s: \00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define i32 @posix_reader(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
ret i32 %8
}
unsigned long int __strspn_c2(const char *__s, signed int __accept1,
                              signed int __accept2) {
  unsigned long int __result = (unsigned long int)0;
  while ((_Bool)1) {
    if ((signed int)__s[(signed long int)__result] == __accept1)
      goto __CPROVER_DUMP_L2;
    if ((signed int)__s[(signed long int)__result] == __accept2)
      goto __CPROVER_DUMP_L2;
    goto __CPROVER_DUMP_L3;
  __CPROVER_DUMP_L2:;
    __result = __result + 1ul;
    __result;
  }
__CPROVER_DUMP_L3:;
  return __result;
}


x86 assembly (clang, -O0):
<__strspn_c2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    -0xc(%rbp),%eax
jne    1130 <__strspn_c2+0x30>
jmp    114f <__strspn_c2+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    -0x10(%rbp),%eax
jne    114a <__strspn_c2+0x4a>
jmp    114f <__strspn_c2+0x4f>
jmp    1160 <__strspn_c2+0x60>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <__strspn_c2+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__strspn_c2>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
cmp    %esi,%ecx
je     1110 <__strspn_c2+0x10>
cmp    %edx,%ecx
je     1110 <__strspn_c2+0x10>
ret

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

LLVM IR (-O2):
define i64 @__strspn_c2(i8* nocapture %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i64 [ 0, %3 ], [ %12, %4 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, %1
%10 = icmp eq i32 %8, %2
%11 = or i1 %9, %10
%12 = add i64 %5, 1
br i1 %11, label %4, label %13
13: ; preds = %4
ret i64 %5
}
int cmpint(const void *pa, const void *pb) {
  int *p1 = (int *)pa;
  int *p2 = (int *)pb;
  return *p1 - *p2;
}


x86 assembly (clang, -O0):
<cmpint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpint>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmpint(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmpint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
int fun_call_align_ll_1(long long a) {
  printf("a = %lld\n", a);
  return a;
}


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

x86 assembly (clang, -O2):
<fun_call_align_ll_1>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"a = %lld\0A\00"
define i32 @fun_call_align_ll_1(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %0)
%3 = trunc i64 %0 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ StabilizationSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void StabilizationSettingsUpdated() {
  UAVObjUpdated(StabilizationSettingsHandle());
}


x86 assembly (clang, -O0):
<StabilizationSettingsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <StabilizationSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StabilizationSettingsUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <StabilizationSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @StabilizationSettingsUpdated() {
%1 = call i32 (...) @StabilizationSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @StabilizationSettingsUpdated() {
%1 = tail call i32 (...) @StabilizationSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void __attribute__((weak)) tim10_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<tim10_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tim10_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.tim10_isr = [10 x i8] c"tim10_isr\00"
define weak void @tim10_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.tim10_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.tim10_isr = [10 x i8] c"tim10_isr\00"
define weak void @tim10_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.tim10_isr, i64 0, i64 0))
ret void
}
int my_strlen(const char *str) {
  int i;
  i = 0;
  while (str[i++])
    ;
  return (i);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1130 <my_strlen+0x30>
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %4 to i32
ret i32 %9
}
/* Variables and functions */
int atoi(char *);
int valid_interations(char *n) { return atoi(n); }


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

x86 assembly (clang, -O2):
<valid_interations>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @valid_interations(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
int get_condition_code_from_opcode(int instruction) {
  return (instruction & 0b00111000) >> 3;
}


x86 assembly (clang, -O0):
<get_condition_code_from_opcode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x38,%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_condition_code_from_opcode>:
mov    %edi,%eax
shr    $0x3,%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @get_condition_code_from_opcode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 56
%5 = ashr i32 %4, 3
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_condition_code_from_opcode(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 7
ret i32 %3
}
char *hexdec_shortdesc(void) { return "decode hexadecimal encoded data"; }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"decode hexadecimal encoded data\00"
define i8* @hexdec_shortdesc() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [32 x i8] c"decode hexadecimal encoded data\00"
define i8* @hexdec_shortdesc() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}
char test_72_0(char *mem) { return __atomic_nand_fetch(mem + 0, -1, 4); }


x86 assembly (clang, -O0):
<test_72_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0xff,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
and    %sil,%dl
mov    %dl,-0x1a(%rbp)
not    %dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114f <test_72_0+0x4f>
jmp    111f <test_72_0+0x1f>
mov    -0xc(%rbp),%cl
mov    -0x19(%rbp),%al
and    %cl,%al
xor    $0xff,%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_72_0>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %cl
lock cmpxchg %cl,(%rdi)
jne    1110 <test_72_0+0x10>
not    %al
ret

LLVM IR (-O0):
define signext i8 @test_72_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 -1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw nand i8* %6, i8 %7 acq_rel
%9 = and i8 %8, %7
%10 = xor i8 %9, -1
store i8 %10, i8* %4
%11 = load i8, i8* %4
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @test_72_0(i8* nocapture %0) {
%2 = atomicrmw nand i8* %0, i8 -1 acq_rel
%3 = xor i8 %2, -1
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdout;
void trace(const char *txt) {
  printf("%s", txt);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<trace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdout = global i32 0
define void @trace(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TwoFunction();
void SevenFunction() { TwoFunction(); }


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

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

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

LLVM IR (-O2):
define void @SevenFunction() {
%1 = tail call i32 (...) @TwoFunction()
ret void
}
/* Variables and functions */
double ceil(double);
double Double_ceil(double x) { return ceil(x); }


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

x86 assembly (clang, -O2):
<Double_ceil>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define double @Double_ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.ceil.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @Double_ceil(double %0) {
%2 = tail call double @llvm.ceil.f64(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ preprocess_file(int /*<<< orphan*/ *, char const *);
void preprocess(const char *target, const char *source) {
  FILE *ftarget = fopen(target, "w");
  preprocess_file(ftarget, source);
  fclose(ftarget);
}


x86 assembly (clang, -O0):
<preprocess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <preprocess_file@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preprocess>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <preprocess_file@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @preprocess(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i8*, i8** %4
%10 = call i32 @preprocess_file(i32* %8, i8* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fclose(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @preprocess(i8* nocapture %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @preprocess_file(i32* %3, i8* %1)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
char *gu_str_next(char const *);
const char *gu_str_table_row_get(const char *str, size_t n, char const *row[]) {
  size_t i;
  for (i = 0; i < n; ++i) {
    row[i] = str;
    str = gu_str_next(str);
  }
  return str;
}


x86 assembly (clang, -O0):
<gu_str_table_row_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1168 <gu_str_table_row_get+0x58>
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rdi
call   1030 <gu_str_next@plt>
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <gu_str_table_row_get+0x1c>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gu_str_table_row_get>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rax
test   %rsi,%rsi
je     1145 <gu_str_table_row_get+0x35>
mov    %rdx,%r14
mov    %rsi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,(%r14,%rbx,8)
mov    %rax,%rdi
call   1030 <gu_str_next@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <gu_str_table_row_get+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @gu_str_table_row_get(i8* %0, i64 %1, i8** nocapture writeonly %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = phi i8* [ %9, %5 ], [ %0, %3 ]
%8 = getelementptr inbounds i8*, i8** %2, i64 %6
store i8* %7, i8** %8
%9 = tail call i8* @gu_str_next(i8* %7)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %3
%13 = phi i8* [ %0, %3 ], [ %9, %5 ]
ret i8* %13
}
int tabshift(temp_int)
int temp_int;
{
  int leftover;
  leftover = ((temp_int + 1) % 8);
  if (leftover == 0)
    return (1);
  else
    return (9 - leftover);
}


x86 assembly (clang, -O0):
<tabshift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112e <tabshift+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1139 <tabshift+0x39>
mov    $0x9,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabshift>:
lea    0x1(%rdi),%eax
lea    0x8(%rdi),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
neg    %ecx
lea    (%rdi,%rcx,1),%eax
add    $0x1,%eax
mov    $0x9,%ecx
sub    %eax,%ecx
test   %eax,%eax
mov    $0x1,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @tabshift(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = srem i32 %2, 8
%4 = icmp eq i32 %3, 0
%5 = sub nsw i32 9, %3
%6 = select i1 %4, i32 1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SJC_ARM_DEBUG_DriverIRQHandler();
__attribute__((weak)) void SJC_ARM_DEBUG_IRQHandler(void) {
  SJC_ARM_DEBUG_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @SJC_ARM_DEBUG_IRQHandler() {
%1 = call i32 (...) @SJC_ARM_DEBUG_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @SJC_ARM_DEBUG_IRQHandler() {
%1 = tail call i32 (...) @SJC_ARM_DEBUG_DriverIRQHandler()
ret void
}
int f(int n) { return !n; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hello() {
  printf("hello, world\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world\0A\00"
define i32 @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"hello, world\00"
define i32 @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_LAZY;
int /*<<< orphan*/ dlopen(char *, int /*<<< orphan*/);
main() { dlopen("a", RTLD_LAZY); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <dlopen@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@RTLD_LAZY = global i32 0
define i32 @main() {
%1 = load i32, i32* @RTLD_LAZY
%2 = call i32 @dlopen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@RTLD_LAZY = global i32 0
define i32 @main() {
%1 = load i32, i32* @RTLD_LAZY
%2 = tail call i32 @dlopen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}