xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *l9p_realloc(void *ptr, size_t newsize) {
  void *r = realloc(ptr, newsize);
  if (r == NULL) {
    fprintf(stderr, "cannot allocate %zd bytes: out of memory\n", newsize);
    abort();
  }
  return (r);
}


x86 assembly (clang, -O0):
<l9p_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117c <l9p_realloc+0x4c>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l9p_realloc>:
push   %rbx
mov    %rsi,%rbx
call   1050 <realloc@plt>
test   %rax,%rax
je     1140 <l9p_realloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"cannot allocate %zd bytes: out of memory\0A\00"
define i8* @l9p_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i64, i64* %4
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"cannot allocate %zd bytes: out of memory\0A\00"
define noalias i8* @l9p_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %1)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i8* %3
}
void avcodec_find_encoder() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_find_encoder() {
ret void
}
/* Variables and functions */
scalar_t__ is_prime_f(int);
int /*<<< orphan*/ printf(char *, int, char *);
void is_prime_p(int a) {
  printf("%d is %s prime\n", a, (is_prime_f(a) ? "\b" : "not"));
}


x86 assembly (clang, -O0):
<is_prime_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <is_prime_f@plt>
mov    -0x8(%rbp),%esi
mov    %rax,%rcx
lea    0xecc(%rip),%rdx
lea    0xec3(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime_p>:
push   %rbx
mov    %edi,%ebx
call   1040 <is_prime_f@plt>
test   %rax,%rax
lea    0xee0(%rip),%rax
lea    0xed7(%rip),%rdx
cmove  %rax,%rdx
lea    0xebc(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%d is %s prime\0A\00"
@.str.1 = [2 x i8] c"\08\00"
@.str.2 = [4 x i8] c"not\00"
define void @is_prime_p(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @is_prime_f(i32 %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d is %s prime\0A\00"
@.str.1 = [2 x i8] c"\08\00"
@.str.2 = [4 x i8] c"not\00"
define void @is_prime_p(i32 %0) {
%2 = tail call i64 @is_prime_f(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage:\n"
         "flockend path\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage:\0Aflockend path\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Usage:\0Aflockend path\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
long long acos(long long);
long long internal_acos_l(long long value) { return acos(value); }


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

x86 assembly (clang, -O2):
<internal_acos_l>:
jmp    1030 <acos@plt>

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

LLVM IR (-O2):
define i64 @internal_acos_l(i64 %0) {
%2 = tail call i64 @acos(i64 %0)
ret i64 %2
}
int f_ne_mr2(float *a1, float a2) { return !(((*a1) != (a2))); }


x86 assembly (clang, -O0):
<f_ne_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
ucomiss -0xc(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ne_mr2>:
cmpeqss (%rdi),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_ne_mr2(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp une float %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_ne_mr2(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp oeq float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void *xcalloc(size_t count, size_t eltsize) {
  void *p = calloc(count, eltsize);
  if (p == NULL) {
    perror("calloc() failed");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <xcalloc+0x42>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <xcalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"calloc() failed\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
void PWMStop(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00000001;
  (*((volatile unsigned long *)(ulBase + 0x00000044))) &= ~0x00008000;
}


x86 assembly (clang, -O0):
<PWMStop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%rcx
and    $0xffffffffffff7fff,%rcx
mov    %rcx,0x44(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMStop>:
andq   $0xfffffffffffffffe,(%rdi)
andq   $0xffffffffffff7fff,0x44(%rdi)
ff
ret

LLVM IR (-O0):
define void @PWMStop(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -2
store volatile i64 %7, i64* %5
%8 = load i64, i64* %2
%9 = add i64 %8, 68
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = and i64 %11, -32769
store volatile i64 %12, i64* %10
ret void
}

LLVM IR (-O2):
define void @PWMStop(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = and i64 %3, -2
store volatile i64 %4, i64* %2
%5 = add i64 %0, 68
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, -32769
store volatile i64 %8, i64* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
char *logtime();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ put(char *);
void timeout(int sig) {
  put("\nConnection timed out. Disconnecting.\n");
  printf("%s Connection timed out. Disconnecting.\n", logtime());
  fflush(NULL);
  exit(0);
}


x86 assembly (clang, -O0):
<timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe9e(%rip),%rdi
call   1030 <put@plt>
mov    $0x0,%al
call   1050 <logtime@plt>
mov    %rax,%rsi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <fflush@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<timeout>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <put@plt>
xor    %eax,%eax
call   1050 <logtime@plt>
lea    0xebc(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <fflush@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"\0AConnection timed out. Disconnecting.\0A\00"
@.str.1 = [41 x i8] c"%s Connection timed out. Disconnecting.\0A\00"
define void @timeout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%4 = call i8* (...) @logtime()
%5 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @fflush(i32* null)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [39 x i8] c"\0AConnection timed out. Disconnecting.\0A\00"
@.str.1 = [41 x i8] c"%s Connection timed out. Disconnecting.\0A\00"
define void @timeout(i32 %0) {
%2 = tail call i32 @put(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* (...) @logtime()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i32 @fflush(i32* null)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
scalar_t__ tree_balance(struct tree *);
scalar_t__ tree_justaddnode(struct tree *, void *);
int tree_addnode(struct tree *t, void *e) {
  if (tree_justaddnode(t, e) != 0)
    return -1;
  if (tree_balance(t) != 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<tree_addnode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <tree_justaddnode@plt>
cmp    $0x0,%rax
je     1153 <tree_addnode+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <tree_addnode+0x59>
mov    -0x10(%rbp),%rdi
call   1040 <tree_balance@plt>
cmp    $0x0,%rax
je     1172 <tree_addnode+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <tree_addnode+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_addnode>:
push   %rbx
mov    %rdi,%rbx
call   1030 <tree_justaddnode@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1138 <tree_addnode+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <tree_balance@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.tree = type { i32 }
define i32 @tree_addnode(%struct.tree* %0, i8* %1) {
%3 = tail call i64 @tree_justaddnode(%struct.tree* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @tree_balance(%struct.tree* %0)
%7 = icmp ne i64 %6, 0
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int runCmd(char const **);
int doWebStop(FILE *file, int argc, char **argv) {
  const char *args[] = {"/etc/init.d/bitmeterweb", "stop", 0};
  return runCmd(args);
}


x86 assembly (clang, -O0):
<doWebStop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2cd6(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cd3(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2cd0(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <runCmd@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doWebStop>:
sub    $0x18,%rsp
mov    0x2cf5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <runCmd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"/etc/init.d/bitmeterweb\00"
@.str.1 = [5 x i8] c"stop\00"
@__const.doWebStop.args = [3 x i8*] [i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @doWebStop(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca [3 x i8*]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%8 = bitcast [3 x i8*]* %7 to i8*
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %7, i64 0, i64 0
%10 = call i32 @runCmd(i8** %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [24 x i8] c"/etc/init.d/bitmeterweb\00"
@.str.1 = [5 x i8] c"stop\00"
@__const.doWebStop.args = [3 x i8*] [i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @doWebStop(i32* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
%4 = alloca [3 x i8*]
%5 = bitcast [3 x i8*]* %4 to i8*
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%7 = call i32 @runCmd(i8** %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(int, unsigned char);
void print_info_char(unsigned char byte) { __console_tx_char(6, byte); }


x86 assembly (clang, -O0):
<print_info_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x6,%edi
movzbl -0x1(%rbp),%esi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_info_char>:
mov    %edi,%esi
mov    $0x6,%edi
jmp    1030 <__console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_info_char(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_char(i32 6, i8 zeroext %0)
ret void
}
extern int ReturnInt() { return 101; }


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

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

LLVM IR (-O0):
define i32 @ReturnInt() {
ret i32 101
}

LLVM IR (-O2):
define i32 @ReturnInt() {
ret i32 101
}
unsigned int cast_long_uint_fast(long int x) { return (unsigned int)x; }


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

x86 assembly (clang, -O2):
<cast_long_uint_fast>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @cast_long_uint_fast(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ kputc(int /*<<< orphan*/);
void kputs(const char *s) {
  while (*s)
    kputc(*s++);
}


x86 assembly (clang, -O0):
<kputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <kputs+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <kputc@plt>
jmp    111c <kputs+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kputs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <kputs+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <kputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <kputs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @kputc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void pdf_compute_key(int r, unsigned int n, char *password, int pwlen,
                     unsigned char O[32], unsigned long P,
                     unsigned char ID1[16], unsigned char *encrypt_metadata,
                     unsigned char *key) {
  int i;
  unsigned char pw[32];
  unsigned char buf[4];
  unsigned char digest[16];
  unsigned int digest_len;
}


x86 assembly (clang, -O0):
<pdf_compute_key>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @pdf_compute_key(i32 %0, i32 %1, i8* %2, i32 %3, i8* %4, i64 %5, i8* %6, i8* %7, i8* %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i32
%20 = alloca [32 x i8]
%21 = alloca [4 x i8]
%22 = alloca [16 x i8]
%23 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i8* %2, i8** %12
store i32 %3, i32* %13
store i8* %4, i8** %14
store i64 %5, i64* %15
store i8* %6, i8** %16
store i8* %7, i8** %17
store i8* %8, i8** %18
ret void
}

LLVM IR (-O2):
define void @pdf_compute_key(i32 %0, i32 %1, i8* nocapture %2, i32 %3, i8* nocapture %4, i64 %5, i8* nocapture %6, i8* nocapture %7, i8* nocapture %8) {
ret void
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int off_t;

/* Variables and functions */
int /*<<< orphan*/ syscall_cp(int, int, struct iovec const *, int, long, long);
ssize_t pwritev(int fd, const struct iovec *iov, int count, off_t ofs) {
  return syscall_cp(362, fd, iov, count, (long)(ofs), (long)(ofs >> 32));
}


x86 assembly (clang, -O0):
<pwritev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movslq -0x18(%rbp),%r8
mov    -0x18(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    -0x1c(%rbp),%ecx
movslq %eax,%r9
mov    $0x16a,%edi
call   1030 <syscall_cp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwritev>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %edi,%esi
movslq %ecx,%r8
mov    $0x16a,%edi
mov    %eax,%ecx
jmp    1030 <syscall_cp@plt>

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @pwritev(i32 %0, %struct.iovec* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.iovec*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.iovec* %1, %struct.iovec** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load %struct.iovec*, %struct.iovec** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = sext i32 %12 to i64
%14 = load i32, i32* %8
%15 = ashr i32 %14, 32
%16 = sext i32 %15 to i64
%17 = call i32 @syscall_cp(i32 362, i32 %9, %struct.iovec* %10, i32 %11, i64 %13, i64 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @pwritev(i32 %0, %struct.iovec* %1, i32 %2, i32 %3) {
%5 = sext i32 %3 to i64
%6 = tail call i32 @syscall_cp(i32 362, i32 %0, %struct.iovec* %1, i32 %2, i64 %5, i64 poison)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fun();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, j;
  fun();
  for (i = 1; i < 10; i++) {
    j = 10 / (i - 2);
  }
  printf("%d\n", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <fun@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1166 <main+0x46>
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
mov    $0xa,%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <fun@plt>
lea    0xed1(%rip),%rdi
mov    $0x1,%esi
call   1040 <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
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @fun()
store i32 1, i32* %2
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 2
%11 = sdiv i32 10, %10
store i32 %11, i32* %3
br label %12
12: ; preds = %8
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %5
15: ; preds = %5
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fun()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
double abs(double);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  double numero = 3.14;
  double numero1 = abs(numero);
  printf("numero=%g |numero|=%g\n", numero, numero1);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"numero=%g |numero|=%g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 3.140000e+00, double* %2
%4 = load double, double* %2
%5 = call double @abs(double %4)
store double %5, double* %3
%6 = load double, double* %2
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %6, double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"numero=%g |numero|=%g\0A\00"
define i32 @main() {
%1 = tail call double @abs(double 3.140000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double 3.140000e+00, double %1)
ret i32 0
}
/* Variables and functions */
int fact1(int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int r;
  printf("computing fact1(5)\n");
  r = fact1(5);
  printf("fact1(5) = %d\n", r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <fact1@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%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
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1050 <fact1@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [15 x i8] c"fact1(5) = %d\0A\00"
@str = [19 x i8] c"computing fact1(5)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @fact1(i32 5)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int memcmp(void *, void *, int);
int list_match(const void *key1, const void *key2) {
  int res = 0;
  res = memcmp((void *)key1, (void *)key2, sizeof(int));
  return res == 0 ? 1 : 0;
}


x86 assembly (clang, -O0):
<list_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_match>:
push   %rax
mov    $0x4,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @list_match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @memcmp(i8* %6, i8* %7, i32 4)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
ret i32 %12
}

LLVM IR (-O2):
define i32 @list_match(i8* %0, i8* %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* %1, i32 4)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Timer_1_SaveConfig();
int /*<<< orphan*/ Timer_1_Stop();
void Timer_1_Sleep(void) {
  Timer_1_Stop();
  Timer_1_SaveConfig();
}


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

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

LLVM IR (-O0):
define void @Timer_1_Sleep() {
%1 = call i32 (...) @Timer_1_Stop()
%2 = call i32 (...) @Timer_1_SaveConfig()
ret void
}

LLVM IR (-O2):
define void @Timer_1_Sleep() {
%1 = tail call i32 (...) @Timer_1_Stop()
%2 = tail call i32 (...) @Timer_1_SaveConfig()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char const *);
void os_daemonize_terminate(const char *pid_file) { unlink(pid_file); }


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

x86 assembly (clang, -O2):
<os_daemonize_terminate>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @os_daemonize_terminate(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
void RTSocketGetLocalAddress(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSocketGetLocalAddress() {
ret void
}
/* Variables and functions */
int rand();
int new_secret_number(void) { return rand() % 100 + 1; }


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

x86 assembly (clang, -O2):
<new_secret_number>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @new_secret_number() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 100
%3 = add nsw i32 %2, 1
ret i32 %3
}
unsigned int _zip_read4(unsigned char **a) {
  unsigned int ret;
  ret = ((((((*a)[3] << 8) + (*a)[2]) << 8) + (*a)[1]) << 8) + (*a)[0];
  *a += 4;
  return ret;
}


x86 assembly (clang, -O0):
<_zip_read4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl 0x3(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movzbl 0x2(%rcx),%ecx
add    %ecx,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zip_read4>:
mov    (%rdi),%rcx
mov    (%rcx),%eax
add    $0x4,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @_zip_read4(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = getelementptr inbounds i8, i8* %2, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %5, 16
%10 = shl nuw nsw i32 %8, 8
%11 = or i32 %10, %9
%12 = getelementptr inbounds i8, i8* %2, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %11, %14
%16 = shl nuw i32 %15, 8
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = getelementptr inbounds i8, i8* %2, i64 4
store i8* %20, i8** %0
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(__attribute__((unused)) int signal) {
  printf("\tHello, I am a custom handler registered with SA_RESETHAND. Hit "
         "Control-C again to finish execution\n");
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [101 x i8] c"\09Hello, I am a custom handler registered with SA_RESETHAND. Hit Control-C again to finish execution\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [100 x i8] c"\09Hello, I am a custom handler registered with SA_RESETHAND. Hit Control-C again to finish execution\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int __raw_readl(const volatile void *addr) {
  return *(const volatile unsigned int *)addr;
}


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

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

LLVM IR (-O0):
define i32 @__raw_readl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @__raw_readl(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void OptsHandlers_printVersion(void) { printf("sr v%s\n", "0.1.4"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"sr v%s\0A\00"
@.str.1 = [6 x i8] c"0.1.4\00"
define void @OptsHandlers_printVersion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"sr v%s\0A\00"
@.str.1 = [6 x i8] c"0.1.4\00"
define void @OptsHandlers_printVersion() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int get_u32(void *vd) {
  unsigned char *d = (unsigned char *)vd;
  return (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3];
}


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

x86 assembly (clang, -O2):
<get_u32>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @get_u32(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 24
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %9, %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = or i32 %15, %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = or i32 %21, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @get_u32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
void touch_done(void) {}


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

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

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

LLVM IR (-O2):
define void @touch_done() {
ret void
}
/* Variables and functions */
scalar_t__ islower(char);
unsigned short toupper(char c) { return islower(c) ? (c - 0x20) : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1140 <toupper+0x30>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <toupper+0x37>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @toupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @islower(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 32
br label %13
10: ; preds = %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
br label %13
13: ; preds = %10, %6
%14 = phi i32 [ %9, %6 ], [ %12, %10 ]
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @toupper(i8 signext %0) {
%2 = tail call i64 @islower(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, 65504
%6 = select i1 %3, i32 %4, i32 %5
%7 = trunc i32 %6 to i16
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, int);
int rtai_shmrq(int, int);
void rtai_free(int name, void *adr) {
  int size;
  if ((size = rtai_shmrq(2, name))) {
    munmap(adr, size);
    rtai_shmrq(3, name);
  }
}


x86 assembly (clang, -O0):
<rtai_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <rtai_shmrq@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1161 <rtai_free+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <munmap@plt>
mov    -0x4(%rbp),%esi
mov    $0x3,%edi
call   1030 <rtai_shmrq@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtai_free>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x2,%edi
mov    %ebx,%esi
call   1030 <rtai_shmrq@plt>
test   %eax,%eax
je     1156 <rtai_free+0x36>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <munmap@plt>
mov    $0x3,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <rtai_shmrq@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @rtai_free(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 @rtai_shmrq(i32 2, i32 %6)
store i32 %7, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @munmap(i8* %10, i32 %11)
%13 = load i32, i32* %3
%14 = call i32 @rtai_shmrq(i32 3, i32 %13)
br label %15
15: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @rtai_free(i32 %0, i8* %1) {
%3 = tail call i32 @rtai_shmrq(i32 2, i32 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @munmap(i8* %1, i32 %3)
%7 = tail call i32 @rtai_shmrq(i32 3, i32 %0)
br label %8
8: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int read(int, unsigned int *, int);
unsigned int wma_convert_int(unsigned char *);
int wma_file_read_int(int fd, unsigned int *pi) {
  uint32_t len;
  int ret;
  len = sizeof(unsigned int);
  ret = read(fd, pi, len);
  if ((ret < 0) || (ret != len)) {
    return 0;
  }
  *pi = wma_convert_int((unsigned char *)pi);
  return 1;
}


x86 assembly (clang, -O0):
<wma_file_read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     115e <wma_file_read_int+0x3e>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     116a <wma_file_read_int+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1182 <wma_file_read_int+0x62>
mov    -0x10(%rbp),%rdi
call   1040 <wma_convert_int@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wma_file_read_int>:
push   %rbx
mov    %rsi,%rbx
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4,%ecx
jne    1146 <wma_file_read_int+0x26>
mov    %rbx,%rdi
call   1040 <wma_convert_int@plt>
mov    %eax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wma_file_read_int(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 4, i32* %6
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i32 @read(i32 %8, i32* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %2
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %14, %2
store i32 0, i32* %3
br label %24
19: ; preds = %14
%20 = load i32*, i32** %5
%21 = bitcast i32* %20 to i8*
%22 = call i32 @wma_convert_int(i8* %21)
%23 = load i32*, i32** %5
store i32 %22, i32* %23
store i32 1, i32* %3
br label %24
24: ; preds = %19, %18
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @wma_file_read_int(i32 %0, i32* %1) {
%3 = tail call i32 @read(i32 %0, i32* %1, i32 4)
%4 = icmp eq i32 %3, 4
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = bitcast i32* %1 to i8*
%7 = tail call i32 @wma_convert_int(i8* %6)
store i32 %7, i32* %1
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %9
}
int musb_init_debugfs(struct musb *musb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.musb = type opaque
define i32 @musb_init_debugfs(%struct.musb* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ api_putchar(char);
void HariMain(void) {
  api_putchar('A');
  return;
}


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

x86 assembly (clang, -O2):
<HariMain>:
mov    $0x41,%edi
jmp    1030 <api_putchar@plt>

LLVM IR (-O0):
define void @HariMain() {
%1 = call i32 @api_putchar(i8 signext 65)
ret void
}

LLVM IR (-O2):
define void @HariMain() {
%1 = tail call i32 @api_putchar(i8 signext 65)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
uint id(uint x) { return (ushort)x; }


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

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

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

LLVM IR (-O2):
define i32 @id(i32 returned %0) {
ret i32 %0
}