xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  puts("duck");
  puts("duck");
  write(1, "goose\n", 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
lea    0xeb2(%rip),%rsi
mov    $0x6,%edx
call   1040 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rsi
mov    $0x1,%edi
mov    $0x6,%edx
call   1040 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"duck\00"
@.str.1 = [7 x i8] c"goose\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
ret i32 0
}
/* Type definitions */
struct bufferevent_openssl {
  int dummy;
};
struct bufferevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_handshake(struct bufferevent_openssl *);
void be_openssl_handshakecb(struct bufferevent *bev_base, void *ctx) {
  struct bufferevent_openssl *bev_ssl = ctx;
  do_handshake(bev_ssl);
}


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

x86 assembly (clang, -O2):
<be_openssl_handshakecb>:
mov    %rsi,%rdi
jmp    1030 <do_handshake@plt>

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
%struct.bufferevent_openssl = type { i32 }
define void @be_openssl_handshakecb(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
%5 = alloca %struct.bufferevent_openssl*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.bufferevent_openssl*
store %struct.bufferevent_openssl* %7, %struct.bufferevent_openssl** %5
%8 = load %struct.bufferevent_openssl*, %struct.bufferevent_openssl** %5
%9 = call i32 @do_handshake(%struct.bufferevent_openssl* %8)
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
%struct.bufferevent_openssl = type { i32 }
define void @be_openssl_handshakecb(%struct.bufferevent* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.bufferevent_openssl*
%4 = tail call i32 @do_handshake(%struct.bufferevent_openssl* %3)
ret void
}
/* Variables and functions */
float BounceEaseOut(int);
float BounceEaseIn(float p) { return 1 - BounceEaseOut(1 - p); }


x86 assembly (clang, -O0):
<BounceEaseIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <BounceEaseOut@plt>
movaps %xmm0,%xmm1
movss  0xec2(%rip),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BounceEaseIn>:
push   %rax
movss  0xee7(%rip),%xmm1
subss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1030 <BounceEaseOut@plt>
movss  0xed2(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @BounceEaseIn(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float 1.000000e+00, %3
%5 = fptosi float %4 to i32
%6 = call float @BounceEaseOut(i32 %5)
%7 = fsub float 1.000000e+00, %6
ret float %7
}

LLVM IR (-O2):
define float @BounceEaseIn(float %0) {
%2 = fsub float 1.000000e+00, %0
%3 = fptosi float %2 to i32
%4 = tail call float @BounceEaseOut(i32 %3)
%5 = fsub float 1.000000e+00, %4
ret float %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char, int);
void fprint_mov_data_to_Rn(FILE *stream, unsigned char n, uint8_t data) {
  fprintf(stream,
          "MOV   R%X, #"
          "0x%02X"
          "                 ",
          n, data);
}


x86 assembly (clang, -O0):
<fprint_mov_data_to_Rn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%ecx
lea    0xeca(%rip),%rsi
movzbl %al,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_mov_data_to_Rn>:
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"MOV R%X,x%02X \00"
define void @fprint_mov_data_to_Rn(i32* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8
%6 = alloca i32
store i32* %0, i32** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i8, i8* %5
%9 = load i32, i32* %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 zeroext %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"MOV R%X,x%02X \00"
define void @fprint_mov_data_to_Rn(i32* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 zeroext %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: od [-bcdhovx] [file] [ [+] offset [.] [b] ]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: od [-bcdhovx] [file] [ [+] offset [.] [b] ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: od [-bcdhovx] [file] [ [+] offset [.] [b] ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}
void xfree(void *p) { return; }


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

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

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

LLVM IR (-O2):
define void @xfree(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ MultHi(int, int);
int VP8Clip8(scalar_t__);
int VP8YUVToR(int y, int v) {
  return VP8Clip8(MultHi(y, 19077) + MultHi(v, 26149) - 14234);
}


x86 assembly (clang, -O0):
<VP8YUVToR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4a85,%esi
call   1030 <MultHi@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x6625,%esi
call   1030 <MultHi@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
sub    $0x379a,%rdi
call   1040 <VP8Clip8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VP8YUVToR>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    $0x4a85,%esi
call   1030 <MultHi@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    $0x6625,%esi
call   1030 <MultHi@plt>
lea    (%rbx,%rax,1),%rdi
add    $0xffffffffffffc866,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <VP8Clip8@plt>

LLVM IR (-O0):
define i32 @VP8YUVToR(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i64 @MultHi(i32 %5, i32 19077)
%7 = load i32, i32* %4
%8 = call i64 @MultHi(i32 %7, i32 26149)
%9 = add nsw i64 %6, %8
%10 = sub nsw i64 %9, 14234
%11 = call i32 @VP8Clip8(i64 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @VP8YUVToR(i32 %0, i32 %1) {
%3 = tail call i64 @MultHi(i32 %0, i32 19077)
%4 = tail call i64 @MultHi(i32 %1, i32 26149)
%5 = add i64 %3, -14234
%6 = add i64 %5, %4
%7 = tail call i32 @VP8Clip8(i64 %6)
ret i32 %7
}
void pathcon_nm3_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathcon_nm3_decref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int __wrap_cook(void) {
  puts("PASS");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"PASS\00"
define i32 @__wrap_cook() {
%1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"PASS\00"
define i32 @__wrap_cook() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *__memalign(size_t, size_t);
void *aligned_alloc(size_t align, size_t len) { return __memalign(align, len); }


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

x86 assembly (clang, -O2):
<aligned_alloc>:
jmp    1030 <__memalign@plt>

LLVM IR (-O0):
define i8* @aligned_alloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i8* @__memalign(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @aligned_alloc(i64 %0, i64 %1) {
%3 = tail call i8* @__memalign(i64 %0, i64 %1)
ret i8* %3
}
int subseq(char *s1, char *s2) {
  if (!*s2)
    return 1;
  if (!*s1)
    return 0;
  return subseq(s1 + 1, s2 + (*s1 == *s2));
}


x86 assembly (clang, -O0):
<subseq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1139 <subseq+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1183 <subseq+0x73>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1152 <subseq+0x42>
movl   $0x0,-0x4(%rbp)
jmp    1183 <subseq+0x73>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    %rax,%rsi
call   1030 <subseq@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subseq>:
mov    (%rsi),%r8b
mov    $0x1,%eax
test   %r8b,%r8b
je     1130 <subseq+0x30>
nopl   (%rax)
movzbl (%rdi),%edx
test   %dl,%dl
je     1131 <subseq+0x31>
add    $0x1,%rdi
xor    %ecx,%ecx
cmp    %r8b,%dl
sete   %cl
movzbl (%rsi,%rcx,1),%r8d
add    %rcx,%rsi
test   %r8b,%r8b
jne    1110 <subseq+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @subseq(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %16, %11 ], [ %3, %2 ]
%7 = phi i8* [ %15, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = icmp eq i8 %9, %6
%14 = zext i1 %13 to i64
%15 = getelementptr inbounds i8, i8* %7, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %11, %5, %2
%19 = phi i32 [ 1, %2 ], [ 0, %5 ], [ 1, %11 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void nombre_archivo(int aux_id, char *archivo_tweet) {
  char final[160];
  sprintf(final, "%d.dat", aux_id);
  strcpy(archivo_tweet, "./tweet_pendientes/cliente_");
  strcat(archivo_tweet, final);
}


x86 assembly (clang, -O0):
<nombre_archivo>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xb0(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xead(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xea4(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1040 <strcat@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nombre_archivo>:
push   %r14
push   %rbx
sub    $0xa8,%rsp
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xeba(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <sprintf@plt>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d.dat\00"
@.str.1 = [28 x i8] c"./tweet_pendientes/cliente_\00"
define void @nombre_archivo(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [160 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [160 x i8], [160 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %4
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%11 = load i8*, i8** %4
%12 = getelementptr inbounds [160 x i8], [160 x i8]* %5, i64 0, i64 0
%13 = call i32 @strcat(i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d.dat\00"
@.str.1 = [28 x i8] c"./tweet_pendientes/cliente_\00"
define void @nombre_archivo(i32 %0, i8* %1) {
%3 = alloca [160 x i8]
%4 = getelementptr inbounds [160 x i8], [160 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @strcat(i8* %1, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_setfont(int, int, int, int);
void j_setfont(int arg0, int arg1, int arg2, int arg3) {
  japi_setfont(arg0, arg1, arg2, arg3);
}


x86 assembly (clang, -O0):
<j_setfont>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <japi_setfont@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_setfont>:
jmp    1030 <japi_setfont@plt>

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

LLVM IR (-O2):
define void @j_setfont(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @japi_setfont(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
void cx_setcolors(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @cx_setcolors(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Type definitions */
struct itimerspec {
  int /*<<< orphan*/ it_value;
  int /*<<< orphan*/ it_interval;
};

/* Variables and functions */
int timerfd_settime(int, int /*<<< orphan*/, struct itimerspec *,
                    int /*<<< orphan*/ *);
int itimer_start(int fd, unsigned int interval) {
  struct itimerspec timer = {
      .it_interval = {interval, 0},
      .it_value = {interval, 0},
  };
  return timerfd_settime(fd, 0, &timer, NULL);
}


x86 assembly (clang, -O0):
<itimer_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
lea    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <timerfd_settime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itimer_start>:
push   %rax
mov    %esi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rdx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <timerfd_settime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.itimerspec = type { i32, i32 }
define i32 @itimer_start(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.itimerspec
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds %struct.itimerspec, %struct.itimerspec* %5, i32 0, i32 0
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = getelementptr inbounds %struct.itimerspec, %struct.itimerspec* %5, i32 0, i32 1
%9 = load i32, i32* %4
store i32 %9, i32* %8
%10 = load i32, i32* %3
%11 = call i32 @timerfd_settime(i32 %10, i32 0, %struct.itimerspec* %5, i32* null)
ret i32 %11
}

LLVM IR (-O2):
%struct.itimerspec = type { i32, i32 }
define i32 @itimer_start(i32 %0, i32 %1) {
%3 = alloca %struct.itimerspec
%4 = bitcast %struct.itimerspec* %3 to i8*
%5 = getelementptr inbounds %struct.itimerspec, %struct.itimerspec* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.itimerspec, %struct.itimerspec* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = call i32 @timerfd_settime(i32 %0, i32 0, %struct.itimerspec* %3, i32* null)
ret i32 %7
}
long mat_modulo_l(const long a, const long b) {
  int c;
  c = a % b;
  if (c < 0) {
    c += b;
  }
  return c;
}


x86 assembly (clang, -O0):
<mat_modulo_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %edx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1133 <mat_modulo_l+0x33>
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_modulo_l>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <mat_modulo_l+0x16>
cqto
idiv   %rsi
jmp    111a <mat_modulo_l+0x1a>
xor    %edx,%edx
div    %esi
xor    %eax,%eax
test   $0x80000000,%edx
cmove  %eax,%esi
add    %edx,%esi
movslq %esi,%rax
ret

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

LLVM IR (-O2):
define i64 @mat_modulo_l(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
%4 = and i64 %3, 2147483648
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i64 0, i64 %1
%7 = add i64 %6, %3
%8 = shl i64 %7, 32
%9 = ashr exact i64 %8, 32
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ reboot(int);
int do_reboot(void *arg) {
  int *cmd = arg;
  if (reboot(*cmd))
    printf("failed to reboot(%d): %m\n", *cmd);
  return 0;
}


x86 assembly (clang, -O0):
<do_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <reboot@plt>
cmp    $0x0,%rax
je     115b <do_reboot+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_reboot>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1040 <reboot@plt>
test   %rax,%rax
je     113e <do_reboot+0x1e>
mov    (%rbx),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"failed to reboot(%d): %m\0A\00"
define i32 @do_reboot(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i64 @reboot(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %10, %1
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"failed to reboot(%d): %m\0A\00"
define i32 @do_reboot(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i64 @reboot(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %1
ret i32 0
}
int fn5(void) {
  static const int e = 6;
  return e;
}


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

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

LLVM IR (-O0):
@fn5.e = internal constant i32 6
define i32 @fn5() {
ret i32 6
}

LLVM IR (-O2):
define i32 @fn5() {
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main() {
  putchar('*');
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @putchar(i8 signext 42)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 42)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
scalar_t__ isspace(int);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void skip_space(FILE *fd) {
  int c;
  do
    c = getc(fd);
  while (isspace(c));
  ungetc(c, fd);
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
jne    113c <skip_space+0xc>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <getc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1140 <skip_space+0x10>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ungetc@plt>

LLVM IR (-O0):
define void @skip_space(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %7, %1
%5 = load i32*, i32** %2
%6 = call i32 @getc(i32* %5)
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i64 @isspace(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = load i32*, i32** %2
%14 = call i32 @ungetc(i32 %12, i32* %13)
ret void
}

LLVM IR (-O2):
define void @skip_space(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @getc(i32* %0)
%4 = tail call i64 @isspace(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i32 @ungetc(i32 %3, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void copy12(int *x, int *y) { memcpy(x, y, 12); }


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

x86 assembly (clang, -O2):
<copy12>:
mov    $0xc,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @copy12(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 12)
ret void
}
/* Variables and functions */
float powf(float, float);
float __ocl_powr_float(float src1, float src2) { return powf(src1, src2); }


x86 assembly (clang, -O0):
<__ocl_powr_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <powf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_powr_float>:
jmp    1030 <powf@plt>

LLVM IR (-O0):
define float @__ocl_powr_float(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* %4
%7 = call float @powf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__ocl_powr_float(float %0, float %1) {
%3 = tail call float @powf(float %0, float %1)
ret float %3
}
/* Type definitions */
struct in6_addr {
  int dummy;
};
typedef int /*<<< orphan*/ __be32;

/* Variables and functions */
int /*<<< orphan*/ htonl(int);
int /*<<< orphan*/ ipv6_addr_set(struct in6_addr *, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/ const);
void ipv6_addr_set_v4mapped(const __be32 addr, struct in6_addr *v4mapped) {
  ipv6_addr_set(v4mapped, 0, 0, htonl(0x0000FFFF), addr);
}


x86 assembly (clang, -O0):
<ipv6_addr_set_v4mapped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0xffff,%edi
call   1030 <htonl@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%ecx
mov    -0x4(%rbp),%r8d
xor    %edx,%edx
mov    %edx,%esi
call   1040 <ipv6_addr_set@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_addr_set_v4mapped>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0xffff,%edi
call   1030 <htonl@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    %eax,%ecx
mov    %ebp,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ipv6_addr_set@plt>

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
define void @ipv6_addr_set_v4mapped(i32 %0, %struct.in6_addr* %1) {
%3 = alloca i32
%4 = alloca %struct.in6_addr*
store i32 %0, i32* %3
store %struct.in6_addr* %1, %struct.in6_addr** %4
%5 = load %struct.in6_addr*, %struct.in6_addr** %4
%6 = call i32 @htonl(i32 65535)
%7 = load i32, i32* %3
%8 = call i32 @ipv6_addr_set(%struct.in6_addr* %5, i32 0, i32 0, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define void @ipv6_addr_set_v4mapped(i32 %0, %struct.in6_addr* %1) {
%3 = tail call i32 @htonl(i32 65535)
%4 = tail call i32 @ipv6_addr_set(%struct.in6_addr* %1, i32 0, i32 0, i32 %3, i32 %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_Laurent_container_to_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(778, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_dobldobl_Laurent_container_to_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x30a,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dobldobl_Laurent_container_to_start_system>:
mov    $0x30a,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_dobldobl_Laurent_container_to_start_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 778, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_dobldobl_Laurent_container_to_start_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 778, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 10, y;
  int *p, *q;
  p = &x;
  y = *p;
  *p = 15;
  *q = 20;
  printf("Value of x: %d\n", x);
  printf("Value of y: %d\n", y);
  printf("Value of *p: %d\n", *p);
  printf("Value of *q: %d\n", *q);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
movl   $0xf,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x14,(%rax)
mov    -0x8(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [16 x i8] c"Value of x: %d\0A\00"
@.str.1 = [16 x i8] c"Value of y: %d\0A\00"
@.str.2 = [17 x i8] c"Value of *p: %d\0A\00"
@.str.3 = [17 x i8] c"Value of *q: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
store i32* %2, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32*, i32** %4
store i32 15, i32* %8
%9 = load i32*, i32** %5
store i32 20, i32* %9
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((constructor)) void before() { printf("Hello\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Hello\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @before, i8* null }]
define void @before() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @before, i8* null }]
@str = [6 x i8] c"Hello\00"
define void @before() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tcp_usage(void) {
  printf("  tcp - Use a TCP connection\n");
  printf("    tcp[:port]	        TCP server\n");
  printf("    tcp:serverip[:port] TCP client\n");
}


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

x86 assembly (clang, -O2):
<tcp_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c" tcp - Use a TCP connection\0A\00"
@.str.1 = [35 x i8] c" tcp[:port]\09 TCP server\0A\00"
@.str.2 = [36 x i8] c" tcp:serverip[:port] TCP client\0A\00"
define void @tcp_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c" tcp - Use a TCP connection\00"
@str.3 = [34 x i8] c" tcp[:port]\09 TCP server\00"
@str.4 = [35 x i8] c" tcp:serverip[:port] TCP client\00"
define void @tcp_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void CAN1_RX0_IRQHandler() { default_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @CAN1_RX0_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
int foo(int status) {
  int s = 0;
  if (status == 1)
    s = 1;
  if (status == 3)
    s = 3;
  if (status == 4)
    s = 4;
  return s;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    111f <foo+0x1f>
movl   $0x1,-0x8(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    1130 <foo+0x30>
movl   $0x3,-0x8(%rbp)
cmpl   $0x4,-0x4(%rbp)
jne    1141 <foo+0x41>
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
cmp    $0x3,%edi
cmove  %edi,%eax
cmp    $0x4,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = zext i1 %2 to i32
%4 = icmp eq i32 %0, 3
%5 = select i1 %4, i32 3, i32 %3
%6 = icmp eq i32 %0, 4
%7 = select i1 %6, i32 4, i32 %5
ret i32 %7
}
void lidt(void *idt, unsigned int limit) {}


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

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

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

LLVM IR (-O2):
define void @lidt(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printfullpath(int path[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d ", path[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printfullpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printfullpath+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printfullpath+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printfullpath>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printfullpath+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printfullpath+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printfullpath(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
scalar_t__ geteuid();
bool check_root() {
  if (geteuid() == 0) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<check_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <geteuid@plt>
cmp    $0x0,%rax
jne    1135 <check_root+0x25>
movl   $0x1,-0x4(%rbp)
jmp    113c <check_root+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @check_root() {
%1 = alloca i32
%2 = call i64 (...) @geteuid()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @check_root() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int fun386() { return 386; }


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

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

LLVM IR (-O0):
define i32 @fun386() {
ret i32 386
}

LLVM IR (-O2):
define i32 @fun386() {
ret i32 386
}
/* Variables and functions */
size_t heap_uix(size_t i) { return (i - 1) / 2; }


x86 assembly (clang, -O0):
<heap_uix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
shr    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_uix>:
lea    -0x1(%rdi),%rax
shr    %rax
ret

LLVM IR (-O0):
define i64 @heap_uix(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 1
%5 = udiv i64 %4, 2
ret i64 %5
}

LLVM IR (-O2):
define i64 @heap_uix(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
ret i64 %3
}
int iio_trigger_detach_poll_func(struct iio_dev *indio_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @iio_trigger_detach_poll_func(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dump(int);
int /*<<< orphan*/ printf(char *);
extern void fingerprint(void) {
  printf("\tFingerprint - ");
  dump(20);
  printf("\n");
}


x86 assembly (clang, -O0):
<fingerprint>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x14,%edi
call   1040 <dump@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fingerprint>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x14,%edi
call   1050 <dump@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\09Fingerprint - \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @fingerprint() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @dump(i32 20)
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\09Fingerprint - \00"
define void @fingerprint() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @dump(i32 20)
%3 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGWINCH;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void ignore_sigwinch_sig(void) { signal(SIGWINCH, SIG_IGN); }


x86 assembly (clang, -O0):
<ignore_sigwinch_sig>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_sigwinch_sig>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGWINCH = global i32 0
@SIG_IGN = global i32 0
define void @ignore_sigwinch_sig() {
%1 = load i32, i32* @SIGWINCH
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGWINCH = global i32 0
@SIG_IGN = global i32 0
define void @ignore_sigwinch_sig() {
%1 = load i32, i32* @SIGWINCH
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int stat(char const *, struct stat *);
int isDirectory(const char *filename) {
  struct stat s;
  int res = stat(filename, &s);
  if (res == -1)
    return -1;
  return S_ISDIR(s.st_mode);
}


x86 assembly (clang, -O0):
<isDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1152 <isDirectory+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <isDirectory+0x3d>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDirectory>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1137 <isDirectory+0x17>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isDirectory(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %15
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i32 @S_ISDIR(i32 %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isDirectory(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}